Repository navigation
feat(components): element:text takes the published nine variant values (objectui#7450) - #11304
Conversation
…s (objectui#7450) `element:text` converges on `TextSchema.variant`'s nine (h1-h6, body, caption, overline), which `@objectstack/spec` 17.5.0 accepts on `ElementTextPropsSchema.variant`. Each value maps the way `ui:text` maps it: the heading element it names and `ui:text`'s class; body/caption/overline keep element:text's paragraph element. `heading`/`subheading`, still accepted by the installed spec, render exactly as before and stay in the registry `inputs` enum (the html tier's accept set) until the spec retires them; the Studio inspector stops offering them. Absence still renders `body` on element:text, and `ui:text` still does not synthesise it. The one in-repo producer (the console page preview sample) moves to `h3`, the refusal prose in the types mirror names the converged vocabulary, and the bare-key resolution pin now drives the absence case, the one that still discriminates once the vocabularies agree. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
…shed-variants Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
|
changeset-claim-re-read
|
✅ 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
|
…(objectui#7450) Comment only. The paragraph saying the two text vocabularies are not reconciled and that element:text publishes its own four was made false by this branch's convergence. It now says both primitives take the published nine (this map being the one that does not move), that element:text still accepts heading / subheading because the installed spec does, and that the objectui#6942 defaulting asymmetry stays. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
✅ 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
|
Contract reviewServed-tier: Inputs: card objectui#7450 (body and all 21 comments), PR objectui#11304 (body, 13-file list, net diff ① Derived judgmentsEvery accept-set and public-surface change the diff implies, each judged.
F1 — prose, non-blocking. The PR body ("Zone 2 readings" item 2, "Measured on ② Semver levelFour changesets, one per released package touched (
③ Boundary flagsDev
Dev
Escalations to the seat (this record's own, not the dev's):
CI on the head. 42 check-runs: 29 concluded success, 3 skipped (the two coverage jobs and dependabot), and 10 still Implemented-by: VERDICT: PASS |
…iants (objectui#7450) Text only. The old registry enum carried no h2 / h3 either, so on main the html tier refused h1-h6 and overline, seven values, not the five the sentence listed. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
✅ 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
|
Contract reviewServed-tier: Delta record. This record re-judges only what moved between ① Derived judgmentsJudgments 1 to 12 of F1 — closed. The delta replaces, in the F1 residue, non-blocking. The PR body's "Zone 2 readings" item 2 still says five ( The 6150 reading (the dev's out-of-scope finding) — confirmed, and not this PR's. Whose to fix: not this PR's. This PR's ② Semver levelUnchanged from ③ Boundary flagsPatch round 2 ( Carried over from CI on the head. 42 check-runs: 24 concluded success, 3 skipped ( Implemented-by: VERDICT: PASS |
Fixes #7450
Clause-②: yes
element:textconverges on the publishedTextSchema.variantnine (h1-h6,body,caption,overline). This is the objectui half of ruling B (card comment 5565743592, maintainer 「其他同意」), on the released@objectstack/spec17.5.0 pin that the routing (5599600566, two releases) waits for. Dev seat:domain:ui#1, sessionhttps://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ.Note on spelling: GitHub strips tag-shaped text from bodies, so HTML elements are written as words below ("an h2 element", "a p element").
What moved, face by face
elements.tsx)ui:text's class for that value. heading and subheading keep their old classesTextSchema['variant'](the nine) plus the two spellings the contract still acceptsinputsenumdescriptionthat names the nine as the values to writeblock-config.ts) and the en/zh rows (metadata-admin/i18n.ts)apps/console/src/preview-samples.ts)variant: 'subheading'variant: 'h3', and the sample's prose is correctedpackages/types/src/zod/public-blocks.zod.ts, a declared cross-lane surface)h1-h6) or the paragraph style (body,caption,overline)"ui:text(text.tsx) is not changed. Its objectui#6942 rule stands: it does not synthesisebodywhenvariantis absent. objectui adds no local refusal, refinement or retirement mechanism.Zone 2 readings, measured before building
1. What the installed spec accepts. Probe:
ElementTextPropsSchema.safeParsefrom the installednode_modules/@objectstack/spec17.5.0.h1toh6,body,caption,overline,heading,subheading.invalid_value:title,display,bogus. This is the firing control.variantparses tovariant: 'body', because the spec declares.default('body').So the second case of Zone 2.2 holds. The spec still accepts
headingandsubheading, so the renderer keeps rendering them the way it always did, and the offering faces stop offering them. objectstack#17109's mechanism shipped, but it has not been applied to these two values.2. Falsified in part: the registry
inputsenum is not an offer-only face.page.tsxbuilds the html tier's JSX manifest from the registryinputs. Aninvalid-enumerror there fails the whole page.inputsfeed the publishedsdui.manifest.json, which the objectstack CLI's JSX gate reads.headingandsubheadingfrom that enum would make objectui refuse two values the spec accepts. That is a retirement ahead of the spec's, and the order forbids it.Ablation A1 (below) measures this. Without the pair, the html tier refuses
variant="heading", andregistry-inputs-spec-parity.test.tsstays green, because it judges widening only.The resolution: the registry enum equals the contract's set, and the new pin asserts that equality. Its
descriptionpoints authors to the nine. The Studio inspector, which only offers values, offers just the nine.Measured on
mainbefore this change: the html tier refusedh1,h4toh6andoverlineonelement:textwithinvalid-enum, which fails the page. The renderer drew all ofh1toh6andoverlineas a body p element.3. The element map, with one deliberate deviation from the literal reading.
h1toh6render the heading elementui:textrenders.ui:text's class. The pin renders both renderers and compares them.body,captionandoverlinerender a p element, notui:text's inline span. Two reasons:element:texthas always rendered a p element for its non-heading values.bodyandcaptionrender byte-identically before and after this change.ALIGN_CLASShas noblock, so a span would leavealigninert.4. The default. An absent
variantonelement:textrenders the same bytes as an authoredbody. This is pinned beside aui:textcontrol that still renders no element for the same input.5. Producer and riders.
preview-samples.tsmovessubheadingtoh3. The sample's own prose says the original asked forlevel: 3.public-blocks.zod.tsprose is corrected.content/docs/documentselement:textzero times. There is one incidental mention, in a CLI diagnostic sample inutilities/cli.mdxthat lists type names. The control,page:header, appears in 3 files. No docs page is added, as the routing said.The migration is not one-to-one
The migration hint is
headingtoh2andsubheadingtoh3, or the level the document means. The sizes do not carry over, though, because the legacy pair keeps its old classes:headingwas text-2xl on an h2 element. That isui:text'sh3size;h2is text-3xl.subheadingwas text-lg on an h3 element;h3is text-2xl.The preview sample's "Quick links" heading therefore renders larger after moving to
h3.Tests (final head
a0bc45d76e, a merge oforigin/maind79f525d9e)All heavy runs went through
os-verify-lock.sh(slotissue-7450).Build.
pnpm --workspace-concurrency=2 --filter '@object-ui/console^...' run build: exit 0. This closure contains components, types and app-shell.Type-check.
pnpm --filter X run type-checkfor@object-ui/types,@object-ui/components,@object-ui/app-shelland@object-ui/console: exit 0 each.tsc -p tsconfig.test.json --listFilesOnly, not assumed.block-config.test.ts).Vitest.
pnpm exec vitest run --maxWorkers=3from the repo root: 472 files, 10178 tests passed, exit 0. The set:packages/types/packages/components/src/renderers/basic/packages/app-shell/src/views/metadata-admin/previews/text-variant-align-6942.test.tsxgit grep -lfinds for element:text, ElementTextRenderer, subheading, preview-samples or option.variant. This includesregistry-inputs-spec-parity.test.ts,public-contract.test.tsand the three preview-samples suites.Repo checks (exit 0 each):
check:control-bytes: OK.check:new-line-citations: 0 new.check-changeset-presence: 8 source files in 4 released packages, 4 changesets.changeset:check.check:i18n-keys.check:i18n-designer-parity.check:test-path-roots.check:changeset-claims(report-only): it lists 8 pending changesets that name touched files. Each was re-read, and all are still true.check:component-surface-parity(report-only): noelement:textrow.check-governed-queue-guard --test: NOT GOVERNED.ESLint (narrowed).
eslint --no-inline-config --format jsonon the 8 changed TS/TSX files: 0 errors, 19 warnings, 0 files ignored.elements.tsx, and they are the same set as the base blob linted through stdin: 12 no-explicit-any, 5 only-export-components, 1 set-state-in-effect, 1 exhaustive-deps.eslint.config.jssets noparserOptions.projectorprojectService, so linting is not type-aware. No rule undereslint-rules/reads the filesystem. So this diff cannot move a verdict on an untouched file. The repo-widepnpm lintbelongs to CI.Ablations. Each ran from the committed state through
ablation-replace.mjs, under a trap. Every leg proved its write on disk (anchor count 1 to 0, blob changed) and its restore (blob equals HEAD blob03740bf2,git diff HEADempty).headingandsubheadingfrom the registry enum. The new pin goes red, 3 of 50: the accept-set equality test, and the html tier compilingheadingandsubheading.registry-inputs-spec-paritystays green, 230 of 230.title. The parity gate goes red ("element:text declares no arm the spec refuses outright"), which proves it reads the mutated source. Its green in A1 is therefore a real reading.h1to a p element. The pin goes red, 1 of 50 ("h1 renders the heading element it names").skipFallbacktofalseon element:text, which equals deleting it, because the guard reads!meta?.skipFallback. The bare-key pin goes red, 3 of 7, including the rewritten absence case.Pins
packages/components/src/renderers/basic/__tests__/element-text-published-variants-7450.test.tsx. The nine are derived from the types mirror and the accept set from the spec. The one restated fact is the pre-convergence pair, which goes red, with instructions, when spec release 2 retires it.packages/app-shell/src/views/metadata-admin/previews/__tests__/element-text-variant-options-7450.test.ts. It pins the inspector offer: the nine, inui:textorder, each accepted by the spec, labelled distinctly in en and zh.text-bare-key-resolution-7450.test.tsx. Once the vocabularies agree,h1no longer tells the two renderers apart. WhatskipFallbackstill protects is absence: under the flag, the unannotatedtextnode renders no wrapper element, and the control showselement:textpainting a body p element.Acceptance notes (not changed here)
text.tsx's docblock paragraph that begins "The two vocabularies are NOT reconciled here and must not be" is now stale. It still sayselement:textpublishes heading, subheading, body and caption. I left it untouched under the order's "do not change ui:text". A comment-only fix could say: element:text converged on these nine by adopting this map (objectui#7450); this map is the vocabulary and does not move. Carrier: none.InspectorSelectField's generic flag ("not found"). A "deprecated" flag would need per-field plumbing inBlockPropField. Carrier: none.h3now renders at the same size aspage:header's bare-title h1 (both text-2xl). That comes from a mismatch between theui:textheading ladder andpage:header's title size, and is polish. Carrier: none.@object-ui/componentsdeclares@objectstack/spec^17.0.0, but its offered enum matches 17.5.0's accept set. The validator,@object-ui/types, sets its floor at^17.5.0.check-spec-range-floorsjudges only whether symbols are present (objectui#9036). Noted, not changed.preview-samples-registry-resolvable.test.tsstill namesvariant: 'heading'(which renders an h2) as the nearest real thing. That is still true, so it was not edited.@object-ui/componentsminor (Clause-② widening of the manifest enum),@object-ui/app-shellpatch,@object-ui/typespatch (message text only),@object-ui/consolepatch.Generated by Claude Code