…d of dropping it
`DataTableSchema.emptyAction` is declared `SchemaNode` on both published faces
(`packages/types/src/data-display.ts` and its Zod twin), and `SchemaNode` is
`BaseSchema | string | number | boolean | null | undefined`. The empty-state
render path additionally required `typeof … === 'object'`, so an authored
`emptyAction: 'Create the first record'` rendered nothing and reported nothing —
declared wider than enforced, failing in the direction that loses the author's
content without a diagnostic.
The declaration is unchanged; it was the correct side. objectui#7105 (director
seat, decision batch #69, 2026-09-07) settled the identical shape one slot over
on `EmptySchema.action` as relax the renderer, do not narrow the declaration,
and shipped it through the repo's permanent `toRenderableSchema` bridge. Nothing
had to be invented here either.
The truthiness leg is kept on purpose, and the `&&` chain became a ternary.
Together they make the slot behave exactly as handing the raw node to
`SchemaRenderer` would: `''` / `0` / `false` keep rendering nothing (pinned,
objectui#4548) because they never reach the bridge, whose `String` mapping would
otherwise turn the last two into the text "0" and "false". The ternary also
closes a measured leak — with `emptyAction: 0` the old chain evaluated to the
number `0` itself, which React renders as a stray "0" inside the empty state.
The slot still mounts through `SchemaRenderer` rather than resolving the
registry, so the single central `visibleWhen` gate still applies unchanged
(objectui#5926 gap 1); its pin is the regression control here and is green on
both sides.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Fixes #8331
DataTableSchema.emptyActionis declaredSchemaNodeon both published faces —packages/types/src/data-display.tsand its Zod twinpackages/types/src/zod/data-display.zod.ts— andSchemaNodeisBaseSchema | string | number | boolean | null | undefined. The empty-state render path additionally requiredtypeof … === 'object', so an authoredemptyAction: 'Create the first record'rendered nothing and reported nothing: declared wider than enforced, failing in the direction that loses the author's content without a diagnostic.The declaration is unchanged — it was the correct side. The object-only test was not protecting the renderer from anything it cannot handle: what
SchemaRendererdoes with a primitive has been pinned since objectui#4548 (a non-empty string renders as its own text;''/0/falserender nothing). The guard was discarding input the declaration promises to accept.objectui#7105 (director seat, decision batch #69, 2026-09-07, maintainer 「其他同意」) settled the identical shape one slot over on
EmptySchema.actionas relax the renderer, do not narrow the declaration, and shipped it through the repo's permanenttoRenderableSchemabridge. No coercion was invented here either.The change
One expression in
packages/components/src/renderers/complex/data-table.tsx:typeof … === 'object'clause is gone;toRenderableSchema, the documented-PERMANENT bridge inpackages/react/src/schema-input.ts;&&chain became a ternary.Both of those last two are load-bearing, and together they make the slot behave exactly as handing the raw node to
SchemaRendererwould — the docblock's own "one answer for malformed metadata, not a private one" rule, extended to the non-object members of the union.A second behaviour change ships with it, and it was measured, not assumed
With
emptyAction: 0the old&&chain evaluated to the number0itself, which React renders — so a stray"0"appeared inside the empty state. That is the numeric-falsy JSX trap rather than a decision. It was found because a "renders nothing for the falsy primitives" case that was expected to be green on both sides came back red on the unfixed guard:The ternary yields
nullinstead.Why the truthiness leg is kept rather than tidied into a nullish test
toRenderableSchemamapsnumber/booleanonto theirStringform. That is behaviour-preserving for the truthy ones — it is whatSchemaRenderer's own defensive branch produces — but not for0/false, whichSchemaRendererreturnsnullfor at an earlier leg. Measured on this branch:Gating on truthiness keeps those two away from the bridge, so they keep the platform's answer instead of arriving as the text
"0"and"false". This is pinned, so a later tidy of the leg fails.That measurement also falsifies the bridge docblock's own claim that it "changes no behaviour", which is why the shipped
emptyrenderer prints a stray"0"foraction: 0. That is not touched here — filed as #8908, unassigned.What did NOT change
The slot still mounts through
SchemaRendererrather than resolving the registry itself, so the single centralvisibleWhengate still applies to an authoredemptyActionexactly as before (objectui#5926 gap 1). Its pin is the regression control for this PR and is green on both sides.Verification
All readings quoted from the runner's own
VERDICT command-exitline, at final commitdbfebe786.Discriminating power — the polarity flip is the evidence:
data-table-empty-action-primitive-node.test.tsxVERDICT command-exit 1— 2 failed / 8 passedVERDICT command-exit 0data-table-empty-action-visible-when.test.tsx(regression control)SchemaRenderer.primitiveSchema.test.tsxVERDICT command-exit 0— 3 files, 17 passedPackage-level, after the fix:
pnpm --filter @object-ui/components run test→VERDICT command-exit 0— 253 files, 2322 tests passedpnpm --filter @object-ui/components run type-check→VERDICT command-exit 0(tsc --noEmitandtsc -p tsconfig.test.json, so the new test is typechecked too)pnpm --filter '@object-ui/components^...' run build(dependency closure) →VERDICT command-exit 0node scripts/check-control-bytes.mjs→ exit 0 ·node scripts/check-changeset-no-major.mjs→ exit 0eslinton both changed files → exit 0, 0 errors; the 34 warnings are pre-existing and none land on an added lineEvery heavy run went through the container's shared verify lock. The full farm is CI's.
Changeset
minor, notpatch. It is a behaviour change on a published surface — a node that renders nothing today starts rendering — and per AGENTS.md §版本号策略 this repo's fixed 39-package group never declaresmajor(mechanically enforced byscripts/check-changeset-no-major.mjs), sominoris where a breaking-or-behavioural change lands here.Contract review
Clause-②: yes, declared by the dispatching seat on the card's claim comment with the #7105 precedent quoted verbatim.needs:contract-reviewis carried on both the card and this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Generated by Claude Code