Skip to content

feat: allow boolean display fields in locator#1207

Merged
anguyen-yext2 merged 4 commits into
mainfrom
boolean-display-fields
May 8, 2026
Merged

feat: allow boolean display fields in locator#1207
anguyen-yext2 merged 4 commits into
mainfrom
boolean-display-fields

Conversation

@anguyen-yext2
Copy link
Copy Markdown
Contributor

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

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
@anguyen-yext2 anguyen-yext2 requested review from a team May 6, 2026 16:01
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

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
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 18acf653-5c16-4477-a5fa-111874908f4c

📥 Commits

Reviewing files that changed from the base of the PR and between d89b17b and a872c29.

📒 Files selected for processing (2)
  • packages/visual-editor/locales/platform/fr/visual-editor.json
  • packages/visual-editor/src/components/LocatorResultCard.tsx
✅ Files skipped from review due to trivial changes (1)
  • packages/visual-editor/locales/platform/fr/visual-editor.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/visual-editor/src/components/LocatorResultCard.tsx

Walkthrough

Adds whenFalse and whenTrue localization keys across visual-editor platform locales and extends Locator result-card editing so primary/secondary/tertiary headings can source boolean fields and specify trueDisplayText/falseDisplayText. Locator.tsx now uses useTemplateMetadata() and a BOOLEAN_SUPPORTED_FIELDS list to dynamically show/hide field selector vs constant value and to surface the boolean display-text editors when a selected field’s type is type.boolean. LocatorResultCard.tsx schema and resolve logic were updated to accept boolean source fields and return conditional display text for boolean values.

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
Loading

Possibly related PRs

  • yext/visual-editor#1047: Both PRs modify the same LocatorResultCard component and its field/schema definitions (LocatorResultCard.tsx/LocatorResultCardFields).
  • yext/visual-editor#1152: Modifies Locator.tsx; related to template-metadata-driven field wiring used here.
  • yext/visual-editor#1190: Refactors translatable-string/field-schema handling overlapping with schema and resolve logic changes.

Suggested labels

create-dev-release

Suggested reviewers

  • mkilpatrick
  • benlife5
  • asanehisa
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: enabling boolean fields as display options in the locator result card headings.
Description check ✅ Passed The description clearly explains the feature being added: boolean display field support in locator headings with configurable true/false display text.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch boolean-display-fields

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Fondryext
Fondryext previously approved these changes May 6, 2026
Comment thread packages/visual-editor/src/components/Locator.tsx Outdated
Copy link
Copy Markdown
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

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 54bd67c and d89b17b.

📒 Files selected for processing (27)
  • packages/visual-editor/locales/platform/cs/visual-editor.json
  • packages/visual-editor/locales/platform/da/visual-editor.json
  • packages/visual-editor/locales/platform/de/visual-editor.json
  • packages/visual-editor/locales/platform/en-GB/visual-editor.json
  • packages/visual-editor/locales/platform/en/visual-editor.json
  • packages/visual-editor/locales/platform/es/visual-editor.json
  • packages/visual-editor/locales/platform/et/visual-editor.json
  • packages/visual-editor/locales/platform/fi/visual-editor.json
  • packages/visual-editor/locales/platform/fr/visual-editor.json
  • packages/visual-editor/locales/platform/hr/visual-editor.json
  • packages/visual-editor/locales/platform/hu/visual-editor.json
  • packages/visual-editor/locales/platform/it/visual-editor.json
  • packages/visual-editor/locales/platform/ja/visual-editor.json
  • packages/visual-editor/locales/platform/lt/visual-editor.json
  • packages/visual-editor/locales/platform/lv/visual-editor.json
  • packages/visual-editor/locales/platform/nb/visual-editor.json
  • packages/visual-editor/locales/platform/nl/visual-editor.json
  • packages/visual-editor/locales/platform/pl/visual-editor.json
  • packages/visual-editor/locales/platform/pt/visual-editor.json
  • packages/visual-editor/locales/platform/ro/visual-editor.json
  • packages/visual-editor/locales/platform/sk/visual-editor.json
  • packages/visual-editor/locales/platform/sv/visual-editor.json
  • packages/visual-editor/locales/platform/tr/visual-editor.json
  • packages/visual-editor/locales/platform/zh-TW/visual-editor.json
  • packages/visual-editor/locales/platform/zh/visual-editor.json
  • packages/visual-editor/src/components/Locator.tsx
  • packages/visual-editor/src/components/LocatorResultCard.tsx

Comment thread packages/visual-editor/locales/platform/fr/visual-editor.json Outdated
Comment thread packages/visual-editor/src/components/Locator.tsx
Comment thread packages/visual-editor/src/components/LocatorResultCard.tsx
@anguyen-yext2 anguyen-yext2 merged commit 5fef9a8 into main May 8, 2026
17 checks passed
@anguyen-yext2 anguyen-yext2 deleted the boolean-display-fields branch May 8, 2026 16:48
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.

4 participants