feat: allow boolean display fields in locator#1207
Conversation
Allow boolean display fields in locator result card headings (Primary Heading, Secondary Heading, and Tertiary Heading). When a boolean field is selected, allow the users to set what should display in the result card for true and false cases via 2 static text boxes. J=WAT-5527 TEST=manual tested in dev mode, Rob approved UI https://yext.slack.com/archives/C0A1G447MPD/p1778015267221689
|
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. |
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds Sequence Diagram(s)sequenceDiagram
participant EditorUI as Visual Editor UI
participant LocatorComp as Locator / ResultCard Field Editor
participant TemplateMeta as TemplateMetadata (useTemplateMetadata)
participant Resolver as LocatorResultCard resolveText
EditorUI->>LocatorComp: open result-card field editor
LocatorComp->>TemplateMeta: request locatorDisplayFields metadata
TemplateMeta-->>LocatorComp: return field types (including booleans)
LocatorComp->>EditorUI: render field selector + conditional editors
EditorUI->>LocatorComp: select field (type.boolean) or constant
LocatorComp->>EditorUI: show trueDisplayText/falseDisplayText editors (if boolean)
EditorUI->>Resolver: save configuration (field + true/false texts)
Resolver->>Resolver: on render, read projected value
alt projected value is boolean
Resolver->>Resolver: return trueDisplayText or falseDisplayText
else
Resolver->>Resolver: fall back to string parsing logic
end
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/visual-editor/locales/platform/fr/visual-editor.json`:
- Line 514: Update the French translation value for the key "whenFalse" to be
grammatically complete by changing its string to "Quand c'est faux" so it
matches the structure of the adjacent "whenTrue" translation and maintains
consistency in phrases used in the visual-editor locale.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bd53ed66-7f31-4c31-a97d-9f715298e98d
📒 Files selected for processing (27)
packages/visual-editor/locales/platform/cs/visual-editor.jsonpackages/visual-editor/locales/platform/da/visual-editor.jsonpackages/visual-editor/locales/platform/de/visual-editor.jsonpackages/visual-editor/locales/platform/en-GB/visual-editor.jsonpackages/visual-editor/locales/platform/en/visual-editor.jsonpackages/visual-editor/locales/platform/es/visual-editor.jsonpackages/visual-editor/locales/platform/et/visual-editor.jsonpackages/visual-editor/locales/platform/fi/visual-editor.jsonpackages/visual-editor/locales/platform/fr/visual-editor.jsonpackages/visual-editor/locales/platform/hr/visual-editor.jsonpackages/visual-editor/locales/platform/hu/visual-editor.jsonpackages/visual-editor/locales/platform/it/visual-editor.jsonpackages/visual-editor/locales/platform/ja/visual-editor.jsonpackages/visual-editor/locales/platform/lt/visual-editor.jsonpackages/visual-editor/locales/platform/lv/visual-editor.jsonpackages/visual-editor/locales/platform/nb/visual-editor.jsonpackages/visual-editor/locales/platform/nl/visual-editor.jsonpackages/visual-editor/locales/platform/pl/visual-editor.jsonpackages/visual-editor/locales/platform/pt/visual-editor.jsonpackages/visual-editor/locales/platform/ro/visual-editor.jsonpackages/visual-editor/locales/platform/sk/visual-editor.jsonpackages/visual-editor/locales/platform/sv/visual-editor.jsonpackages/visual-editor/locales/platform/tr/visual-editor.jsonpackages/visual-editor/locales/platform/zh-TW/visual-editor.jsonpackages/visual-editor/locales/platform/zh/visual-editor.jsonpackages/visual-editor/src/components/Locator.tsxpackages/visual-editor/src/components/LocatorResultCard.tsx
auto-screenshot-update: true
Allow boolean display fields in locator result card headings (Primary Heading, Secondary Heading, and Tertiary Heading). When a boolean field is selected, allow the users to set what should display in the result card for true and false cases via 2 static text boxes.
J=WAT-5527
TEST=manual
tested in dev mode, Rob approved UI
https://yext.slack.com/archives/C0A1G447MPD/p1778015267221689