feat: set defaultValue data for constantValues#1077
Conversation
|
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. |
commit: |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR standardizes default translatable data shapes by replacing per-locale objects (e.g., { en: "...", hasLocalizedValue: "true" }) with { defaultValue: "..." } across many components and defaultProps. It adds localized-asset helpers ( Sequence Diagram(s)sequenceDiagram
participant Component as Visual Component
participant i18n as i18n (locale)
participant Resolver as resolveComponentData / resolveYextEntityField
participant ImageUtil as types/images.ts
Component->>i18n: request current locale
i18n-->>Component: locale (e.g., "fr")
Component->>Resolver: resolve translatable field (value, locale)
Resolver->>Resolver: inspect value shape (string | localized object | defaultValue)
alt value is localized asset image
Resolver->>ImageUtil: isLocalizedAssetImage(value)?
ImageUtil-->>Resolver: true
Resolver->>ImageUtil: resolveLocalizedAssetImage(value, locale)
ImageUtil-->>Resolver: AssetImage (locale or defaultValue)
else value is translatable string/rich text
Resolver-->>Resolver: localized = value[locale] ?? value.defaultValue
end
Resolver-->>Component: resolved display value (string / RTF / AssetImage)
Component->>Component: render using resolved value
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ 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: 5
🧹 Nitpick comments (3)
packages/visual-editor/src/utils/plainText.test.ts (1)
145-168: Add a regression test for explicit empty locale values.Given the fallback rules, an explicit locale value of
""should win overdefaultValue; adding this test will lock in that behavior.✅ Suggested test case
describe("getLocalizedPlainText", () => { @@ it("falls back to rich text defaultValue when locale is missing", () => { @@ expect(getLocalizedPlainText(value, "de")).toBe("Hello there"); }); + + it("prefers explicit empty locale value over defaultValue", () => { + const value: TranslatableString = { + hasLocalizedValue: "true", + fr: "", + defaultValue: "Hello", + }; + + expect(getLocalizedPlainText(value, "fr")).toBe(""); + }); });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/visual-editor/src/utils/plainText.test.ts` around lines 145 - 168, Add regression tests to ensure an explicit empty locale value wins over defaultValue: in packages/visual-editor/src/utils/plainText.test.ts add a test for getLocalizedPlainText where a TranslatableString has the requested locale present but set to "" (e.g., { defaultValue: "Hello", de: "" }) and assert it returns "" not "Hello"; also add a similar test for TranslatableRichText where the requested locale's rich text is present but empty (e.g., { defaultValue: { html: "<p>Hello</p>" }, de: { html: "" } }) and assert getLocalizedPlainText returns an empty string; reference getLocalizedPlainText to locate where to add these cases.packages/visual-editor/src/utils/resolveYextEntityField.test.ts (1)
219-261: Add a regression case for “locale value equals defaultValue”.Nice coverage additions. One missing edge case: when
frexists and has the same string asdefaultValue, locale should still be the field that gets resolved.✅ Suggested test case
+ it("resolves locale value even when it matches defaultValue text", () => { + assert.deepEqual( + resolveYextEntityField( + document, + { + field: "", + constantValue: { + fr: "Welcome to [[name]]!", + defaultValue: "Welcome to [[name]]!", + }, + constantValueEnabled: true, + }, + "fr" + ), + { + fr: "Welcome to Yext!", + defaultValue: "Welcome to [[name]]!", + } + ); + });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/visual-editor/src/utils/resolveYextEntityField.test.ts` around lines 219 - 261, Add a regression test to resolveYextEntityField.test.ts that covers the edge case where the locale (e.g., "fr") has a value identical to the defaultValue string: call resolveYextEntityField with a constantValue.defaultValue containing placeholders (like "Welcome to [[name]]!") and a document that defines the locale field "fr" with the identical string, then assert that the function resolves using the locale value (i.e., performs placeholder substitution from the entity, not treating it as a fallback) — this ensures resolveYextEntityField correctly prefers the locale-specific value even when it equals defaultValue.packages/visual-editor/src/components/header/PrimaryHeaderSlot.tsx (1)
431-432: Minor: Inconsistent capitalization with HeroSection.The CTA labels here use "Call to Action" (lowercase 't') while
HeroSection.tsxuses "Call To Action" (uppercase 'T'). If this is intentional for different contexts, consider adding a comment; otherwise, consider aligning the capitalization for consistency across components.Also applies to: 458-459
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/visual-editor/src/components/header/PrimaryHeaderSlot.tsx` around lines 431 - 432, Inconsistent CTA label capitalization between PrimaryHeaderSlot (label defaultValue at the entries near the shown diff and the similar entries around lines 458-459) and HeroSection.tsx; update the label defaultValue(s) in PrimaryHeaderSlot to match HeroSection.tsx's "Call To Action" (or vice versa) so both components use identical capitalization, and if the difference is intentional add a brief inline comment next to the label definitions explaining the reason.
🤖 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/docs/ai/components.d.ts`:
- Around line 1124-1127: The LocalizedAssetImage type lacks locale index
signatures expected by resolveLocalizedAssetImage and inconsistent with
LocalizedValues; update the LocalizedAssetImage type to include a locale index
signature (e.g., [locale: string]: AssetImageType | undefined) while keeping
hasLocalizedValue?: "true" and defaultValue?: AssetImageType so runtime locale
overrides are supported and typings match resolveLocalizedAssetImage and
LocalizedValues.
In
`@packages/visual-editor/src/internal/puck/constant-value-fields/EnhancedCallToAction.tsx`:
- Around line 83-92: The branch in EnhancedCallToAction.tsx is destructively
clearing updatedValue.label whenever newValue === "presetImage", which wipes
user-entered CTA text and then gets preserved as an empty label when switching
back; instead, modify the logic around the updatedValue and label handling so
that when newValue === "presetImage" you do not overwrite an existing
updatedValue.label (only set a label default if none exists), and ensure the
other branches (getDirections, textAndLink) continue to only set a label if
updatedValue.label is falsy—locate and update the conditional that checks
newValue and touches updatedValue.label to preserve existing label content.
In `@packages/visual-editor/src/internal/puck/constant-value-fields/TextList.tsx`:
- Around line 149-152: When creating a new translatable item in TextList (the
newItems array built from localItems in TextList.tsx), include the new fallback
field by adding a defaultValue property on the newly created entry (alongside
[locale] and hasLocalizedValue). Update the object literal used to construct the
new item (the element pushed into newItems) to include defaultValue with the
appropriate initial value so newly added entries won't miss the fallback field.
In `@packages/visual-editor/src/utils/resolveYextEntityField.ts`:
- Around line 115-126: The fallback detection is wrong because comparing
data.defaultValue === localizedValue can't determine whether localizedValue came
from data[locale] or data.defaultValue; update resolveYextEntityField to detect
the source by checking property existence (e.g., use
Object.prototype.hasOwnProperty.call(data, locale) or similar) before deciding
to replace data.defaultValue or data[locale]; apply the same pattern to the
other TranslatableString handling blocks referenced (around the checks at lines
~140-149 and ~160-163) and continue using
resolveEmbeddedFieldsInString(streamDocument, locale) result to set the correct
property (locale key vs defaultValue).
---
Nitpick comments:
In `@packages/visual-editor/src/components/header/PrimaryHeaderSlot.tsx`:
- Around line 431-432: Inconsistent CTA label capitalization between
PrimaryHeaderSlot (label defaultValue at the entries near the shown diff and the
similar entries around lines 458-459) and HeroSection.tsx; update the label
defaultValue(s) in PrimaryHeaderSlot to match HeroSection.tsx's "Call To Action"
(or vice versa) so both components use identical capitalization, and if the
difference is intentional add a brief inline comment next to the label
definitions explaining the reason.
In `@packages/visual-editor/src/utils/plainText.test.ts`:
- Around line 145-168: Add regression tests to ensure an explicit empty locale
value wins over defaultValue: in
packages/visual-editor/src/utils/plainText.test.ts add a test for
getLocalizedPlainText where a TranslatableString has the requested locale
present but set to "" (e.g., { defaultValue: "Hello", de: "" }) and assert it
returns "" not "Hello"; also add a similar test for TranslatableRichText where
the requested locale's rich text is present but empty (e.g., { defaultValue: {
html: "<p>Hello</p>" }, de: { html: "" } }) and assert getLocalizedPlainText
returns an empty string; reference getLocalizedPlainText to locate where to add
these cases.
In `@packages/visual-editor/src/utils/resolveYextEntityField.test.ts`:
- Around line 219-261: Add a regression test to resolveYextEntityField.test.ts
that covers the edge case where the locale (e.g., "fr") has a value identical to
the defaultValue string: call resolveYextEntityField with a
constantValue.defaultValue containing placeholders (like "Welcome to [[name]]!")
and a document that defines the locale field "fr" with the identical string,
then assert that the function resolves using the locale value (i.e., performs
placeholder substitution from the entity, not treating it as a fallback) — this
ensures resolveYextEntityField correctly prefers the locale-specific value even
when it equals defaultValue.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c9e16b5b-ab89-4371-a6b7-853422f36285
⛔ Files ignored due to path filters (16)
packages/visual-editor/src/components/testing/screenshots/Locator/[desktop] version 64 static image.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 53 carousel variant with carouselImageCount 1.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 53 carousel variant with carouselImageCount 2.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 53 carousel variant with carouselImageCount 3.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 53 gallery variant with 1 image.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 53 gallery variant with mixed locale images.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[mobile] version 53 carousel variant with carouselImageCount 1.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[mobile] version 53 carousel variant with carouselImageCount 2.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[mobile] version 53 carousel variant with carouselImageCount 3.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[mobile] version 53 gallery variant with 1 image.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[mobile] version 53 gallery variant with mixed locale images.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[tablet] version 53 carousel variant with carouselImageCount 1.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[tablet] version 53 carousel variant with carouselImageCount 2.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[tablet] version 53 carousel variant with carouselImageCount 3.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[tablet] version 53 gallery variant with 1 image.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[tablet] version 53 gallery variant with mixed locale images.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**
📒 Files selected for processing (63)
packages/visual-editor/src/components/Locator.tsxpackages/visual-editor/src/components/atoms/image.tsxpackages/visual-editor/src/components/contentBlocks/BodyText.tsxpackages/visual-editor/src/components/contentBlocks/CtaWrapper.tsxpackages/visual-editor/src/components/contentBlocks/HeadingText.tsxpackages/visual-editor/src/components/contentBlocks/MapboxStaticMap.tsxpackages/visual-editor/src/components/contentBlocks/Phone.tsxpackages/visual-editor/src/components/contentBlocks/Text.tsxpackages/visual-editor/src/components/contentBlocks/image/HeroImage.tsxpackages/visual-editor/src/components/contentBlocks/image/Image.tsxpackages/visual-editor/src/components/directory/Directory.tsxpackages/visual-editor/src/components/footer/CopyrightMessageSlot.tsxpackages/visual-editor/src/components/footer/ExpandedFooter.tsxpackages/visual-editor/src/components/footer/FooterExpandedLinkSectionSlot.tsxpackages/visual-editor/src/components/footer/FooterExpandedLinksWrapper.tsxpackages/visual-editor/src/components/footer/FooterLogoSlot.tsxpackages/visual-editor/src/components/footer/SecondaryFooterSlot.tsxpackages/visual-editor/src/components/header/HeaderLinks.tsxpackages/visual-editor/src/components/header/PrimaryHeaderSlot.tsxpackages/visual-editor/src/components/pageSections/AboutSection/AboutSection.tsxpackages/visual-editor/src/components/pageSections/AboutSection/AboutSectionDetailsColumn.tsxpackages/visual-editor/src/components/pageSections/Banner.tsxpackages/visual-editor/src/components/pageSections/Breadcrumbs.tsxpackages/visual-editor/src/components/pageSections/CoreInfoSection.tsxpackages/visual-editor/src/components/pageSections/EventSection/EventCard.tsxpackages/visual-editor/src/components/pageSections/EventSection/EventSection.tsxpackages/visual-editor/src/components/pageSections/FAQsSection/FAQCard.tsxpackages/visual-editor/src/components/pageSections/FAQsSection/FAQsSection.tsxpackages/visual-editor/src/components/pageSections/HeroSection.tsxpackages/visual-editor/src/components/pageSections/InsightSection/InsightCard.tsxpackages/visual-editor/src/components/pageSections/InsightSection/InsightSection.tsxpackages/visual-editor/src/components/pageSections/NearbyLocations/NearbyLocations.tsxpackages/visual-editor/src/components/pageSections/PhotoGallerySection/PhotoGallerySection.tsxpackages/visual-editor/src/components/pageSections/PhotoGallerySection/PhotoGalleryWrapper.tsxpackages/visual-editor/src/components/pageSections/ProductSection/ProductCard.tsxpackages/visual-editor/src/components/pageSections/ProductSection/ProductSection.tsxpackages/visual-editor/src/components/pageSections/ProfessionalHeroSection.tsxpackages/visual-editor/src/components/pageSections/PromoSection/ImmersivePromo.tsxpackages/visual-editor/src/components/pageSections/PromoSection/PromoSection.tsxpackages/visual-editor/src/components/pageSections/PromoSection/SpotlightPromo.tsxpackages/visual-editor/src/components/pageSections/TeamSection/TeamCard.tsxpackages/visual-editor/src/components/pageSections/TeamSection/TeamSection.tsxpackages/visual-editor/src/components/pageSections/TestimonialSection/TestimonialCard.tsxpackages/visual-editor/src/components/pageSections/TestimonialSection/TestimonialSection.tsxpackages/visual-editor/src/components/pageSections/VideoSection.tsxpackages/visual-editor/src/components/pageSections/heroVariants/ImmersiveHero.tsxpackages/visual-editor/src/components/pageSections/heroVariants/SpotlightHero.tsxpackages/visual-editor/src/docs/ai/components.d.tspackages/visual-editor/src/editor/YextEntityFieldSelector.tsxpackages/visual-editor/src/internal/puck/components/meta-title/metaTitleValidation.test.tspackages/visual-editor/src/internal/puck/components/meta-title/metaTitleValidation.tspackages/visual-editor/src/internal/puck/constant-value-fields/EnhancedCallToAction.tsxpackages/visual-editor/src/internal/puck/constant-value-fields/Image.tsxpackages/visual-editor/src/internal/puck/constant-value-fields/TextList.tsxpackages/visual-editor/src/types/images.tspackages/visual-editor/src/types/types.tspackages/visual-editor/src/utils/plainText.test.tspackages/visual-editor/src/utils/plainText.tspackages/visual-editor/src/utils/resolveComponentData.test.tsxpackages/visual-editor/src/utils/resolveComponentData.tsxpackages/visual-editor/src/utils/resolveYextEntityField.test.tspackages/visual-editor/src/utils/resolveYextEntityField.tspackages/visual-editor/src/vite-plugin/defaultLayoutData.ts
packages/visual-editor/src/components/footer/FooterExpandedLinksWrapper.tsx
Show resolved
Hide resolved
packages/visual-editor/src/internal/puck/constant-value-fields/EnhancedCallToAction.tsx
Show resolved
Hide resolved
packages/visual-editor/src/internal/puck/constant-value-fields/TextList.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
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/types/images.ts`:
- Around line 73-82: The type guard isLocalizedAssetImage currently rejects
locale-only objects because it requires "hasLocalizedValue" or "defaultValue";
update it to treat any non-null object without a top-level "url" as a
LocalizedAssetImage if it either has "hasLocalizedValue"/"defaultValue" OR
contains any key whose value is an object with a string "url" (i.e., detect
locale keys by scanning Object.keys(value) and checking for value[key]?.url as a
string). Apply the same change to the other guard referenced around lines 92-96
so locale-only shapes like { fr: { url: "..." } } are accepted and won't resolve
to undefined.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0647a2a1-a47b-4c0f-852f-3cbc1fe97cb7
📒 Files selected for processing (5)
packages/visual-editor/src/components/footer/FooterExpandedLinksWrapper.tsxpackages/visual-editor/src/types/images.tspackages/visual-editor/src/utils/plainText.test.tspackages/visual-editor/src/utils/resolveYextEntityField.test.tspackages/visual-editor/src/utils/resolveYextEntityField.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/visual-editor/src/utils/resolveYextEntityField.test.ts
- packages/visual-editor/src/components/footer/FooterExpandedLinksWrapper.tsx
- packages/visual-editor/src/utils/plainText.test.ts
There was a problem hiding this comment.
♻️ Duplicate comments (2)
packages/visual-editor/src/types/images.ts (1)
74-82:⚠️ Potential issue | 🟠 MajorGuard rejects valid locale-only localized images.
At Line 81, requiring
hasLocalizedValueordefaultValuemeans{ fr: { url: "..." } }is not recognized as localized. Downstream,resolveLocalizedAssetImagethen returnsundefinedinstead of the locale image.💡 Proposed fix
export const isLocalizedAssetImage = ( value: unknown ): value is LocalizedAssetImage => { - return ( - !!value && - typeof value === "object" && - !("url" in value) && - ("hasLocalizedValue" in value || "defaultValue" in value) - ); + if (!value || typeof value !== "object" || "url" in value) { + return false; + } + + const record = value as Record<string, unknown>; + if ("hasLocalizedValue" in record || "defaultValue" in record) { + return true; + } + + return Object.entries(record).some( + ([key, entry]) => + key !== "hasLocalizedValue" && + key !== "defaultValue" && + !!entry && + typeof entry === "object" && + "url" in (entry as Record<string, unknown>) + ); };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/visual-editor/src/types/images.ts` around lines 74 - 82, The type guard is too strict: update isLocalizedAssetImage to recognize locale-keyed objects like { fr: { url: "..." } } by removing the requirement for "hasLocalizedValue" or "defaultValue"; instead, simply ensure value is a non-null object (not an array) and does NOT have a top-level "url" property (so functions like resolveLocalizedAssetImage will accept locale-only shapes). Modify the isLocalizedAssetImage implementation accordingly (referencing the isLocalizedAssetImage function and ensuring compatibility with resolveLocalizedAssetImage).packages/visual-editor/src/docs/ai/components.d.ts (1)
1124-1129:⚠️ Potential issue | 🟠 Major
LocalizedAssetImagestill rejectshasLocalizedValue: "true"under the index signature.Line 1128’s index signature excludes
"true", so Line 1125 becomes incompatible in TypeScript when that property is present.Proposed fix
type LocalizedAssetImage = { hasLocalizedValue?: "true"; defaultValue?: AssetImageType; } & { - [locale: string]: AssetImageType | undefined; + [locale: string]: AssetImageType | "true" | undefined; };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/visual-editor/src/docs/ai/components.d.ts` around lines 1124 - 1129, The index signature in LocalizedAssetImage ([locale: string]: AssetImageType | undefined) conflicts with the explicit property hasLocalizedValue?: "true" because string keys include "hasLocalizedValue"; update the index signature to allow the "true" literal as a possible value (e.g. [locale: string]: AssetImageType | "true" | undefined) so hasLocalizedValue?: "true" is compatible without changing property names or shapes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/visual-editor/src/docs/ai/components.d.ts`:
- Around line 1124-1129: The index signature in LocalizedAssetImage ([locale:
string]: AssetImageType | undefined) conflicts with the explicit property
hasLocalizedValue?: "true" because string keys include "hasLocalizedValue";
update the index signature to allow the "true" literal as a possible value (e.g.
[locale: string]: AssetImageType | "true" | undefined) so hasLocalizedValue?:
"true" is compatible without changing property names or shapes.
In `@packages/visual-editor/src/types/images.ts`:
- Around line 74-82: The type guard is too strict: update isLocalizedAssetImage
to recognize locale-keyed objects like { fr: { url: "..." } } by removing the
requirement for "hasLocalizedValue" or "defaultValue"; instead, simply ensure
value is a non-null object (not an array) and does NOT have a top-level "url"
property (so functions like resolveLocalizedAssetImage will accept locale-only
shapes). Modify the isLocalizedAssetImage implementation accordingly
(referencing the isLocalizedAssetImage function and ensuring compatibility with
resolveLocalizedAssetImage).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2b8fe3c0-13bf-4aa3-a75b-c05af6e02323
📒 Files selected for processing (2)
packages/visual-editor/src/docs/ai/components.d.tspackages/visual-editor/src/types/images.ts
Adds new
defaultValueon constantValue objects. No migrations, so only newly dragged on components or new layouts will have adefaultValuethat is a fallback if no locale specific value. However if something is like:for a french page, it'll use "", not the defaultValue.
Confirmed with aaron we don't want the fallback to just be the "en" value as if a user changes in their en pageset, the default for the non-en pages shouldn't change.
live editor: https://www.yext.com/s/4412098/yextsites/162218/pagesets
Now you start without the locale warnings too! So maybe they'll be more helpful rather than constant (the red box on the locale picker)