Uh oh!
There was an error while loading. Please reload this page.
fix(fields): render reference/lookup cells as labels, not raw JSON - #1426
Merged
Conversation
A lookup/master_detail value can arrive as a JSON-encoded object string (an
unresolved external-id ref, e.g. '{"externalId":"Website Relaunch"}').
LookupCellRenderer treated the whole string as an opaque id, failed to resolve
it, and fell through to String(value) — leaking raw JSON into the cell.
- LookupCellRenderer parses a JSON-object-looking string and renders a label
(name > label > externalId > id).
- coerceToSafeValue (shared by 8 cell renderers) gains the same JSON-string
parsing; externalId added to the reference-label precedence.
- Unit tests for coerceToSafeValue; verified in browser on the showcase grid.
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
os-zhuang pushed a commit
that referenced
this pull request
Sep 2, 2026
A `code` value whose TEXT is JSON rendered as the literal `[Object]`. The
showcase Field Zoo record's Code Editor field (`f_code`) stores the string
`{\n "ok": true\n}` and the detail page showed `[Object]`.
`coerceToSafeValue` parsed any string starting `{`/`[` and ending `}`/`]`,
then ran the result through the reference-label extraction
(`name || label || externalId || id || _id || '[Object]'`). An object carrying
none of those keys answers the placeholder. Every text-like cell reaches this
helper — `text`, `textarea`, `code`, `time`, `auto_number` and `qrcode` all
register to `TextCellRenderer` — so all of them lost JSON-shaped text, and
`[1, 2, 3]` in a text field rendered as `1, 2, 3`.
Shape is not a type. A string is now returned verbatim. The reference case the
parse was written for (#1426, an unresolved external-id ref arriving as
`'{"externalId":"…"}'`) belongs to reference-TYPED columns and already lives
there: `LookupCellRenderer` carries its own JSON-string branch that resolves the
label through the referenced object's schema and links to the record — neither
of which the type-blind helper could do. Scoped, not dropped.
Object and array VALUES still coerce, so React error #310 stays fixed.
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.
Problem
A
lookup/master_detailvalue can arrive as a JSON-encoded object string — e.g. an unresolved external-id reference{"externalId":"Website Relaunch"}.LookupCellRenderertreated the whole string as an opaque id, failed to resolve it viauseLookupName, and fell through toString(value), leaking raw JSON into the grid cell.Fix
LookupCellRenderernow parses a JSON-object-looking string value and renders a human label (name→label→externalId→id).coerceToSafeValue(the shared safe-render helper used by 8 cell renderers) gains the same JSON-string parsing, andexternalIdis added to the reference-label precedence for object values and arrays.Verification
{"externalId":"…"}.coerce-safe-value.test.ts(5 cases); full@object-ui/fieldssuite green (3103 passed).Before / After
Before:
{"externalId":"Website Relaunch"}→ After:Website Relaunch🤖 Generated with Claude Code