Skip to content

Conversation

@colton-demetriou
Copy link
Contributor

Screenshot 2025-11-05 at 11 12 53 AM

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

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 Nov 5, 2025

Walkthrough

Added two new localization keys (nearbyLocationsEmptyState and nearbyLocationsEmptyStateSectionHidden) across many locale files under packages/visual-editor/locales/*. Updated packages/visual-editor/src/components/pageSections/NearbyLocations.tsx to render an editor-only placeholder (MapPinOff icon plus localized messages using useTemplateMetadata) when in editor mode and nearby data is missing or disabled; non-editor behavior unchanged. Updated packages/visual-editor/src/components/contentBlocks/MapboxStaticMap.tsx to switch two editor-empty-state translation usages from t(...) to {pt(...)}. No exported/public API signatures were modified.

Sequence Diagram(s)

sequenceDiagram
    participant Editor as User / Editor
    participant Nearby as NearbyLocations Component
    participant Puck as Puck (editor state)
    participant Locale as Localization JSON

    Editor->>Nearby: mount / render
    Nearby->>Puck: read puck.isEditing
    alt editor mode AND no nearby data or disabled
        Nearby->>Locale: pt("nearbyLocationsEmptyStateSectionHidden"), pt("nearbyLocationsEmptyState") with entityType & radius (fallback 10)
        Locale-->>Nearby: localized strings
        Note right of Nearby#lightblue: render editor placeholder\n(MapPinOff + messages)
        Nearby-->>Editor: display editor empty-state
    else non-editor or data present
        Nearby->>Nearby: normal data checks & render standard UI
        Nearby-->>Editor: display standard nearby locations UI
    end
Loading
sequenceDiagram
    participant Editor as User / Editor
    participant Mapbox as MapboxStaticMap Component
    participant Locale as Localization JSON

    Editor->>Mapbox: mount / render (missing API key)
    alt editor mode AND missing API key
        Mapbox->>Locale: pt("staticMapEmptyStateSectionHidden"), pt("staticMapEmptyStateAddApiKey")
        Locale-->>Mapbox: localized strings
        Note right of Mapbox#lightgreen: render editor empty-state UI\n(using pt(...) instead of t(...))
        Mapbox-->>Editor: display static map editor empty-state
    else normal flow
        Mapbox->>Mapbox: render map or non-editor empty-state
        Mapbox-->>Editor: display normal UI
    end
Loading

Possibly related PRs

  • chore: slots QA part 4 #871 — modifies MapboxStaticMap editor empty-state translation rendering and touches visual-editor locale keys; strongly related.

Suggested labels

create-dev-release

Suggested reviewers

  • mkilpatrick
  • briantstephan
  • asanehisa

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: empty state for NearbyLocations' clearly and concisely summarizes the main change: adding an empty state UI component for the NearbyLocations feature, which aligns with the changeset of new locale translations and updated NearbyLocations component logic.
Description check ✅ Passed The description is related to the changeset as it includes a screenshot demonstrating the newly implemented empty state UI for NearbyLocations, which is the main purpose of this pull request.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch empty-locations

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2811006 and b7a0dad.

📒 Files selected for processing (1)
  • packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/visual-editor/src/components/pageSections/NearbyLocations.tsx

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d394ba and 7520c2c.

📒 Files selected for processing (26)
  • packages/visual-editor/locales/cs/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/da/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/de/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/en-GB/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/en/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/es/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/et/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/fi/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/fr/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/hr/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/hu/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/it/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/ja/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/lt/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/lv/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/nb/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/nl/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/pl/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/pt/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/ro/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/sk/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/sv/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/tr/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/zh-TW/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/zh/visual-editor.json (1 hunks)
  • packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (2)
packages/visual-editor/src/components/atoms/index.ts (2)
  • PageSection (9-9)
  • Body (1-1)
packages/visual-editor/src/utils/index.ts (1)
  • themeManagerCn (9-9)
🔇 Additional comments (21)
packages/visual-editor/locales/et/visual-editor.json (1)

455-457: Translation key correctly added with proper formatting and alphabetical placement.

The new nearbyLocationsEmptyStateSectionHidden key is properly positioned between "name" and "noAvailableFields" in alphabetical order, with correct JSON syntax (proper string delimiters and comma placement). The Estonian translation reads naturally for the intended empty-state message.

Please verify that this translation key is referenced in the NearbyLocations component code and that it's been consistently added across all 25 locale files mentioned in the PR summary.

packages/visual-editor/locales/sk/visual-editor.json (1)

457-457: Translation key successfully added to all 25 locale files with correct syntax and formatting.

Verification confirms nearbyLocationsEmptyStateSectionHidden is present across all visual-editor locale files with proper JSON structure and alphabetical placement.

packages/visual-editor/locales/cs/visual-editor.json (1)

457-457: ✅ Localization key properly added and ordered.

The new nearbyLocationsEmptyStateSectionHidden key is consistently placed in alphabetical order with an appropriate Czech translation. The change follows the established localization structure.

packages/visual-editor/locales/tr/visual-editor.json (1)

456-456: ✅ Turkish localization consistent with other locales.

The key is properly positioned alphabetically and includes an appropriate Turkish translation.

packages/visual-editor/locales/zh-TW/visual-editor.json (1)

456-456: ✅ Traditional Chinese localization correctly added.

The key placement and Traditional Chinese translation are consistent with the broader localization pattern.

packages/visual-editor/locales/pl/visual-editor.json (1)

457-457: ✅ Polish localization properly integrated.

The new translation key is correctly positioned and includes an appropriate Polish translation matching the intended meaning across all locales.

packages/visual-editor/locales/nl/visual-editor.json (1)

456-456: ✅ Dutch localization consistent and complete.

The key is properly alphabetically ordered with an appropriate Dutch translation.

packages/visual-editor/locales/sv/visual-editor.json (1)

457-457: ✅ Swedish localization correctly implemented.

The addition follows the established pattern with proper alphabetical ordering and an appropriate Swedish translation.

packages/visual-editor/locales/de/visual-editor.json (1)

455-455: ✅ German localization properly added.

The key is correctly positioned and includes an appropriate German translation consistent with the other locales.

packages/visual-editor/locales/lv/visual-editor.json (1)

456-456: ✅ Latvian localization complete and consistent.

The new translation key is properly positioned and includes an appropriate Latvian translation. All reviewed locale files follow an identical, well-structured pattern.

packages/visual-editor/locales/fi/visual-editor.json (1)

456-456: Localization entry added correctly.

The new nearbyLocationsEmptyStateSectionHidden key is properly formatted and positioned, with an appropriate Finnish translation.

packages/visual-editor/locales/en-GB/visual-editor.json (1)

455-455: Localization entry added correctly.

The new nearbyLocationsEmptyStateSectionHidden key is properly formatted and positioned, with an appropriate British English translation.

packages/visual-editor/locales/es/visual-editor.json (1)

455-455: Localization entry added correctly.

The new nearbyLocationsEmptyStateSectionHidden key is properly formatted and positioned, with an appropriate Spanish translation.

packages/visual-editor/locales/nb/visual-editor.json (1)

456-456: Localization entry added correctly.

The new nearbyLocationsEmptyStateSectionHidden key is properly formatted and positioned, with an appropriate Norwegian Bokmål translation.

packages/visual-editor/locales/hu/visual-editor.json (1)

456-456: Localization entry added correctly.

The new nearbyLocationsEmptyStateSectionHidden key is properly formatted and positioned, with an appropriate Hungarian translation.

packages/visual-editor/locales/hr/visual-editor.json (1)

456-456: Localization entry added correctly.

The new nearbyLocationsEmptyStateSectionHidden key is properly formatted and positioned, with an appropriate Croatian translation.

packages/visual-editor/locales/pt/visual-editor.json (1)

456-456: Localization entry added correctly.

The new nearbyLocationsEmptyStateSectionHidden key is properly formatted and positioned, with an appropriate Portuguese translation.

packages/visual-editor/locales/ro/visual-editor.json (2)

456-456: Localization entry added correctly.

The new nearbyLocationsEmptyStateSectionHidden key is properly formatted and positioned, with an appropriate Romanian translation.


1-634: Localization completeness verified across all 25 locales.

All 25 locale files contain the nearbyLocationsEmptyStateSectionHidden key with full coverage. No missing locales detected. Consistency and uniform key naming confirmed.

packages/visual-editor/locales/zh/visual-editor.json (1)

456-456: LGTM! Translation key added correctly.

The new localization key nearbyLocationsEmptyStateSectionHidden has been added consistently across all locale files to support the empty state feature.

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

42-43: New dependencies imported for empty state feature.

The imports support the editor-mode empty state placeholder UI:

  • MapPinOff icon displays when no API key is available
  • themeManagerCn applies consistent styling

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (1)

494-497: Missing translation key (already flagged).

As noted in the previous review, nearbyLocationsEmptyStateNoLocations is not defined in any locale file and uses template literal interpolation instead of react-i18next's standard syntax.

Per the earlier review: add the key to all locale files with {{radius}} placeholder syntax, then pass the interpolation object:

-              <Body variant="base" className="text-gray-500 font-normal">
-                {pt(
-                  "nearbyLocationsEmptyStateNoLocations",
-                  `No locations within ${data?.radius ?? 10} miles`
-                )}
-              </Body>
+              <Body variant="base" className="text-gray-500 font-normal">
+                {pt(
+                  "nearbyLocationsEmptyStateNoLocations",
+                  { radius: data?.radius ?? 10 }
+                )}
+              </Body>
🧹 Nitpick comments (1)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (1)

476-480: Consider separate empty states for distinct scenarios.

The current condition merges two different cases: missing configuration (!enableNearbyLocations) and no results found. Your comment suggests you're already considering whether these should have separate states.

While the merged approach works, distinct messages could improve clarity:

  • Missing config → "Configuration incomplete" with guidance
  • No results → "No locations within X miles" (current message)

This is an optional refinement rather than a defect.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1c9716 and f1cd682.

📒 Files selected for processing (1)
  • packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 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/pageSections/NearbyLocations.tsx
🧬 Code graph analysis (1)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (1)
packages/visual-editor/src/components/atoms/index.ts (2)
  • PageSection (9-9)
  • Body (1-1)
🔇 Additional comments (1)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (1)

30-30: LGTM! Appropriate imports for the empty state.

The pt import is correct for editor-only translations, and MapPinOff is a semantically appropriate icon for the no-locations state.

Also applies to: 43-43

benlife5
benlife5 previously approved these changes Nov 6, 2025
coltondemetriou added 2 commits November 6, 2025 12:06
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1cd682 and facc80f.

📒 Files selected for processing (26)
  • packages/visual-editor/locales/cs/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/da/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/de/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/en-GB/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/en/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/es/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/et/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/fi/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/fr/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/hr/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/hu/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/it/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/ja/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/lt/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/lv/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/nb/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/nl/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/pl/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/pt/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/ro/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/sk/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/sv/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/tr/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/zh-TW/visual-editor.json (1 hunks)
  • packages/visual-editor/locales/zh/visual-editor.json (1 hunks)
  • packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (11)
  • packages/visual-editor/locales/sk/visual-editor.json
  • packages/visual-editor/locales/en-GB/visual-editor.json
  • packages/visual-editor/locales/en/visual-editor.json
  • packages/visual-editor/locales/nl/visual-editor.json
  • packages/visual-editor/locales/fi/visual-editor.json
  • packages/visual-editor/locales/nb/visual-editor.json
  • packages/visual-editor/locales/pt/visual-editor.json
  • packages/visual-editor/locales/lv/visual-editor.json
  • packages/visual-editor/locales/cs/visual-editor.json
  • packages/visual-editor/locales/fr/visual-editor.json
  • packages/visual-editor/locales/zh-TW/visual-editor.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
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.
📚 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/pageSections/NearbyLocations.tsx
🧬 Code graph analysis (1)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (2)
packages/visual-editor/src/internal/hooks/useMessageReceivers.ts (1)
  • TemplateMetadataContext (167-167)
packages/visual-editor/src/components/atoms/index.ts (2)
  • PageSection (9-9)
  • Body (1-1)
🪛 Biome (2.1.2)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx

[error] 483-483: This hook is being called conditionally, but all hooks must be called in the exact same order in every component render.

For React to preserve state between calls, hooks needs to be called unconditionally and always in the same order.
See https://reactjs.org/docs/hooks-rules.html#only-call-hooks-at-the-top-level

(lint/correctness/useHookAtTopLevel)

🔇 Additional comments (17)
packages/visual-editor/locales/pl/visual-editor.json (1)

457-458: Localization additions look good.

The two new keys (nearbyLocationsEmptyState and nearbyLocationsEmptyStateSectionHidden) are properly positioned in alphabetical order after the "name" key, with appropriate Polish translations and correct template variable syntax.

packages/visual-editor/locales/es/visual-editor.json (1)

455-456: Localization additions look good.

The two new keys are properly placed in alphabetical order with accurate Spanish translations and consistent placeholder formatting ({{entityType}} and {{radius}}).

packages/visual-editor/locales/it/visual-editor.json (1)

456-457: Localization additions look good.

Italian translations are properly added in alphabetical order with correct syntax and messaging for the nearby locations empty state feature.

packages/visual-editor/locales/ja/visual-editor.json (1)

456-457: Localization additions look good.

Japanese translations are properly integrated in alphabetical order with appropriate template variable handling for entity type and radius parameters.

packages/visual-editor/locales/et/visual-editor.json (1)

456-457: Localization additions look good.

Estonian translations are properly positioned in alphabetical order with consistent syntax and appropriate phrasing for the empty state and hidden section messages.

packages/visual-editor/locales/da/visual-editor.json (1)

457-458: Localization additions look good.

Danish translations are correctly added in alphabetical order with proper placeholder syntax and contextually appropriate messaging.

packages/visual-editor/locales/lt/visual-editor.json (1)

456-457: Localization additions look good.

Lithuanian translations are properly integrated in alphabetical order with correct template variable syntax and appropriate messaging.

packages/visual-editor/locales/ro/visual-editor.json (1)

456-457: Localization additions look good.

Romanian translations are correctly positioned in alphabetical order with consistent syntax and appropriate messaging for the nearby locations empty state UI.

packages/visual-editor/locales/de/visual-editor.json (1)

455-456: LGTM! Translation keys added correctly.

The two new localization keys for the NearbyLocations empty state are properly formatted with i18next interpolation placeholders ({{entityType}}, {{radius}}).

packages/visual-editor/locales/hu/visual-editor.json (1)

456-457: LGTM! Hungarian translations added correctly.

The localization keys are properly formatted with the required interpolation variables.

packages/visual-editor/locales/tr/visual-editor.json (1)

456-457: LGTM! Turkish translations added correctly.

The localization keys follow the correct i18next interpolation format.

packages/visual-editor/locales/sv/visual-editor.json (1)

457-458: LGTM! Swedish translations added correctly.

The new empty state keys are properly formatted with interpolation placeholders.

packages/visual-editor/locales/hr/visual-editor.json (1)

456-457: LGTM! Croatian translations added correctly.

The localization keys are properly structured with the required interpolation variables.

packages/visual-editor/locales/zh/visual-editor.json (1)

456-457: LGTM! Chinese translations added correctly.

The empty state keys are properly formatted with i18next interpolation syntax.

packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (3)

30-30: LGTM! Correct use of pt for editor-only placeholders.

Using pt (placeholder translation) instead of t is appropriate for editor-only UI elements, as confirmed in the past review comments.


476-521: Verify the different fallback values for entityType.

The two empty state messages use different fallback values when entityTypeDisplayName is unavailable:

  • Line 499: "page"
  • Line 510: "entity"

If this is intentional to provide more contextually appropriate defaults, consider adding a comment explaining the reasoning. Otherwise, consider using consistent fallbacks for both messages.


487-518: Editor empty state implementation looks good!

The implementation correctly:

  • Shows the empty state only in editor mode (puck.isEditing)
  • Uses the correct translation keys that were added to all locale files
  • Passes proper interpolation variables (entityType, radius)
  • Provides a clear visual indicator with the MapPinOff icon

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (1)

477-519: Consider distinguishing between "disabled" and "no results" scenarios.

The empty state is triggered by two distinct conditions:

  1. !enableNearbyLocations – missing required configuration (coordinates, API keys, etc.)
  2. API query completed but returned no results

Currently, both messages are shown for either scenario:

  • "Section hidden for this {{entityType}}" (more accurate for missing config)
  • "No {{entityType}} within {{radius}} miles" (more accurate for empty results)

When configuration is missing, no search is actually performed, so stating "No {{entityType}} within X miles" may be semantically imprecise. Similarly, "Section hidden" might be misleading when results are simply empty.

Based on your comment "asking Elisabeth if this should be a separate state," this dual-message approach appears intentional, but you may want to verify whether showing both messages for both scenarios provides the clearest user experience.

Minor inconsistency: The fallback values differ between messages ("page" at line 499 vs. "entity" at line 510). This may be intentional for context but could be unified for consistency.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between facc80f and 2811006.

📒 Files selected for processing (1)
  • packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
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.
📚 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/pageSections/NearbyLocations.tsx
🧬 Code graph analysis (1)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (2)
packages/visual-editor/src/internal/hooks/useMessageReceivers.ts (1)
  • TemplateMetadataContext (167-167)
packages/visual-editor/src/components/atoms/index.ts (2)
  • PageSection (9-9)
  • Body (1-1)
🔇 Additional comments (2)
packages/visual-editor/src/components/pageSections/NearbyLocations.tsx (2)

30-30: LGTM!

The new imports are appropriate: pt for editor-specific translations, MapPinOff for the empty state icon, and TemplateMetadataContext for accessing entity type metadata.

Also applies to: 43-44


395-395: LGTM!

The useContext hook is now correctly placed at the top level of the component, resolving the previous critical issue where it was called conditionally. This follows React Hooks rules.

benlife5
benlife5 previously approved these changes Nov 6, 2025
@colton-demetriou colton-demetriou merged commit 30f6b01 into main Nov 6, 2025
15 checks passed
@colton-demetriou colton-demetriou deleted the empty-locations branch November 6, 2025 20:31
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