chore: merge main into custom-components-templates#1220
Conversation
Before: <img width="671" height="331" alt="Screenshot 2026-05-05 at 4 11 15 PM" src="https://github.com/user-attachments/assets/05196088-08b8-4e7f-a8ed-7c6c012a950c" /> After: <img width="668" height="286" alt="Screenshot 2026-05-05 at 4 13 05 PM" src="https://github.com/user-attachments/assets/f3d4c1e1-5286-4582-ac9d-41fddf57b1c2" /> (ignore the font changing) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1. Adds a framework for linked entities This PR does not modify the existing components like Events, FAQs, Testimonials, etc These functions can be used in new components or generated components Includes example in the README 2. Swaps from using LINKED_ENTITY_SCHEMAS to ENTITY_FIELDS 3. Separates the entity field picker into two sections for linked fields and entity fields. <img width="378" height="453" alt="Screenshot 2026-05-05 at 7 08 15 PM" src="https://github.com/user-attachments/assets/14070116-e4f7-4fa1-88f0-e69812847336" /> [https://dev.yext.com/s/1000168938/yextsites/67162/branches/6818/editor#pageSetId=linkedentityframework&local[…]ase2&entityId=9125102&xYextDebug=true](https://dev.yext.com/s/1000168938/yextsites/67162/branches/6818/editor#pageSetId=linkedentityframework&locale=en&themeId=dev-release2&entityId=9125102&xYextDebug=true) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Kilpatrick <mkilpatrick@yext.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Using the category names breaks when the locale is not `en` because the names are translated. This updates the mapping to use the IDs of the top-level categories instead, which is stable. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This turns toPuckFields into a true adapter instead of just a TS cast
because actual usage was causing console errors. Also add some exports
that should've been exported.
Context:
- We export Yext field types like `basicSelector`, `ctaSelector`,
`entityField`, `multiSelector`, etc.
- We also export `YextPuckFieldOverrides` and `YextAutoField`.
- Today `toPuckFields()` is basically:
```
export const toPuckFields = <Props extends DefaultComponentProps = DefaultComponentProps>(
fields: YextFields<Props> | YextFieldMap<Props>
): Fields<Props> => fields as unknown as Fields<Props>;
```
Problem:
- Puck’s `overrides.fieldTypes.basicSelector` is not enough.
- Puck’s `AutoFieldInternal` still tries to render a default child
renderer from `defaultFields[field.type]`.
- For `basicSelector`, `defaultFields.basicSelector` is undefined,
causing:
React.jsx: type is invalid -- expected a string ... but got undefined
Check the render method of AutoFieldInternal
---------
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Adds a new createSlottedItemSource which functions like createItemSource but for slot-based components Migrates Events Section, FAQs Section, Teams Section, Testimonials Section, Insights Section, and Products Section to this new system Updates the Entity Field picker to use the name of the subfield for entity fields. <img width="284" height="566" alt="Screenshot 2026-05-11 at 1 00 11 PM" src="https://github.com/user-attachments/assets/34fc74bb-db63-4ffd-b135-09342c51c6ae" /> Adds migration 0076 to map from the old system to the new. Testing site here: https://dev.yext.com/s/1000168938/yextsites/67197/branches/6862/editor#pageSetId=slotslocation&locale=en&themeId=dev-release3&entityId=9125102 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Kilpatrick <mkilpatrick@yext.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Uses the embedded field utilities to support modifying the directory card title https://github.com/user-attachments/assets/d192a5a5-3a71-4dcc-b6cf-7af15ffa0815 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Entity Field pickers under Mappings in itemSource and slottedItemSource are scoped to the items selected in the parent field. However embedded field pickers did not have this scoping. This change fixes the embedded field pickers to respect the scope. Also includes passing the sourceField to the Rich Text editor so that it can scope to subfields properly. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
When linked entity fields with multiple entities are used for a standard
(non-mapping) prop, we show a warning message. This PR changes the
message to:
{{linkedField}} contains multiple linked entities. Using the first one
for {{resolvedField}}.
The previous message was "Multiple linked entities were found for
{{resolvedField}} using the first linked entity."
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Updates the warning that is displayed when there are multiple linked entities for a field to use the display names instead of API names. Shows the linked entities warning when a linked entity field is chosen by the embedded field picker. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
primaryLocales were not getting normalized, which led to a mismatch where "en-GB" in the locale and "en_gb" in the primaryLocale would be seen as different and the locale would be pre-prended. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
auto-screenshot-update: true
WalkthroughThis PR introduces directory card title field mapping, a new Sequence Diagram(s)sequenceDiagram
participant User
participant EmbeddedFieldStringInput
participant EntityFieldSelector
participant WarningSystem
participant Toast
User->>EmbeddedFieldStringInput: select field from picker
EmbeddedFieldStringInput->>EntityFieldSelector: onFieldSelect callback
EntityFieldSelector->>WarningSystem: call warnOnMultiValueLinkedEntityTraversal
WarningSystem->>WarningSystem: resolve linked/resolved field display names
alt multi-value linked entity traversed
WarningSystem->>Toast: show warning with display names
Toast-->>User: warning message
else scoped selection
WarningSystem-->>EntityFieldSelector: no warning
end
sequenceDiagram
participant DirectoryGrid
participant DirectoryCardsSource
participant DirectoryCard
participant CardResolver
DirectoryGrid->>DirectoryCardsSource: request item source with cardTitle mapping
DirectoryCardsSource-->>DirectoryGrid: provide resolved cardTitle values
DirectoryGrid->>CardResolver: syncLinkedSlotMappedCards with children
CardResolver->>DirectoryCard: create card with data.cardTitle and childRef
CardResolver->>DirectoryCard: bind cardTitle into HeadingSlot
DirectoryCard-->>DirectoryGrid: return configured card slot data
Possibly related PRs
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)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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: 2
🧹 Nitpick comments (1)
packages/visual-editor/src/components/directory/DirectoryWrapper.tsx (1)
79-85: 💤 Low valueNon-null assertion on
mappingsassumes it's always defined.Line 79 uses
directoryCardsSource.defaultValue.mappings!with a non-null assertion. IfcreateSlottedItemSourcedoesn't guaranteemappingsexists indefaultValue, this could throw at runtime. Consider adding a defensive check or ensuring the type guarantees this.♻️ Suggested defensive approach
const getNormalizedDirectoryGridData = ( value: typeof directoryCardsSource.value | undefined ): typeof directoryCardsSource.value => ({ ...directoryCardsSource.defaultValue, ...value, field: "dm_directoryChildren", constantValueEnabled: false, constantValue: [], mappings: { - ...directoryCardsSource.defaultValue.mappings!, + ...directoryCardsSource.defaultValue.mappings, ...value?.mappings, cardTitle: { - ...directoryCardsSource.defaultValue.mappings!.cardTitle, + ...directoryCardsSource.defaultValue.mappings?.cardTitle, ...value?.mappings?.cardTitle, field: value?.mappings?.cardTitle?.field || "name", }, }, });🤖 Prompt for 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. In `@packages/visual-editor/src/components/directory/DirectoryWrapper.tsx` around lines 79 - 85, The code unsafely uses a non-null assertion on directoryCardsSource.defaultValue.mappings and may throw if defaultValue.mappings is undefined; update the merge to defensively fallback to an empty object (or a safe default) when accessing directoryCardsSource.defaultValue.mappings and value?.mappings and similarly guard cardTitle (e.g., use directoryCardsSource.defaultValue.mappings ?? {} and value?.mappings ?? {} before spreading, and ensure cardTitle defaults before reading .field) so that the merge in DirectoryWrapper.tsx (references: directoryCardsSource, defaultValue, mappings, cardTitle, value) never assumes mappings exists.
🤖 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/tr/visual-editor.json`:
- Line 565: The translation for the key "linkedEntityMultiValueWarning" is
incorrect: replace the phrase "ilkini kullanma" with "ilkini kullan" so the
message correctly states that the first linked entity will be used (use the
placeholders {{linkedField}} and {{resolvedField}} as-is); update the value for
linkedEntityMultiValueWarning accordingly to read "{{linkedField}} birden fazla
bağlantılı varlık içerir. {{resolvedField}} için ilkini kullan."
In `@packages/visual-editor/src/editor/EmbeddedFieldStringInput.tsx`:
- Around line 244-248: The onFieldSelect call can send an unscoped resolution
path when getSubDocument(...) returns undefined; compute a resolutionPath =
sourceField ? `${sourceField}.${fieldName}` : fieldName and compute a doc =
sourceField ? getSubDocument(streamDocument, sourceField) : undefined, but if
sourceField is present and doc is undefined, pass streamDocument as the document
arg while still passing the full scoped resolutionPath; update the onFieldSelect
invocation (references: onFieldSelect, sourceField, fieldName, getSubDocument,
streamDocument) to always supply the scoped resolutionPath when sourceField
exists even if the subdocument lookup fails.
---
Nitpick comments:
In `@packages/visual-editor/src/components/directory/DirectoryWrapper.tsx`:
- Around line 79-85: The code unsafely uses a non-null assertion on
directoryCardsSource.defaultValue.mappings and may throw if
defaultValue.mappings is undefined; update the merge to defensively fallback to
an empty object (or a safe default) when accessing
directoryCardsSource.defaultValue.mappings and value?.mappings and similarly
guard cardTitle (e.g., use directoryCardsSource.defaultValue.mappings ?? {} and
value?.mappings ?? {} before spreading, and ensure cardTitle defaults before
reading .field) so that the merge in DirectoryWrapper.tsx (references:
directoryCardsSource, defaultValue, mappings, cardTitle, value) never assumes
mappings exists.
🪄 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: 63f514a9-f9be-418d-bc58-ad02a66adb3d
⛔ Files ignored due to path filters (4)
packages/visual-editor/src/components/testing/screenshots/Directory/[desktop] version 77 - City with custom card titles.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/Directory/[mobile] version 77 - City with custom card titles.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/Directory/[tablet] version 77 - City with custom card titles.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 59 with showSectionHeading false.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**
📒 Files selected for processing (53)
packages/visual-editor/CHANGELOG.mdpackages/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/package.jsonpackages/visual-editor/src/components/directory/Directory.test.tsxpackages/visual-editor/src/components/directory/Directory.tsxpackages/visual-editor/src/components/directory/DirectoryCard.tsxpackages/visual-editor/src/components/directory/DirectoryWrapper.tsxpackages/visual-editor/src/components/directory/directoryChildReference.test.tsxpackages/visual-editor/src/components/migrations/0077_directory_card_title_field.tspackages/visual-editor/src/components/migrations/migrationRegistry.tspackages/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsxpackages/visual-editor/src/editor/EmbeddedFieldStringInput.tsxpackages/visual-editor/src/editor/TranslatableRichTextField.test.tsxpackages/visual-editor/src/editor/TranslatableRichTextField.tsxpackages/visual-editor/src/editor/yextEntityFieldUtils.test.tspackages/visual-editor/src/editor/yextEntityFieldUtils.tspackages/visual-editor/src/fields/EntityFieldSelectorField.test.tsxpackages/visual-editor/src/fields/EntityFieldSelectorField.tsxpackages/visual-editor/src/fields/TranslatableStringField.test.tsxpackages/visual-editor/src/fields/TranslatableStringField.tsxpackages/visual-editor/src/fields/repeatedSourceFieldContext.tspackages/visual-editor/src/utils/linkedEntityWarningUtils.test.tspackages/visual-editor/src/utils/linkedEntityWarningUtils.tspackages/visual-editor/src/utils/normalizeLocale.test.tspackages/visual-editor/src/utils/normalizeLocale.tspackages/visual-editor/src/utils/resolveYextEntityField.test.tspackages/visual-editor/src/utils/resolveYextEntityField.tsstarter/localData/dev-dm-city-stream__en__8932945.jsonstarter/src/dev.config.ts
auto-screenshot-update: true
commit: |
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/src/editor/EmbeddedFieldStringInput.tsx`:
- Around line 244-250: The code currently passes the full
`${sourceField}.${fieldName}` as the field path even when resolutionDocument is
a scoped child, which breaks lookups against the subdocument; create a new
resolutionFieldPath that is relative to the scoped document (e.g. const
resolutionFieldPath = sourceField ? fieldName : resolutionPath) and call
onFieldSelect?.(resolutionPath, resolutionFieldPath, resolutionDocument) instead
of passing the full path twice; update references to resolutionPath,
resolutionDocument, getSubDocument, and onFieldSelect 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: b04bff50-eb5f-40c7-9594-ef7e183158a7
📒 Files selected for processing (3)
packages/visual-editor/locales/platform/tr/visual-editor.jsonpackages/visual-editor/src/components/directory/DirectoryWrapper.tsxpackages/visual-editor/src/editor/EmbeddedFieldStringInput.tsx
|
@coderabbitai This PR just represents a merge of our main branch into the 2026-custom-components-templates branch via this temporary merge-main branch. We don't want to introduce changes to what we're pulling in from main since it would make the feature branch unnecessarily diverge from main. We only care about comments that address issues with the merge itself (e.g. improperly resolved merge conflicts, files that are necessary on main but not on the feature branch, etc.). |
|
Let me go ahead and resolve any existing comments I've already posted on this PR. ✏️ Learnings added
✅ Actions performedComments resolved. Approval is disabled; enable |
4c539f9
into
2026-custom-components-templates
Merges main into 2026-custom-components-templates
Includes all features and fixes from 1.3.0
Test site: https://dev.yext.com/s/1000168938/yextsites/67237/branches/6963/editor#pageSetId=testmerge&locale=en