This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
feat(types,components): declare EmptySchema.action as SchemaNode and enforce it - #8330
Merged
Merged
Conversation
…enforce it `empty` rendered an `action` node and the docs page documented it while the TypeScript face, the zod mirror and the designer `registrationMeta.inputs` all said the key did not exist. The renderer's read compiled only through `BaseSchema`'s index signature and a cast, which is also why objectui#6150's un-cast `schema.KEY` census could not see this reader. Declare `action?: SchemaNode`, mirror it as `SchemaNodeSchema`, advertise it as a `slot` input, and align the docs row. The renderer drops the cast and the object-only guard, so a bare string node renders as text instead of being silently dropped — the slot is no longer narrower than the type that names it. The value goes through `toRenderableSchema`, the existing total-function bridge, so nothing is coerced by hand. objectui#7082's recorded row for this key is inverted in place rather than deleted: its header promised the file would go red the day the key was declared, and it did. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QtGhnU3WnnWyiWeYQhw2aX
…ty-action-declare-schemanode
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
|
This was referenced Sep 7, 2026
Contributor
|
Contract review PASS at Generated by Claude Code |
hotlong
marked this pull request as ready for review
September 7, 2026 13:47
hotlong
deleted the
claude/issue-7105-empty-action-declare-schemanode
branch
September 7, 2026 14:04
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 #7105
Implements option (a) of the ruling on that card (director seat, decision batch #69, 2026-09-07; maintainer reply, verbatim: 「其他同意」). Options (b) and (c) were refused there and are not revisited here.
The state this ends
emptyrendered anactionnode andcontent/docs/components/feedback/empty.mdxdocumented it, while four surfaces disagreed about whether the capability existed:EmptySchema(TypeScript)actionaction?: SchemaNodefeedback.zod.tsmirroractionaction: SchemaNodeSchema.optional()registrationMeta.inputstitle/description/classNameactionas aslotaction?: BaseSchemaaction?: SchemaNodeThe renderer's read compiled only because
BaseSchemaends in an index signature and the read went through a cast — which is also why the objectui#6150 census, scanning un-cast reads, never saw this reader.Two behaviour changes, both deliberate
A bare string
actionnow renders instead of being silently dropped. The renderer required the value to be an object, which made this slot narrower than theSchemaNodeits siblings declare (body,children,DataTableSchema.emptyAction, the overlaytrigger/contentslots). Nothing was invented to widen it: the value goes throughtoRenderableSchema, the repo's existing total-function bridge from theSchemaNodeunion ontoSchemaRendererProps['schema'](which deliberately declares nonumber/boolean, objectui#4548 ruling Q2).The mirror now judges the value.
BaseSchemais.passthrough(), soactionalready parsed green as an unexamined key; anactionthat is neither a node object carrying atypenor a primitive is now refused. Notably{ label, onClick }—ToastSchema.action's shape, a different interface on the same file — no longer passes here.The ruling's premise was measured before the guard was relaxed
The ruling justifies relaxing the guard with a claim about
SchemaRenderer, not about this renderer: "a primitive node is handed toSchemaRendererlike any other node slot (a string renders as text)". Verified, and it holds —packages/react/src/__tests__/SchemaRenderer.primitiveSchema.test.tsxalready pins it byte-for-byte (render(SchemaRenderer schema="just some text")yieldstextContent === 'just some text').One qualification worth recording, since it is the declared behaviour and not a defect: the falsy primitives
'',0andfalserender nothing, caught by that component's pre-existing truthiness leg. That is what every other node slot does with them, so the slot is now exactly as wide as its declared type and no wider.The pin, both halves
packages/components/src/__tests__/empty-action-declared-7105.test.tsx— the ruling asks that thewith-action-buttondemo compile against the declared type and that a stringactionrender. A pin proving only the type would still hold with the object-only guard in place, which is the state this card exists to end.Every assertion is non-vacuous on the pre-change tree:
EqualofEmptySchema['action']againstSchemaNode) — it resolved toanythrough the index signature before;.shape, never on parse acceptance: under.passthrough()acceptance cannot tell "declared" from "admitted unexamined";{ label }, notype) was admitted before and is refused now — key membership and value judgement are separate facts, asserted separately;Reverse verification, run and reported rather than assumed. Restoring the object-only guard turns exactly one test red —
renders a BARE STRING action as text instead of dropping it, failing withexpected 'Nothing' to contain 'Ask an admin for access', the original symptom. The mutation was proved on disk by anchor counts and blob hash before the run, and the restore proved by blob equality againstHEADafter it.⭐ That ablation also showed why the behavioural half is load-bearing: the source-text pin stayed green under the reintroduced guard, because it was spelled
typeof schema.action === 'object'rather than the pinnedtypeof actionSchema === 'object'. A text pin cannot see a guard that comes back under another name.Cross-package type reverse verification. Appending a value the new declaration refuses turns the
@object-ui/componentstest program red withTS2322: Type '{ label: string; }' is not assignable to type 'SchemaNode'— namingSchemaNode, which proves the program reads the rebuiltpackages/types/dist/index.d.tsand not a cached one. Reverted; the working tree is clean.A file outside the dispatched surface, and why it is here
packages/types/src/__tests__/overlay-node-slot-doc-types-7082.test.tswas not in the dispatch's file list. It went red on this change by design: objectui#7082 recorded this exact row as "documented but declared nowhere" and its header promised "the day it is declared, this file goes red and the page is owed a row." The tripwire fired as intended.Its two pins are inverted in place, not deleted — the same reads asserted with the opposite verdict — so what replaced the recorded state is itself pinned. A deleted pin proves nothing about the state it left behind.
empty.tsxtherefore describes them in words, and says so on the spot.Verification
Measured on
ac0ecbe(this branch's head, after mergingorigin/maind8ab2dc); the package suites and the gate set below were all re-run on that head, not on the pre-merge base.pnpm exec vitest run packages/types/ packages/components/pnpm --filter @object-ui/types --filter @object-ui/components run type-checkpnpm --filter @object-ui/types --filter @object-ui/components run lintsrc/ui/**)check:doc-types·check:doc-fences·check:doc-snippets·check:sdui-registration-pins·check:spec-symbols·check:control-bytescheck-changeset-presence.mjscheck-governed-queue-guard.mjs --testcheck:doc-snippetsandcheck:sdui-registration-pinsboth first exited 2 with a prerequisite message (unbuilt packages / unbuilt console), which is not a red gate; both were re-run after the builds they name and are the exit 0 above.The repo-wide
pnpm lintand the fullpnpm testare left to CI rather than run locally, which is the declared narrowing here.Second deliverable
The ruling's repo-wide cast-spelling sweep is filed as one census card, objectui#8327, not as 21 ledger rows — each ledger row is a published-type widening owing its own adjudication, so the population needs triage before anything is declared.
origin/mainwith the repo's ownschemaReadsinstrument (objectui#6576), enumerating and reading from the same ref: 92 keys / 27 files counting comments and string literals, 58 keys / 21 files counting real code reads. The triage figure "21 distinct keys across 27 production files" pairs the two file counts, one from each row; neither is a key count. Details, the per-file table and the three of triage's keys that are not live reads are on that card.Route
needs:contract-reviewis on it, and the seat serves below the contract-review tier. Not flipped ready, not enqueued, no auto-merge. The maintainer has ruled that waiting for the review is fine.Generated by Claude Code