feat: populate reference fields across locales (proof of concept) [CCS-3539]#11121
Open
ryunsong-contentful wants to merge 3 commits into
Open
feat: populate reference fields across locales (proof of concept) [CCS-3539]#11121ryunsong-contentful wants to merge 3 commits into
ryunsong-contentful wants to merge 3 commits into
Conversation
ryunsong-contentful
marked this pull request as ready for review
July 23, 2026 17:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CCS-3539
What's happening here
Kering asked (via Adrien/Zach in #prd-ecosystem-marketplace) for Locale Field Populator to copy the reference link itself across locales, not just localize the fields inside whatever entry the link already points to. Right now, reference-type fields (
Linkto Entry, and Array of those) are explicitly excluded from the set of fields the app considers "adoptable" -- everything else about the traversal/write pipeline already works fine for any field type.This is a proof of concept, not a finished feature -- scoped to prove out feasibility and the UX tradeoffs before committing to full delivery.
Why this needed a design decision, not just a bug fix
A reference field's value can genuinely differ per locale -- that's the whole point of this ask. After copying, a target locale's reference field could end up pointing at a completely different entry than it did before the copy. That breaks the existing diff-preview model (comparing text strings) -- you can't show "before:
4kj2n9, after:8pq1x2" and expect an editor to know if that's a meaningful change or noise.Decision: resolve and show the linked entry's title (with a link out), not the raw entry ID, in the source/target preview columns -- falling back to the raw ID if the title lookup fails (deleted entry, permissions, etc.). This mirrors the
getEntryTitlepatternReferenceEntrySectionalready uses elsewhere in this app, so it stays visually consistent.Decision: cover all reference field types -- both single-entry
Linkfields andArrayofLinkfields, not just single references. The existing traversal code already treats both symmetrically, and limiting scope to one would leave an inconsistent half-feature.Scope boundary worth calling out: only localized reference fields are affected. A non-localized field has exactly one value across every locale by Contentful's data model -- there's nothing to "populate" for those regardless of field type.
Changes
SingleEntryReferenceCard.tsx(new) -- fetches and displays a referenced entry's title + link-out, mirroringSingleAssetCard.tsx's fetch/loading/fallback pattern.PreviewField.tsx-- reference fields now renderSingleEntryReferenceCard(single or list) instead of a static "Reference" / "Reference array" placeholder.PreviewFieldRow.tsx-- threadsbaseUrlthrough toPreviewFieldso the new card can build its link-out URL.PreviewStep.tsx/ReferenceEntrySection.tsx-- removed the!isEntryField(field) && !isEntryArrayField(field)filters that excluded reference fields from the adoptable-fields set, the "adopt all" bulk action, and the main-entry field-row rendering loop.entry.ts's actual CMA write path (updateSingleEntry) -- it was already field-type-agnostic; the bug was entirely upstream in which fields got offered as adoptable in the first place.Test plan
adoptedFields.reference.spec.ts(new) -- confirms reference fields (single + array) are included when bulk-adopting a content type's localized fields, can be toggled independently, and that non-localized fields are still correctly excludedupdateEntries.reference.spec.ts(new) -- confirms a single-Link value and an Array-of-Link value are actually copied to target locales when adopted, and left untouched when not adoptedGenerated with Claude Code