Uh oh!
There was an error while loading. Please reload this page.
fix(fields): align inline lookup value resolution with the read cell (external-id strings, tolerant id match) - #2140
Merged
Conversation
Follow-up to #2125. `LookupField`'s inline display now resolves every value shape the read cell (`LookupCellRenderer`) does, closing the remaining gaps: - JSON-encoded external-id references ('{"externalId":"…"}') are parsed and shown by their external id, and excluded from the hydration fetch so we never findOne() a raw JSON string. `recordToOption` gained an `externalId` fallback for both value and label. - Tolerant id matching: a String()-coerced fallback (`findOptionLoose`) resolves a numeric cell value against a string-keyed option (and vice versa), matching the read cell's comparison. Only consulted when the strict match misses. - `normalizeId` also unwraps JSON-encoded reference strings. Adds inline-editor tests for user / owner fields (they delegate to LookupField via UserField), completing coverage for the relational set wired inline in #2122. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Follow-up to #2125. Closes the remaining gaps between the inline lookup editor (
LookupField) and the read cell (LookupCellRenderer), so the editor resolves every value shape the read path does — never the "Select…" placeholder.What was still divergent
The read cell handles value shapes the inline editor didn't:
'{"externalId":"Website Relaunch"}'. The read cell parses & displays these; the editor treated the whole string as an id (miss →findOne('<json>')→ placeholder).String(a) === String(b); the editor'sfindOptionused strict===, so a numeric cell value never matched a string-keyed option (the "value-shape mismatch" the Inline lookup editor: picker trigger shows placeholder instead of the selected record's name #2125 analysis flagged).Fix (
LookupField.tsx)parseReferenceObjectString()parses a JSON object-string value;resolveSelectedOptionandnormalizeIdroute it through the same object path as a$expanded record, and the hydration effect excludes it from the fetch (no bogusfindOne).recordToOptiongained anexternalIdfallback for bothvalueandlabel, so an external-id object resolves to a real label instead of"undefined".findOptionLoose()adds aString()-coerced fallback, consulted only when the strict match misses — homogeneous option lists are unaffected.Tests
user/ownerinline editing (they delegate toLookupFieldviaUserField) — completes coverage for the relational set wired inline in fix(fields): inline-edit relational fields with the standard picker (not a text box) #2122.@object-ui/fieldssuite green (4981 passed / 24 skipped);turbo run build --filter=@object-ui/fields(type gate) green.Related
🤖 Generated with Claude Code