Skip to content

feat: allow Nearby Location Section customization - #1337

Merged
asanehisa merged 2 commits into
release/1.xfrom
nearby-custom
Sep 30, 2026
Merged

asanehisa merged 2 commits into
release/1.xfrom
nearby-custom

Conversation

@asanehisa

@asanehisa asanehisa commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

This uses the locationData from the content endpoint. Similar to how we don't have built-in UI for Locator / Directory changes (to the search config or directory config), we won't have any for Nearby Location Section but if you adjust the fields returned from the content endpoint, you can use them in the Nearby Location Section like so

Screenshot 2026-09-29 at 3 28 29 PM Screenshot 2026-09-29 at 3 25 38 PM If a value doesn't exist for the new title field or resolves to "", it uses `[[name]]` to avoid breaking changes as well as needing to add a migration.

Had to adjust Locator test for it to pass

@asanehisa asanehisa added the create-dev-release Triggers dev release workflow label Sep 29, 2026
@github-actions

Copy link
Copy Markdown
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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

commit: 1e355f1

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: af8fa8b0-e9ae-4114-aac9-4f061cc96858

📥 Commits

Reviewing files that changed from the base of the PR and between c528845 and 1e355f1.

📒 Files selected for processing (1)
  • packages/visual-editor/src/components/locator/Locator.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The nearby locations editor now supports a configurable title field for cards. It defaults to the location’s name field and passes the configured value to each card. Each card resolves the title using the current language and displays the location name if the resolved title is blank. The location document type now accepts additional string-keyed fields. A locator test now checks that the search combobox has the value “Custom Search Area.”

Sequence Diagram(s)

sequenceDiagram
  participant NearbyLocationsCardsWrapper
  participant NearbyLocationCard
  participant i18n
  participant resolveComponentData
  NearbyLocationsCardsWrapper->>NearbyLocationCard: Pass configured title and location data
  NearbyLocationCard->>i18n: Read current language
  NearbyLocationCard->>resolveComponentData: Resolve title against location data as plain text
  resolveComponentData-->>NearbyLocationCard: Return resolved title
  NearbyLocationCard->>NearbyLocationCard: Use location name if resolved title is blank
Loading

Suggested reviewers: benlife5

Priority: ⬇️ Low

Change: Feature

Merge Risk: ⚪ Minimal · up to 1e355

The configured nearby-card title retains a location-name fallback, and the locator test checks the restored search value. No material merge risk was identified.

Architecture Summary

Architecture risk: 🔵 Low · up to 1e355

The change affects 1 system.

Changed systems: packages/visual-editor

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/visual-editor (ui) was modified; 4 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/visual-editor/src/components/pageSections/NearbyLocations/NearbyLocationCard.tsx: Imports resolveComponentData and the useTranslation hook for resolving a title binding in the current language.
  • observed — Modified behavior in packages/visual-editor/src/components/pageSections/NearbyLocations/NearbyLocationCard.tsx: Adds an optional title prop typed from the wrapper’s title data and documents it as the shared title binding.
  • observed — Modified behavior in packages/visual-editor/src/components/pageSections/NearbyLocations/NearbyLocationCard.tsx: Destructures title from the card props and obtains the current i18n instance.
  • observed — Modified behavior in packages/visual-editor/src/components/pageSections/NearbyLocations/NearbyLocationCard.tsx: Resolves the configured title against locationData as plain text in the current language. Uses the resolved value when its trimmed form is nonempty; otherwise falls back to the location’s name.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: customization support for the Nearby Location Section.
Description check ✅ Passed The description explains the Content Endpoint field usage, title fallback behavior, and related Locator test update. It directly matches the changeset.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@asanehisa
asanehisa marked this pull request as ready for review September 30, 2026 14:17
@asanehisa
asanehisa merged commit 4f20b8a into release/1.x Sep 30, 2026
19 checks passed
@asanehisa
asanehisa deleted the nearby-custom branch September 30, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-dev-release Triggers dev release workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants