Skip to content

refactor: update dynamicOptionsSelector#1195

Merged
asanehisa merged 11 commits intomainfrom
dynamic
Apr 30, 2026
Merged

refactor: update dynamicOptionsSelector#1195
asanehisa merged 11 commits intomainfrom
dynamic

Conversation

@asanehisa
Copy link
Copy Markdown
Contributor

@asanehisa asanehisa commented Apr 30, 2026

Tested with devMode and confirmed multi select use in Locator still works!
Screenshot 2026-04-30 at 11 24 09 AM

Renamed it to MultiSelector as that's the only diff between it and BasicSelector. Allow it to take in static values and dynamic like BasicSelector

# Conflicts:
#	packages/visual-editor/src/editor/YextField.tsx
@asanehisa asanehisa changed the title refactor: update dynamicOptionSelector refactor: update dynamicOptionsSelector Apr 30, 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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

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: 77a23416-8fdd-4076-a7a6-177b1bb3ea33

📥 Commits

Reviewing files that changed from the base of the PR and between 9ef369a and a70ca67.

⛔ Files ignored due to path filters (1)
  • packages/visual-editor/src/components/testing/screenshots/Locator/[mobile] latest version default props.png is excluded by !**/*.png, !packages/visual-editor/src/components/testing/screenshots/**
📒 Files selected for processing (1)
  • packages/visual-editor/src/editor/YextField.test.tsx

Walkthrough

This PR removes the DynamicOptionsSelector implementation and its exports, adds a new MultiSelectorField implementation (+types, override, tests), and migrates callers (Locator, ImageField, TranslatableStringField, EmbeddedFieldStringInput, docs) from DynamicOption/DynamicOptionsSelector types to EmbeddedStringOption/MultiSelector types. YextField runtime support and overload for dynamicSelect are deleted, and the field registry and barrel exports are updated to include multiSelector. Tests covering DynamicOptionsSelector were removed; new tests for MultiSelectorField were added.

Sequence Diagram(s)

sequenceDiagram
participant User
participant VisualEditor as Visual Editor
participant YextField
participant MultiSelector as MultiSelectorField
participant Store as Data Store

User->>VisualEditor: open editor / interact with locator or image field
VisualEditor->>YextField: render field config (type: "multiSelector")
YextField->>MultiSelector: instantiate field (options provider or static options)
MultiSelector->>VisualEditor: request options (call options function) 
VisualEditor->>MultiSelector: return options (EmbeddedStringOption[])
User->>MultiSelector: select/deselect option(s)
MultiSelector->>YextField: emit onChange ({ selections: [...] } or undefined)
YextField->>Store: persist updated field value
Store-->>VisualEditor: confirm save / update UI
Loading

Possibly related PRs

Suggested labels

create-dev-release

Suggested reviewers

  • benlife5
  • mkilpatrick
  • briantstephan
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor: update dynamicOptionsSelector' directly summarizes the main change: renaming and refactoring the dynamic options selector component to MultiSelector with expanded functionality.
Description check ✅ Passed The description is clearly related to the changeset, explaining the rename to MultiSelector, the addition of static value support, testing confirmation, and including a screenshot demonstrating the working functionality.
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 dynamic

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

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 the current code and only fix it if needed.

Inline comments:
In `@packages/visual-editor/src/fields/DynamicMultiSelectField.tsx`:
- Around line 7-10: The code currently allows object option values via
DynamicOptionValueTypes which breaks selection matching in getItemSummary (it
compares with === and object references change across renders), so restrict
option values to stable primitives: remove `object` from DynamicOptionValueTypes
(leaving `string | number | boolean`) and ensure DynamicOptionSelection<T> and
any callers/props expecting object values are updated to use a primitive key
(e.g., id string/number) instead; alternatively, if object support is required,
change getItemSummary to match by a stable key field instead of strict equality,
but the minimal fix is to remove `object` from the union and update usages
accordingly.
🪄 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: 6fc416f6-352f-4a4e-8936-8d1220299934

📥 Commits

Reviewing files that changed from the base of the PR and between 3ae2db9 and 39440d3.

📒 Files selected for processing (14)
  • packages/visual-editor/src/components/Locator.tsx
  • packages/visual-editor/src/components/LocatorResultCard.tsx
  • packages/visual-editor/src/docs/components.md
  • packages/visual-editor/src/editor/DynamicOptionsSelector.test.tsx
  • packages/visual-editor/src/editor/DynamicOptionsSelector.tsx
  • packages/visual-editor/src/editor/YextField.test.tsx
  • packages/visual-editor/src/editor/YextField.tsx
  • packages/visual-editor/src/editor/index.ts
  • packages/visual-editor/src/fields/DynamicMultiSelectField.test.tsx
  • packages/visual-editor/src/fields/DynamicMultiSelectField.tsx
  • packages/visual-editor/src/fields/TranslatableStringField.tsx
  • packages/visual-editor/src/fields/fields.ts
  • packages/visual-editor/src/fields/index.ts
  • packages/visual-editor/src/internal/puck/constant-value-fields/Image.tsx
💤 Files with no reviewable changes (3)
  • packages/visual-editor/src/editor/DynamicOptionsSelector.test.tsx
  • packages/visual-editor/src/editor/index.ts
  • packages/visual-editor/src/editor/DynamicOptionsSelector.tsx

Comment thread packages/visual-editor/src/fields/DynamicMultiSelectField.tsx Outdated
@asanehisa asanehisa marked this pull request as ready for review April 30, 2026 15:57
Comment thread packages/visual-editor/src/components/Locator.tsx Outdated
Comment thread packages/visual-editor/src/components/Locator.tsx Outdated
Comment thread packages/visual-editor/src/fields/DynamicMultiSelectField.tsx Outdated
@asanehisa asanehisa requested a review from mkilpatrick April 30, 2026 17:31
Comment thread packages/visual-editor/src/fields/MultiSelectorField.tsx Outdated
briantstephan
briantstephan previously approved these changes Apr 30, 2026
Copy link
Copy Markdown
Contributor

@jwartofsky-yext jwartofsky-yext left a comment

Choose a reason for hiding this comment

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

lgtm!

briantstephan
briantstephan previously approved these changes Apr 30, 2026
# Conflicts:
#	packages/visual-editor/src/components/LocatorResultCard.tsx
#	packages/visual-editor/src/editor/YextField.test.tsx
#	packages/visual-editor/src/editor/YextField.tsx
#	packages/visual-editor/src/internal/puck/constant-value-fields/Image.tsx
Comment thread packages/visual-editor/src/editor/EmbeddedFieldStringInput.tsx
@asanehisa asanehisa dismissed stale reviews from briantstephan and jwartofsky-yext via 9ef369a April 30, 2026 18:27
@asanehisa asanehisa merged commit 86b1438 into main Apr 30, 2026
17 checks passed
@asanehisa asanehisa deleted the dynamic branch April 30, 2026 18:52
anguyen-yext2 pushed a commit that referenced this pull request Apr 30, 2026
Tested with devMode and confirmed multi select use in Locator still
works!
<img width="1840" height="1196" alt="Screenshot 2026-04-30 at 11 24
09 AM"
src="https://github.com/user-attachments/assets/97f6ae19-ca55-4508-892a-1865b61e70d3"
/>

Renamed it to MultiSelector as that's the only diff between it and
BasicSelector. Allow it to take in static values and dynamic like
BasicSelector

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
anguyen-yext2 added a commit that referenced this pull request Apr 30, 2026
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