Skip to content

Conversation

@mkouzel-yext
Copy link
Contributor

When searches for countries are made, e.g. “United States”, the filter we apply is on the address.countryCode field as opposed to the builtin.location field. We do not want the address.countryCode filters to have pill boxes rendered by the AppliedFilters component.

J=WAT-5185
TEST=manual

https://jam.dev/c/64d8c4e3-559c-4730-86b9-957927c05e16

When searches for countries are made, e.g. “United States”, the filter we apply is on the address.countryCode field as opposed to the builtin.location field. We do not want the address.countryCode filters to have pill boxes rendered by the AppliedFilters component.

J=WAT-5185
TEST=manual

https://jam.dev/c/64d8c4e3-559c-4730-86b9-957927c05e16
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 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 6, 2025

Walkthrough

A new COUNTRY_CODE_FIELD constant with the value "address.countryCode" was introduced in the Locator component file. This constant was added to the hiddenFields arrays in both the LocatorInternal's AppliedFilters configuration and the FilterModal's AppliedFilters configuration. This change expands the set of fields that are hidden from the AppliedFilters display, making the country code field non-removable in the UI.

Suggested reviewers

  • benlife5
  • Fondryext

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: hiding pill boxes for address.countryCode filters in the locator component.
Description check ✅ Passed The description clearly explains the reason for the change and provides context about country searches filtering on address.countryCode instead of builtin.location.
✨ 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 hide-address.countryCode-in-applied-filters

📜 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 507da02 and 0057eaf.

📒 Files selected for processing (1)
  • packages/visual-editor/src/components/Locator.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/Locator.tsx
🔇 Additional comments (3)
packages/visual-editor/src/components/Locator.tsx (3)

78-78: LGTM! Clear constant declaration.

The COUNTRY_CODE_FIELD constant follows the established naming convention and is positioned logically alongside LOCATION_FIELD.


1166-1166: Correctly hides country code filters from the applied filters display.

The addition of COUNTRY_CODE_FIELD to the hiddenFields array ensures that country code filters won't appear as removable pills in the UI, which aligns with the PR objective.


1519-1519: Consistent implementation across both AppliedFilters instances.

This mirrors the change at line 1166, ensuring country code filters are hidden in both the main view and the filter modal. The consistency is important for a complete fix.


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

@mkouzel-yext mkouzel-yext requested review from a team November 6, 2025 19:07
@mkouzel-yext mkouzel-yext merged commit 4f3b28f into main Nov 6, 2025
14 checks passed
@mkouzel-yext mkouzel-yext deleted the hide-address.countryCode-in-applied-filters branch November 6, 2025 22:05
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