This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(fields): an object literal is not a cell value — six renderer families invented an identity for it (objectui#8596) - #8679
Merged
Conversation
…ented an identity for it (objectui#8596)
Closes the `{}` column of the cell-renderer census the `[]` column
(objectui#8481 / objectui#8490 / objectui#8580) finished. Measured by
rendering all 53 registered field types through `getCellRenderer` against
`[]`, `{}`, `''` and `null` — 212 cells — before and after: 14 cells moved,
all in the `{}` column, and the other three columns are byte-identical.
- `email` / `url` / `phone` drew a LIVE anchor (`mailto:[Object]`,
`tel:[Object]`) plus a copy button; they now print the coerced text.
- `color` drew a swatch whose `background` was the string
`[object Object]` — a declaration the browser drops.
- the option families printed the literal `[Object Object]`, which is
`humanizeLabel(String({}))` and an option code nobody stored.
- `user` drew an avatar captioned `U` labelled `User` — a face and a name
for a record that has neither.
- `file` / `video` / `audio` drew a chip named `File` for an attachment
that does not exist.
The direction is the spec's, per family. `email` / `url` / `phone` / `color`
are `STRING_VALUE_TYPES`, the set whose `{}` ruling already landed for
`markdown` / `html` / `richtext`: the record IS storing something, so the
cell prints the family's existing coercion rather than the "No value"
affordance — and draws no affordance asserting more than that. The option
families resolve to a string code, so the same coercion answers them and the
badge stays. `user` shares `valueSchemaFor`'s reference arm with `lookup`,
which already answered an object it cannot name with the coerced text.
`file` / `video` / `audio` are where the answer differs and the spec names
the input: the media value schema makes `url` its one required member and
rejects "an empty object", so `{}` is a value of neither the stored nor the
expanded form — the record holds no file. `image` / `avatar`, the same spec
family, already answered `{}` that way.
Deliberately untouched: `boolean` / `toggle` (already ruled), the declared
json-literal fence, `DateCellRenderer`'s own dash, arrays, and any object
carrying a member — so a real attachment and a real reference are unmoved.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
os-justin
marked this pull request as ready for review
September 8, 2026 21:54
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
os-justin
enabled auto-merge
September 8, 2026 21:55
os-justin
deleted the
claude/issue-8596-object-literal-cell-renderers
branch
September 8, 2026 22:23
This was referenced Sep 8, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #8596
The census is the first deliverable, and it moved two rows
Re-run on my own pinned base
4eb665bcf, not inherited from the card: all 53 registered field types rendered throughgetCellRendereragainst[],{},''andnull— 212 cells — then re-rendered after the fix and diffed cell by cell. 14 cells moved, all in the{}column. The[],''andnullcolumns are byte-identical.Two rows the card flagged had indeed moved before I started:
boolean/toggleLANDED. objectui#8582 / PR fix(fields): only a real boolean is a value of a boolean cell — a non-boolean scalar drew a checked box #8594 is commit70c452369on this base, andpackages/fields/src/__tests__/booleanCell.nonBooleanScalar-8582.test.tsxis in the tree. Measured, not assumed:{}already drew the shared affordance. ⛔ Not re-ruled here; pinned unchanged.datetimealso already drew the affordance for{}(the card's table did not list it as broken, and it is not).location/geolocationwere left behind objectui#8481's declared json-literal fence, untouched and pinned unchanged.The measured
{}column, before → after{}before{}afteremail,url,phonemailto:[Object],[Object],tel:[Object]— plus a copy button[Object], byte-equal totextcolorColorSwatchCellRendererbackgroundwas the string[object Object][Object], byte-equal totextselect,status,multiselect,radio,checkboxes,tagsSelectCellRenderer[Object Object][Object]userUserCellRenderer[Object], byte-equal tolookupfile,video,audioFileCellRendererEmptyValuenumber,currency,percent,progress,slider,rating,text,textarea,code,qrcode,time,auto_number,formula,summary,lookup,master_detail,tree,markdown,html,richtext[Object]boolean,toggle,datetime,image,avatar,signature,address,repeaterlocation,geolocation,json,object,composite,record{}literalpassword,secret,vector,griddateDateCellRenderer⭐
dateis confirmed and deliberately not touched. My fix does not land on it, and the pin file records that row as a dash that is not the affordance, so a later change landing on it has to move a pin rather than pass silently.What
valueSchemaForactually says, per familyRead from
@objectstack/spec@17.3.0src/data/field-value.zod.tsbefore choosing anything — reported for every family, including where it confirms the obvious. (The thin-root-export trap was avoided by reading the package source directly; every set below was read at its declaration site, not imported and foundundefined.)valueSchemaFor's armemail,url,phone,colorSTRING_VALUE_TYPES→z.string()— "Value is a plain string"markdown/html/richtext.{}is settled away from the "no value" affordance and toward the family's existing coercion: the record IS storing something. So they printcoerceToSafeValue's answer, and draw no affordance asserting more than that.select,multiselect,radio,checkboxes,tagsSINGLE_OPTION_TYPES/MULTI_OPTION_TYPES→z.enum(codes), orz.string()where no options are declaredstatusstatusis not aFieldTypeSelectCellRendererthrough this repo's ownstandardMap. It inherits the ruling fromselectby that map, not from the spec. Reported rather than assumed.userREFERENCE_VALUE_TYPES→ReferenceIdValueSchemastored; expandedz.union([ReferenceIdValueSchema, z.record(z.string(), z.unknown())]){}parses green againstz.record— and the spec says the record's "shape is that object's contract, not this field's". So the spec cannot telluserfromlookuphere, andlookupalready answers an object it cannot name with the coerced text.userwas the outlier, not the object. Pinned byte-equal tolookup.file,video,audioFILE_REFERENCE_TYPES→FileReferenceIdValueSchemastored; expandedz.union([…, FileValueSchema])FileValueSchema's docstring:urlis "the one required member", and "a value with nourl— an empty object, a{ name }fragment, a number — is now rejected".{}is a value of neither form, so the record holds no file and "No value" is TRUE of it.image/avatar— same spec family — already answered{}that way.boolean,toggleBOOLEAN_VALUE_TYPES→z.boolean()location,geolocation,json,object,composite,recordLocationValueSchema/z.record/z.unknown()⛔ No renderer-side fallback was invented (AGENTS.md #0.1). Every family lands on a coercion this package already had (
coerceToSafeValue) or on the affordance a sibling in its own spec family already drew. The{}faces are pinned byte-equal totext, tolookupand toimagerespectively, so the rule stays true without being restated anywhere.Ablation — three legs, each proven on disk in both directions
Every leg mutates a read site from a committed tree, with
trap … EXIT INT TERMand absolute paths, and restores by state (git diff HEADempty), never by an exit code. Each leg gates on: non-emptygit hash-object, hash ≠ before, hash ≠ the HEAD blob, an anchor count that moved, and a line-total floor — the empty-file accident objectui#8490 lost a leg to, and the control objectui#8582 turned it into.Per-test classification is from vitest's JSON reporter (
--reporter=json --outputFile), never the text reporter. Harness-death signatures (Element type is invalid,Failed Suites,No test suite found in file,Tests no tests,Transform failed) were counted separately and were 0 in all three legs — no leg is void.LEG A — the unfixed tree (
packages/fields/src/index.tsxrestored to4eb665bcf)19 of 33 failed. Every DEFECT case failed on its artefact-absence sentence — asserted first on purpose, so the unfixed tree and a harness that has lost the affordance's
data-slotfail on textually different sentences:email: an object is not an address — an anchor here links nowhere: expected <a href="mailto:[Object]" …> to be nullphone: … expected <a href="tel:[Object]" …> to be nullurl: an object is not a URL — an anchor here navigates nowhere: expected <a href="[Object]" …> to be nullcolor: 'background: [object Object]' was a declaration the browser drops: expected '[object Object]' not to contain '[object Object]'select: [Object Object] was humanizeLabel(String({})) — an option code nobody stored(× 6 option types)user: "User" was a name invented for a record that has none: expected 'UUser' not to contain 'User'file/video/audio: "File" was a chip for an attachment that does not existuser must render as 'lookup' renders for {}: expected '<div class="flex items-center gap-2">…' to be '<span class="block max-w-full truncat…'The POPULATED and BOUNDARY blocks passed on the unfixed tree — correct, because they are the cases that must not move.
LEG B — the caricature: the mutation that makes the code answer the same thing for everything
getCellRendererreturns() => <EmptyValue />unconditionally.28 of 33 failed, and the two load-bearing families are exactly the ones that reddened:
THE CENSUS — all 53 registered types draw their measured face for {}→text holding {}: the measured face moved: expected '—' to be '[Object]'.POPULATED — a real value in all 53 registered types NEVER draws the "No value" affordance→text holding a real value: a populated cell must NOT draw the affordance: expected <span …> to be null, plus every per-family populated case (a real address still links: expected undefined to be 'mailto:ada@example.com',a declared option still shows its label: expected '—' to be 'Active',a real user still prints their name: expected '—' to be 'ALAda Lovelace',a real attachment still shows its name: expected '—' to be 'contract.pdf',a real colour still draws its swatch: expected null not to be null).date: still NOT the shared affordanceandlocation: the {} literal stays behind the declared fence— i.e. the caricature is caught erasing the two fences this card was told not to cross.file/video/audioDEFECT cases andTHE RULE — file/video/audio read as image doesPASS under the caricature. Their correct answer is the affordance, so the caricature satisfies them — the card's own point that the vivid assertion is rarely the discriminating one, measured rather than argued. Those four are discriminated by LEG A, where all four fail.LEG C — the emptiness control (the census guard itself)
assertCensusComplete(entries, 53, …), which throws before a single cell is rendered, and the file carries a meta-test that observes it throwing. To prove that is not decoration, both census tables were emptied on disk:The run went RED, not green-with-zero-cells:
Error: census: expected exactly 53 registered field types, got 0. A census over a short or empty set passes without measuring anything.Every assertion has been observed to fail
Across the three legs, 0 of the 33 tests were never red. An assertion never observed to fail has not been tested, and none is left in that state — including the meta-test, which LEG C reddens.
Tests run
pnpm exec vitest run packages/fields/pnpm exec vitest run packages/plugin-dashboard/ packages/plugin-report/ packages/plugin-list/ packages/plugin-tree/ packages/plugin-detail/pnpm exec vitest run packages/plugin-grid/ packages/plugin-kanban/ packages/plugin-form/pnpm --filter @object-ui/fields type-checkpnpm --filter '@object-ui/fields^...' build; on an unbuilt tree it reportsTS2307for every workspace import — a precondition, not a result)node scripts/check-control-bytes.mjsnode scripts/check-changeset-presence.mjsnode scripts/check-governed-queue-guard.mjs --test …Consumer packages were chosen by
git grepfor the changed renderers, not guessed:plugin-dashboard,plugin-detail,plugin-form,plugin-grid,plugin-kanban,plugin-list,plugin-report,plugin-tree. All ran from the repo root with paths, per AGENTS.md —pnpm --filter PKG exec vitest run FILEis refused by the objectui#3378 guard, and nothing was passed after a bare--.Boundaries this change deliberately does not cross
Each is pinned in
THE BOUNDARYblock, so crossing one later has to move a pin:['ada@example.com']still coerces and still links — the objectui#8490 email ruling, re-pinned. The predicate isisPlainObjectValue, which excludes arrays andDate.13800138000still dialstel:13800138000. Sweeping non-strings wholesale would have been a second ruling.{ name: 'contract.pdf' }still shows its name;{ id: 'u_1' }still draws its avatar. This isAddressCellRenderer's existing rule in the same file, quoted rather than re-invented: "an object carrying no recognized part reads as empty, while{ foo: 1 }keeps its JSON so real data is never hidden."date,boolean/toggle, and objectui#8481's json-literal fence — pinned unchanged.humanizeLabelstill runs for a stored code with no declared option (in_progress→In Progress); it is skipped only for a plain object, because it exists to turn a machine CODE into words and rewrites anything else.Out-of-scope findings, filed not swept
signatureis a specSTRING_VALUE_TYPESmember but renders throughImageCellRenderer, so{}draws "No value" where its own value class prints[Object]. It is the oneSTRING_VALUE_TYPESmember this PR leaves inconsistent, and the fix could belong in the spec rather than here — so it gets a ruling, not a guess.password/secret/vector/gridrender a value-independent face: the same bytes for[],{},'',nulland a populated value alike. An unset credential is drawn exactly like a set one.Dedup channel, declared: the GitHub search API is 403 on this seat ("sessions are bound to their configured repositories"), so no search was performed — and
search_issuesis measured to return false zeros on this repo anyway. Instead: a repo-scoped REST listing of open issues (3 pages × 100, sorted byupdated, 288 issues) grepped locally, with objectui#8596 itself as the control that had to hit, and did. That window is bounded, not exhaustive — no dedup claim is made beyond it.🤖 Generated with Claude Code
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Generated by Claude Code