This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(fields): a rich-content cell holding [] or {} says what it holds (objectui#8580) - #8595
Merged
os-justin merged 4 commits intoSep 8, 2026
Merged
Conversation
…(objectui#8580)
`MarkdownCellRenderer` and `HtmlCellRenderer` tested the raw value and then
`String()`'d it, so `[]` drew a childless `prose` container (markdown's
Suspense fallback a childless span) and `{}` drew the literal
`[object Object]`. Both renderers now test the coerced text, as
`TextCellRenderer` does: `[]` is the shared EmptyValue affordance, and an
object takes the string class's existing answer (`coerceToSafeValue` — its
display name, or `[Object]`), which is then formatted. A populated string
reaches each pipeline verbatim, so the HTML sanitiser sees the same bytes.
`coerceToSafeValue` moves into its own module so the display module the
barrel imports can share it without importing the barrel back; the barrel
re-exports it unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
…html and richtext (objectui#8580) Run against the EmptyValue-unconditionally caricature, the same-bytes case passed its comparison — both sides were `undefined` — and only failed on its second sentence. The comparison now asserts the html side rendered the specimen first. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
…ads as the pin's own sentence (objectui#8580) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
…kdown-html-childless-container
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
marked this pull request as ready for review
September 8, 2026 14:25
os-justin
enabled auto-merge
September 8, 2026 14:25
This was referenced Sep 8, 2026
os-justin
deleted the
claude/issue-8580-markdown-html-childless-container
branch
September 8, 2026 14:54
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 #8580
What
MarkdownCellRendererandHtmlCellRenderer(markdown,html,richtext) tested the raw value and thenString()'d it. Measured by rendering every registered field type against[],{},''andnullthroughgetCellRendereron7102b20d9(DOM shapes written in words — tag-shaped fragments are eaten from GitHub bodies even inside backticks):[]{}markdownMarkdownCellRendererproseonce settled; a childless SPAN classedtext-sm text-muted-foregroundwhile the lazy pipeline loads[object Object]html,richtextHtmlCellRendererprose[object Object]Both renderers now test the coerced text, as
TextCellRendererdoes (richTextSourceinrichTextDisplay.tsx).coerceToSafeValuemoves into its own module (packages/fields/src/coerceToSafeValue.ts, docblock moved verbatim) so the display module the barrel imports can share it without importing the barrel back — the cycle objectui#5498 extracted that module to avoid. The barrel re-exports it unchanged (dist/index.d.tscarries the re-export after build; signature identical).Two defects, two rulings — decided separately
@objectstack/specsettles what these fields may hold:STRING_VALUE_TYPESinpackages/spec/src/data/field-value.zod.tslistsmarkdown,html,richtextunder "Value is a plain string", in the same class astext/textarea/code, and the write seam for that class isz.string()(line 496). Neither[]nor{}is a value of the class.[]→ the sharedEmptyValue. It holds no string and nothing to format; "No value" is true of it; this matches the twelve siblings the first two parts moved.{}→ NOT the affordance, and NOT[object Object]. The record is storing something, so "No value" would be false.[object Object]isString()'s artefact and no sibling prints it. The string class already has one answer for an object —coerceToSafeValue: the display name when the object carries one,[Object]otherwise — so the three rich types now take that answer and format it, and the pin holds{}on each of them byte-equal to whattextprints for{}. This is the class's existing convention applied to three members that had a private one, not a new renderer-side fallback (AGENTS.md #0.1): off-contract data stays visible, is not masked as "No value", and is not rendered as a coercion artefact.Consequences declared: a one-entry array formats its one entry (the objectui#8490 email ruling, pinned); a
Datenow renders its ISO string rather thanDate.prototype.toString's locale text (the text-class answer); a whitespace-only string stays a string value (pinned as a boundary — trimming it into the affordance would be a second ruling, andTextCellRendererdoes not trim either).The childless containers carried no affordance
Checked, as the card asked.
prose(tailwind typographyDEFAULT) setscolor,max-widthand font metrics — no padding, no border — and neither renderer binds a handler, so the container was inert: the objectui#8481 shape (nothing drawn where a placeholder belongs, no accessible name), not the live-anchor shape PR #8586 removed. The census instrument counteda,button,role=checkbox,role=progressbarandtabindexper cell: 0 for all three types at every value.Sanitisation: the populated branch did not move
richTextSourcereturns a string verbatim (coerceToSafeValuestarts with the string identity branch), so the bytes reachingsanitizeHtmlfor a stored HTML value are the bytes that always did. Pinned on content, not on a count:htmlandrichtextholding the hostile document (a script block, an inlineonerror, ajavascript:href) must render exactly the sanitiser's output string (a P reading ok, an IMG with src x, an A whose href is#, and nothing else) — and that pin passes on the UNFIXED tree too, so it pins the pre-existing path rather than a new one.markdownstill drops raw HTML (the objectui#5452 pins are unchanged and green).Evidence — three legs, each mutation proven on disk in both directions with a line-total gate, restored by state
Runner:
leg.sh(scratchpad) —trap restore EXIT INT TERM, absolute paths; restore isgit checkout HEAD -- PATH, proven bygit diff HEADempty ANDgit hash-object PATHequal togit rev-parse HEAD:PATH(an empty hash is a failure); mutation gate = inserted-marker count, deleted-marker count, mutated hash differing from HEAD, andwc -lequal to the expected total. Harness-death signatures (Cannot read properties of null,Unable to find,TypeError,is not a function) were counted separately in every leg: 0 each time, so every red count below is assertions failing.richTextDisplay.tsxreplaced bygit show BASE:path— 212 → 162 lines,richTextSource×0,String(value)×3[] must not render a childless container (the objectui#8481 shape)×3;[object Object] is String()'s artefact, not a rendering×3;must print what text prints for {};an object with a name prints its name;markdown holding ['']: the shared EmptyValue affordance must be present. The POPULATED block passes in full.EmptyValueunconditionallyconst text = richTextSource(value)→undefined as string or undefined×2, 212 → 212 linesa populated value must still open its prose container×3,a document must still open its prose container,the seed specimen must still render its bytes,a one-entry array formats its entry; every{}case:{} is not "No value" — the record is storing something×3,must print what text prints for {},an object with a name prints its name; boundaries:whitespace is a string value, not "No value",a stored 0 still prints. The 5 survivors are the affordance-present cases ([]×3,''/null,['']) — the caricature's own scope, declared.data-slot="empty-value"→empty-value-killedinpackages/components/src/custom/empty.tsx, a file this PR does not touchthe shared EmptyValue affordance must be present×5 — textually distinct from the unfixed leg, and the defect-absence sentence passed first in every[]case, proving the assertion order.One assertion was caught passing on the caricature — the html/richtext same-bytes comparison compared
undefinedwithundefinedand only failed on its second sentence — and was strengthened (ad1b363c0, spelled as a boolean ine7284acc6); re-run against the caricature it fails on its own sentence.Census
53 registered types (50 literal
standardMapkeys + 3 spread fromRICH_TEXT_CELL_RENDERERS) × 4 values = 212 cells, rendered throughgetCellRendererwith a 30 ms settle, sync and settled snapshots both recorded. Base7102b20d9→ this branch before the merge: 6 moved, exactly the card's six. Base → merged HEADe122a5e95(afterorigin/maintook PR #8586): 25 moved = #8586's 19 + these 6, nothing else. On the merged tree the only[]rows whose output still differs fromnullare the objectui#8481 fence —json,object,composite,record,location,geolocation,addressprint the[]literal;file,video,audiosay0 files. No fourth part of this class remains. The{}column is a different census and is handed to the PM in the report.Verification on merged HEAD
e122a5e95pnpm exec vitest run packages/fields/plus the 12 consumer test files that render these three types (plugin-grid ×3, plugin-detail ×2, plugin-form, plugin-list ×3, app-shell ×2, console) —Test Files 153 passed (153),Tests 2556 passed (2556),VERDICT command-exit 0, held 3m41s.pnpm --workspace-concurrency=2 --filter '@object-ui/fields^...' build(closure, exit 0), thenpnpm --filter @object-ui/fields build && pnpm --filter @object-ui/fields type-check— both programs (tsc --noEmit && tsc -p tsconfig.test.json),VERDICT command-exit 0; type-check re-run on the merged tree, exit 0.pnpm --filter @object-ui/fields lint— 0 errors. The threereact-refresh/only-export-componentswarnings onrichTextDisplay.tsxpre-exist on BASE for the same three non-component exports; the twono-explicit-anywarnings in the new pin are the sameas anycast the objectui#8481 pin uses.check:esm-specifiers,check:unreferenced-sources,check:self-import,check:side-effects-array,check:phantom-deps,check:pre-install-import-graph,check:type-check-coverage,check:vi-mock-specifiers,check:vi-mock-inherit,check:control-bytes,check-changeset-presence,check-changeset-no-major,check-changeset-fixed,check-changeset-overwrite;check-governed-queue-guard --teston all 21 changed paths: NOT GOVERNED.check:readme-exports(needs every package built — "27 unbuilt"),check:eager-closure(needs a consolevite build).turbo ls --affectedlists 20 packages; run locally =fieldsin full + the 12 consumer files above, found bygit grepfor the three type spellings across the other packages' tests. The barrel's exported surface is unchanged, so the remaining consumers' suites exercise unchanged code; they are CI's.Merge with
origin/mainPR #8586 landed while this was in flight (
21529629c); merged withgit merge origin/main(e122a5e95), no conflict — itsisBlankCellTextsits directly under the re-export block. objectui#8582 is not addressed here: its boolean renderer was reached by the census and reported, not edited.Attribution: written in session
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16Sby the ObjectUI dev agent dispatched by thedomain:uiPM seat.🤖 Generated with Claude Code
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Generated by Claude Code