chore: merge main into custom components templates#1239
chore: merge main into custom components templates#1239jwartofsky-yext wants to merge 8 commits into
Conversation
Allows EntityFieldSelector and itemSource to treat text fields as satisfying a rich_text field. This allows mapping rich_text fields to ordinary text fields and treats objects with text fields as satisfying the rich_text requirement for itemSource and slottedItemSource. Verified that RichText fields can be mapped to ordinary Text fields. Verified that ordinary Text fields cannot be mapped to RichText. Verified that itemSource/slottedItemSource mapping requirements now accept Text in place of RichText. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Removes the "Api Key" prop from the Static Map Section and Mapbox Static Map components. They now use the key from the environment variable. If the key fails to load, the component will not appear on the live page. Tested using local starter. --------- 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>
long emails before: <img width="686" height="205" alt="Screenshot 2026-06-09 at 1 54 42 PM" src="https://github.com/user-attachments/assets/b09dfe11-168a-4c73-b0e7-d137624f6e0c" /> <img width="395" height="308" alt="Screenshot 2026-06-09 at 1 54 47 PM" src="https://github.com/user-attachments/assets/2990e7d0-9816-477b-9d8d-43aa9fc179e2" /> after: <img width="870" height="278" alt="Screenshot 2026-06-09 at 1 50 41 PM" src="https://github.com/user-attachments/assets/b18134e2-a564-442c-89d5-4537e4298c3c" /> <img width="394" height="368" alt="Screenshot 2026-06-09 at 1 50 34 PM" src="https://github.com/user-attachments/assets/7c6de2cc-b13e-413e-98a2-b5d2f708f869" /> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Slack for context: https://yext.slack.com/archives/C02UVSE7P6W/p1781045532366289?thread_ts=1780506413.231889&cid=C02UVSE7P6W https://github.com/user-attachments/assets/503ce53b-a359-4824-9c33-ae704efcf54d --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
In mobile view, display a "show more" button at the end of the search results instead of pagination. J=WAT-5580 TEST=manual tested in dev mode and platform https://drive.google.com/file/d/1Bw7xFbmvdOncZl37DXCalcTiLl3zod0n/view?usp=sharing --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
|
| Key | Languages Removed |
|---|---|
fields.apiKey |
cs,da de,en en-GB,es et,fi fr,hr hu,it ja,lt lv,nb nl,pl pt,ro sk,sv tr,zh zh-TW |
staticMapEmptyStateAddApiKey
| Key | Languages Removed |
|---|---|
staticMapEmptyStateAddApiKey |
cs,da de,en en-GB,es et,fi fr,hr hu,it ja,lt lv,nb nl,pl pt,ro sk,sv tr,zh zh-TW |
WalkthroughVersion 1.3.3 bundles four functional changes. The Mapbox API key is now sourced from Possibly Related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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: 4
🤖 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/components/Locator.tsx`:
- Around line 1730-1744: The useEffect hook in the Locator component updates the
prevIsMobile.current ref on line 1733 before checking the searchLoading guard
condition. This causes the mobile transition flag to be consumed even when the
effect returns early due to a pending search, so subsequent invocations lose
track that a mobile switch occurred. Move the assignment of prevIsMobile.current
= isMobile to the end of the effect (after all the early return checks but
before the closing brace) so that the ref only gets updated when the effect
actually completes its mobile transition logic, not when it exits early.
In `@packages/visual-editor/src/docs/components.md`:
- Around line 806-809: The documentation for StaticMapSection currently does not
explicitly mention the required YEXT_MAPBOX_API_KEY environment variable
dependency, which could mislead users into thinking no configuration is needed.
Add clear documentation stating that StaticMapSection requires the
YEXT_MAPBOX_API_KEY environment variable (sourced from _env) to function
properly, and include any relevant setup instructions or notes about this
dependency.
In `@packages/visual-editor/src/internal/utils/getFilteredEntityFields.ts`:
- Around line 247-256: The forEach loop iterating through filter.types can add
the same field multiple times to updatedFilteredEntitySubFields because a field
may match both directly and through compatibility paths. After the forEach loop
completes but before assigning updatedFilteredEntitySubFields back to
filteredEntitySubFields, deduplicate the array by field.name to ensure each
field appears only once. Use a filter or reduce approach that keeps the first
occurrence of each unique field name, maintaining deterministic output for
direct callers.
- Around line 168-175: Remove the export statement from the
getCompatibleEntityFieldTypes function in getFilteredEntityFields.ts to keep it
internal and avoid expanding the src/internal public API surface. Instead of
exporting this helper, update the calling code in yextEntityFieldUtils.ts
(around line 357) to pass requiredTypes directly to getFilteredEntityFields and
let that function handle the entity field type compatibility expansion
internally in a single location rather than delegating it to a separate exported
utility function.
🪄 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: 4b962652-e596-404c-b15b-1b9b5556cf89
📒 Files selected for processing (73)
packages/visual-editor/CHANGELOG.mdpackages/visual-editor/locales/components/cs/visual-editor.jsonpackages/visual-editor/locales/components/da/visual-editor.jsonpackages/visual-editor/locales/components/de/visual-editor.jsonpackages/visual-editor/locales/components/en-GB/visual-editor.jsonpackages/visual-editor/locales/components/en/visual-editor.jsonpackages/visual-editor/locales/components/es/visual-editor.jsonpackages/visual-editor/locales/components/et/visual-editor.jsonpackages/visual-editor/locales/components/fi/visual-editor.jsonpackages/visual-editor/locales/components/fr/visual-editor.jsonpackages/visual-editor/locales/components/hr/visual-editor.jsonpackages/visual-editor/locales/components/hu/visual-editor.jsonpackages/visual-editor/locales/components/it/visual-editor.jsonpackages/visual-editor/locales/components/ja/visual-editor.jsonpackages/visual-editor/locales/components/lt/visual-editor.jsonpackages/visual-editor/locales/components/lv/visual-editor.jsonpackages/visual-editor/locales/components/nb/visual-editor.jsonpackages/visual-editor/locales/components/nl/visual-editor.jsonpackages/visual-editor/locales/components/pl/visual-editor.jsonpackages/visual-editor/locales/components/pt/visual-editor.jsonpackages/visual-editor/locales/components/ro/visual-editor.jsonpackages/visual-editor/locales/components/sk/visual-editor.jsonpackages/visual-editor/locales/components/sv/visual-editor.jsonpackages/visual-editor/locales/components/tr/visual-editor.jsonpackages/visual-editor/locales/components/zh-TW/visual-editor.jsonpackages/visual-editor/locales/components/zh/visual-editor.jsonpackages/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/Locator.test.tsxpackages/visual-editor/src/components/Locator.tsxpackages/visual-editor/src/components/contentBlocks/Emails.tsxpackages/visual-editor/src/components/contentBlocks/MapboxStaticMap.tsxpackages/visual-editor/src/components/header/HeaderLinks.tsxpackages/visual-editor/src/components/header/PrimaryHeaderSlot.tsxpackages/visual-editor/src/components/header/viewport.tspackages/visual-editor/src/components/migrations/0078_remove_mapbox_api_key_props.tspackages/visual-editor/src/components/migrations/migrationRegistry.tspackages/visual-editor/src/components/pageSections/ProfessionalHeroSection.tsxpackages/visual-editor/src/components/pageSections/StaticMapSection.test.tsxpackages/visual-editor/src/components/pageSections/StaticMapSection.tsxpackages/visual-editor/src/docs/components.mdpackages/visual-editor/src/editor/yextEntityFieldUtils.test.tspackages/visual-editor/src/editor/yextEntityFieldUtils.tspackages/visual-editor/src/fields/EntityFieldSelectorField.test.tsxpackages/visual-editor/src/hooks/useViewport.tspackages/visual-editor/src/internal/utils/getFilteredEntityFields.test.tspackages/visual-editor/src/internal/utils/getFilteredEntityFields.tspackages/visual-editor/src/utils/migrate.test.tsstarter/localData/dev-location-stream__en__cbafb9cd1c3e63d9814e236ba9181377.json
💤 Files with no reviewable changes (1)
- packages/visual-editor/src/components/header/viewport.ts
| React.useEffect(() => { | ||
| const switchedToMobile = isMobile && !prevIsMobile.current; | ||
|
|
||
| prevIsMobile.current = isMobile; | ||
|
|
||
| if (!switchedToMobile || searchLoading || (currentOffset ?? 0) === 0) { | ||
| return; | ||
| } | ||
|
|
||
| // Always reload from offset 0 if switching to mobile | ||
| setMobileResults([]); | ||
| searchActions.setOffset(0); | ||
| executeSearch(searchActions); | ||
| setSearchState("loading"); | ||
| }, [currentOffset, isMobile, searchActions, searchLoading]); |
There was a problem hiding this comment.
Fix mobile switch detection when a query is in-flight.
On Line 1733, prevIsMobile.current is updated before the searchLoading guard. If the viewport switches to mobile while loading, the transition is consumed and the offset reset can be skipped.
Suggested fix
React.useEffect(() => {
- const switchedToMobile = isMobile && !prevIsMobile.current;
-
- prevIsMobile.current = isMobile;
-
- if (!switchedToMobile || searchLoading || (currentOffset ?? 0) === 0) {
+ if (searchLoading) {
return;
}
+ const switchedToMobile = isMobile && !prevIsMobile.current;
+ prevIsMobile.current = isMobile;
+
+ if (!switchedToMobile || (currentOffset ?? 0) === 0) {
+ return;
+ }
+
// Always reload from offset 0 if switching to mobile
setMobileResults([]);
searchActions.setOffset(0);
executeSearch(searchActions);
setSearchState("loading");
}, [currentOffset, isMobile, searchActions, searchLoading]);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| React.useEffect(() => { | |
| const switchedToMobile = isMobile && !prevIsMobile.current; | |
| prevIsMobile.current = isMobile; | |
| if (!switchedToMobile || searchLoading || (currentOffset ?? 0) === 0) { | |
| return; | |
| } | |
| // Always reload from offset 0 if switching to mobile | |
| setMobileResults([]); | |
| searchActions.setOffset(0); | |
| executeSearch(searchActions); | |
| setSearchState("loading"); | |
| }, [currentOffset, isMobile, searchActions, searchLoading]); | |
| React.useEffect(() => { | |
| if (searchLoading) { | |
| return; | |
| } | |
| const switchedToMobile = isMobile && !prevIsMobile.current; | |
| prevIsMobile.current = isMobile; | |
| if (!switchedToMobile || (currentOffset ?? 0) === 0) { | |
| return; | |
| } | |
| // Always reload from offset 0 if switching to mobile | |
| setMobileResults([]); | |
| searchActions.setOffset(0); | |
| executeSearch(searchActions); | |
| setSearchState("loading"); | |
| }, [currentOffset, isMobile, searchActions, searchLoading]); |
🤖 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/Locator.tsx` around lines 1730 - 1744,
The useEffect hook in the Locator component updates the prevIsMobile.current ref
on line 1733 before checking the searchLoading guard condition. This causes the
mobile transition flag to be consumed even when the effect returns early due to
a pending search, so subsequent invocations lose track that a mobile switch
occurred. Move the assignment of prevIsMobile.current = isMobile to the end of
the effect (after all the early return checks but before the closing brace) so
that the ref only gets updated when the effect actually completes its mobile
transition logic, not when it exits early.
| The Static Map Section displays a non-interactive map image of a business's location. It uses the entity's address or coordinates to generate the map. | ||
|
|
||
| Available on Location templates. | ||
|
|
There was a problem hiding this comment.
Document the environment key dependency explicitly.
StaticMapSection still requires YEXT_MAPBOX_API_KEY (now from _env), so the current wording can imply no key setup is needed.
Suggested docs tweak
-The Static Map Section displays a non-interactive map image of a business's location. It uses the entity's address or coordinates to generate the map.
+The Static Map Section displays a non-interactive map image of a business's location. It uses the entity's address or coordinates to generate the map.
+It requires `YEXT_MAPBOX_API_KEY` in site advanced configuration.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| The Static Map Section displays a non-interactive map image of a business's location. It uses the entity's address or coordinates to generate the map. | |
| Available on Location templates. | |
| The Static Map Section displays a non-interactive map image of a business's location. It uses the entity's address or coordinates to generate the map. | |
| It requires `YEXT_MAPBOX_API_KEY` in site advanced configuration. | |
| Available on Location templates. | |
🤖 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/docs/components.md` around lines 806 - 809, The
documentation for StaticMapSection currently does not explicitly mention the
required YEXT_MAPBOX_API_KEY environment variable dependency, which could
mislead users into thinking no configuration is needed. Add clear documentation
stating that StaticMapSection requires the YEXT_MAPBOX_API_KEY environment
variable (sourced from _env) to function properly, and include any relevant
setup instructions or notes about this dependency.
| export const getCompatibleEntityFieldTypes = ( | ||
| entityFieldType: EntityFieldTypes | ||
| ): EntityFieldTypes[] => { | ||
| return [ | ||
| entityFieldType, | ||
| ...(ENTITY_FIELD_TYPE_COMPATIBILITY[entityFieldType] ?? []), | ||
| ]; | ||
| }; |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Keep compatibility expansion internal to avoid growing src/internal surface.
Line 168 exports a new helper from packages/visual-editor/src/internal, while Line 357 in packages/visual-editor/src/editor/yextEntityFieldUtils.ts can instead pass requiredTypes directly and let getFilteredEntityFields handle compatibility in one place.
Suggested simplification
diff --git a/packages/visual-editor/src/internal/utils/getFilteredEntityFields.ts b/packages/visual-editor/src/internal/utils/getFilteredEntityFields.ts
@@
-export const getCompatibleEntityFieldTypes = (
+const getCompatibleEntityFieldTypes = (
entityFieldType: EntityFieldTypes
): EntityFieldTypes[] => {
return [
entityFieldType,
...(ENTITY_FIELD_TYPE_COMPATIBILITY[entityFieldType] ?? []),
];
};diff --git a/packages/visual-editor/src/editor/yextEntityFieldUtils.ts b/packages/visual-editor/src/editor/yextEntityFieldUtils.ts
@@
import {
getFilteredEntityFields,
- getCompatibleEntityFieldTypes,
RenderEntityFieldFilter,
} from "../internal/utils/getFilteredEntityFields.ts";
@@
- types: requiredTypes.flatMap(getCompatibleEntityFieldTypes),
+ types: requiredTypes,As per coding guidelines, packages/visual-editor/src/internal/**/*.{ts,tsx}: “Do not publicly export modules from packages/visual-editor/src/internal; keep the public API surface small and intentional.”
🤖 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/internal/utils/getFilteredEntityFields.ts` around
lines 168 - 175, Remove the export statement from the
getCompatibleEntityFieldTypes function in getFilteredEntityFields.ts to keep it
internal and avoid expanding the src/internal public API surface. Instead of
exporting this helper, update the calling code in yextEntityFieldUtils.ts
(around line 357) to pass requiredTypes directly to getFilteredEntityFields and
let that function handle the entity field type compatibility expansion
internally in a single location rather than delegating it to a separate exported
utility function.
Source: Coding guidelines
| filter.types.forEach((type) => { | ||
| updatedFilteredEntitySubFields.push( | ||
| ...filteredEntitySubFields.filter((field) => { | ||
| return typeToFieldNames.get(type)?.includes(field.name); | ||
| }) | ||
| ...getCompatibleEntityFieldTypes(type).flatMap((compatibleType) => | ||
| filteredEntitySubFields.filter((field) => | ||
| typeToFieldNames.get(compatibleType)?.includes(field.name) | ||
| ) | ||
| ) | ||
| ); | ||
| }); | ||
| filteredEntitySubFields = updatedFilteredEntitySubFields; |
There was a problem hiding this comment.
Deduplicate expanded type matches before returning filtered fields.
At Line 247, types: ["type.string", "type.rich_text_v2"] can push the same string field more than once (direct + compatibility path). Deduping by field.name keeps output deterministic for direct callers.
Proposed fix
const updatedFilteredEntitySubFields: YextSchemaField[] = [];
filter.types.forEach((type) => {
updatedFilteredEntitySubFields.push(
...getCompatibleEntityFieldTypes(type).flatMap((compatibleType) =>
filteredEntitySubFields.filter((field) =>
typeToFieldNames.get(compatibleType)?.includes(field.name)
)
)
);
});
- filteredEntitySubFields = updatedFilteredEntitySubFields;
+ filteredEntitySubFields = Array.from(
+ new Map(
+ updatedFilteredEntitySubFields.map((field) => [field.name, field])
+ ).values()
+ );
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| filter.types.forEach((type) => { | |
| updatedFilteredEntitySubFields.push( | |
| ...filteredEntitySubFields.filter((field) => { | |
| return typeToFieldNames.get(type)?.includes(field.name); | |
| }) | |
| ...getCompatibleEntityFieldTypes(type).flatMap((compatibleType) => | |
| filteredEntitySubFields.filter((field) => | |
| typeToFieldNames.get(compatibleType)?.includes(field.name) | |
| ) | |
| ) | |
| ); | |
| }); | |
| filteredEntitySubFields = updatedFilteredEntitySubFields; | |
| filter.types.forEach((type) => { | |
| updatedFilteredEntitySubFields.push( | |
| ...getCompatibleEntityFieldTypes(type).flatMap((compatibleType) => | |
| filteredEntitySubFields.filter((field) => | |
| typeToFieldNames.get(compatibleType)?.includes(field.name) | |
| ) | |
| ) | |
| ); | |
| }); | |
| filteredEntitySubFields = Array.from( | |
| new Map( | |
| updatedFilteredEntitySubFields.map((field) => [field.name, field]) | |
| ).values() | |
| ); |
🤖 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/internal/utils/getFilteredEntityFields.ts` around
lines 247 - 256, The forEach loop iterating through filter.types can add the
same field multiple times to updatedFilteredEntitySubFields because a field may
match both directly and through compatibility paths. After the forEach loop
completes but before assigning updatedFilteredEntitySubFields back to
filteredEntitySubFields, deduplicate the array by field.name to ensure each
field appears only once. Use a filter or reduce approach that keeps the first
occurrence of each unique field name, maintaining deterministic output for
direct callers.
auto-screenshot-update: true
Merges the changes from the 1.3.3 release into the 2026-custom-components-templates branch
This includes these changes:
1.3.3 (2026-06-12)
New Features
Bug Fixes