Skip to content

Conversation

@Fondryext
Copy link
Contributor

This PR upgrades search-ui-react to 2.0, and adjusts the logic to pass the events api-permissioned key to the new SearchAnalyticsConfig
J=WAT-5282
TEST=manual

Packaged with pages starter and in dev mode caused events api events to fire and land in snowflake

This PR upgrades search-ui-react to 2.0, and adjusts
the logic to pass the events api-permissioned key to the
new SearchAnalyticsConfig
J=WAT-5282
TEST=manual

Packaged with pages starter and in dev mode caused events api
events to fire and land in snowflake
@github-actions
Copy link
Contributor

Warning: Component files have been updated but no migrations have been added. See https://github.com/yext/visual-editor/blob/main/packages/visual-editor/src/components/migrations/README.md for more information.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Walkthrough

The changes update the visual-editor and starter packages to support @yext/search-ui-react v2.0.0. The createSearchAnalyticsConfig function is refactored to derive analytics configuration from the YEXT_PUBLIC_VISUAL_EDITOR_APP_API_KEY environment variable instead of experience keys, with updated environment and region mappings to use specific constant values. An explicit type cast in the AnalyticsProvider prop spreading is removed, and the function signature is simplified by removing the experienceKeyEnvVar parameter.

Suggested reviewers

  • benlife5
  • asanehisa
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: upgrading search-ui-react to 2.0 to enable the events API, which aligns with the primary modifications across package dependencies and analytics configuration.
Description check ✅ Passed The description is clearly related to the changeset, explaining the upgrade to search-ui-react 2.0 and adjustments to pass the events API key to SearchAnalyticsConfig, which matches the file modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c234b1 and 88767ff.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • packages/visual-editor/package.json
  • packages/visual-editor/src/components/Locator.tsx
  • packages/visual-editor/src/utils/searchHeadlessConfig.ts
  • starter/package.json
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-29T22:00:03.843Z
Learnt from: mkouzel-yext
Repo: yext/visual-editor PR: 833
File: packages/visual-editor/src/components/Locator.tsx:1050-1057
Timestamp: 2025-10-29T22:00:03.843Z
Learning: In packages/visual-editor/src/components/Locator.tsx, the AppliedFilters component is intentionally rendered in two locations (inside the filter modal and outside it) as per the design requirements. This dual rendering should not be flagged as a duplicate issue.

Applied to files:

  • packages/visual-editor/src/components/Locator.tsx
📚 Learning: 2026-01-12T21:31:40.196Z
Learnt from: benlife5
Repo: yext/visual-editor PR: 980
File: packages/visual-editor/src/components/pageSections/AboutSection/AboutSectionDetailsColumn.tsx:310-316
Timestamp: 2026-01-12T21:31:40.196Z
Learning: Do not use React hooks inside arbitrary callback functions. Hooks must be called only at the top level of React function components or custom hooks. If a callback (e.g., getItemSummary in a framework context like Puck) is not a component or a custom hook, refactor to move hook usage to a component/hook, or pass necessary data via props/state. This guideline applies to all TSX files in the repo.

Applied to files:

  • packages/visual-editor/src/components/Locator.tsx
🧬 Code graph analysis (1)
packages/visual-editor/src/utils/searchHeadlessConfig.ts (1)
packages/visual-editor/src/utils/index.ts (1)
  • createSearchAnalyticsConfig (25-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: call_unit_test / unit_tests (24.x)
  • GitHub Check: call_unit_test / unit_tests (20.x)
  • GitHub Check: call_unit_test / unit_tests (22.x)
  • GitHub Check: semgrep/ci
🔇 Additional comments (5)
starter/package.json (1)

35-35: LGTM!

The dependency upgrade is consistent with the peer dependency change in packages/visual-editor/package.json.

packages/visual-editor/src/utils/searchHeadlessConfig.ts (2)

84-91: LGTM on switching to the app API key.

The change to use YEXT_PUBLIC_VISUAL_EDITOR_APP_API_KEY for analytics aligns with the v2.0.0 SearchAnalyticsConfig requirements and the PR objective of enabling the events API.


109-121: Fix enum constant reference: Environment.PROD should be Environment.PRODUCTION.

On line 113, the code references Environment.PROD, but the @yext/search-headless-react library uses Environment.PRODUCTION. Additionally, verify that the lowercase string comparisons on lines 111 and 116 are compatible with the enum values. If the enum values are uppercase (e.g., "SANDBOX", "US"), these comparisons will fail since environment and cloudRegion are converted to lowercase, causing incorrect fallback behavior (all non-SANDBOX environments map to PROD, all non-US regions map to EU).

packages/visual-editor/src/components/Locator.tsx (1)

585-585: Good removal of the type cast.

Eliminating the as any cast improves type safety. The searchAnalyticsConfig is now properly typed as SearchAnalyticsConfig (from line 117 in searchHeadlessConfig.ts), which should align with AnalyticsProvider's expected props in v2.0.0.

packages/visual-editor/package.json (1)

165-165: Verify that @yext/search-ui-react v2.0.0 is available.

The peer dependency upgrade to @yext/search-ui-react ^2.0.0 cannot be verified—this version does not exist in the public npm registry (latest public version is 1.9.4). If this is an internal Yext package, confirm v2.0.0 is released and available to consumers. The code correctly imports SearchAnalyticsConfig from this package in searchHeadlessConfig.ts, but consumers upgrading this package must have access to the v2.0.0 release.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants