Skip to content

Commit 802f0bc

Browse files
fix(examples): repair the class (i) keys the strict authoring face refuses (objectui#5250 slice C) (#12128)
Part of #5250 Clause-②: no Slice C of the objectui#5250 programme: the non-docs class (i) documents. These are authored documents that the shipped strict authoring face (`StrictAnyComponentSchema`, the face `objectui validate` judges with) refuses only because they carry a key that no schema declares. The slice table and its drop-list are in the park review (comment 5887006513): no deletion without runtime proof, and no declaration. Slice B is objectui#12127 (the JSON-fence gate plus the docs repairs). This card stays open until both have merged. ## The set, re-derived on the dispatch base 5a65f7d **Instrument:** a throwaway script. It reads every `examples/schema-catalog/src/schemas/**/*.json`, `examples/hello-world/schema.json`, and the exported nodes of `packages/types/examples/*.ts`. It judges each node document whole with the built `StrictAnyComponentSchema` and `AnyComponentSchema`, and names keys with the CLI's own `findUndeclaredKeys`. **Reading:** 435 node documents. 26 are refused, 13 of them strict-only. 14 documents carry an undeclared key, and they hold 12 (component, key) pairs: - 11 catalog fixtures; - `examples/hello-world/schema.json`; - `packages/types/examples/dashboard.ts`; - `packages/types/examples/login-form.ts`. The other 12 refusals (5 `carousel`, 6 `resizable`, 1 toaster `stack`) name no undeclared key. Both faces refuse them for value or shape reasons, so they are not class (i) and are not touched here. The dispatch order's "25 files" is the whole class (i) set of the measurement report, docs included. The non-docs half is these 14. ## Per-pair disposition and runtime proof **Instrument:** a throwaway dom-project test, never committed. It renders each node through the real `SchemaRenderer` and the real registry (`packages/components/src/renderers` plus `@object-ui/fields`), once with the key and once without it. It compares the normalised `document.body` HTML. Combobox cases are compared with the popover OPEN, where a search placeholder or an empty text would show. **Controls:** every declared key a pair is renamed to changes the output, so the instrument can see a read key: `items[].children`, `className: "w-full"`, `submitLabel`, `colSpan`, `label`, `children`, and the combobox `placeholder`. | file | pair | runtime reading | disposition | |:--|:--|:--|:--| | `components-basic-navigation-menu/documentation-nav.json`, `site-navigation.json` | navigation-menu `items[].items` | identical. The renderer reads `item.children` (control: it draws a submenu trigger) | renamed to `children` | | `components-data-display-list/basic-list.json` | list `items[].type` (x3) | identical. `ui:list` draws each item's `content` | removed | | `components-form-button/full-width-button.json` | button `fullWidth` | identical (control: `className: "w-full"` adds the class) | replaced by `className: "w-full"`, the declared key the fixture's name asks for | | `components-form-combobox/country-selector.json`, `searchable-combobox.json` | combobox `searchPlaceholder`, `emptyText` | identical with the popover open, both with options and with none. The renderer passes only DOM keys on (`toFormControlDomProps`) | removed | | `components-form-form/contact-form.json`, `login-form.json`, `registration-form.json` | form `submitButton` | differs only by a stray `submitbutton` DOM attribute on the `form` element (control: `submitLabel` changes the button text) | renamed to `submitLabel` | | `components-form-form/contact-form.json` | form field `columnSpan` | differs only by a stray `columnspan` attribute on the textarea (control: `colSpan` adds the `md:col-span-2` class) | renamed to `colSpan` | | `components-form-label/required-label.json` | label `required` | differs only by a `required` attribute on the `label` element, which draws no indicator | removed | | `fields-object/structured-configuration.json` | object field `schema` | identical | removed | | `examples/hello-world/schema.json` | button `content` | identical: the button rendered blank (control: `label` draws it) | renamed to `label` (the park review's rename) | | `packages/types/examples/dashboard.ts` | card `content` | differs only by a stray `content` DOM attribute. The data table never rendered (control: `children` renders it) | renamed to `children` | | `packages/types/examples/login-form.ts` | form field `defaultChecked` | **READ**: with `true` the checkbox renders `checked`. `false` is identical only because it is the default | **not touched**: a class (ii) pair, reported, neither deleted nor declared | **H6, checked:** only the `button` node's `content` is undeclared in `hello-world`. Its two `text` nodes author `content`, which `text` declares and reads, so they stay. ## After the change The same instrument reads 435 documents, 0 strict-only refusals, and 14 refused: - the 12 shape and value refusals above; - `login-form.ts`: the class (ii) `defaultChecked`, plus the host-supplied `onSubmit` function that both faces refuse by name as a runtime slot; - `dashboard.ts`, which is NEW to the refused list for a non-class-(i) reason. With `children` in place, the data table is parsed (and rendered) for the first time, and it carries host-supplied `onRowEdit` / `onRowDelete` functions. That is the same runtime-slot refusal as `login-form.ts`'s `onSubmit`. It was masked until now, because the misplaced `content` key kept the table out of every parse and every render. **Reverse leg:** with the 13 repaired documents reverted to `5a65f7d5`, the instrument reads 26 refused, 13 strict-only, and 14 carrying an undeclared key, which is the base reading. Restored with `git checkout HEAD -- FILES`; `git diff HEAD` is empty afterwards. ## Pins - **H7 does not hold as written.** `examples/schema-catalog/test/safe-validate-corpus-6318.test.ts` pins seven named fixtures, none of them touched here, and by design it pins no corpus count. It is unchanged and green. - **The count that moved** is `NODE_CENSUS` in `examples/schema-catalog/test/layout-dom-leak-5574.test.tsx`. Its structural walk collected `basic-list`'s three `type: "text"` items as bare text nodes, so `text` moves by exactly three: rendered 687 to 684, no-element 140 to 137. It is re-pinned with a dated comment in the file's own style. ## Gates (HEAD `54a95e75`) | command | exit | |:--|:--| | locked `vitest run` over `examples/schema-catalog/` (including the 6318 pin and the census) and every test outside it that names `schema-catalog` or `hello-world` (71 files, two runs) | 0, "Test Files 68 passed (68)" / "Tests 2988 passed (2988)", and "Test Files 45 passed (45)" / "Tests 1274 passed, 16 skipped (1290)" | | `pnpm --filter @object-ui/types type-check` (echoed `tsc --noEmit && tsc -p tsconfig.examples.json && tsc -p tsconfig.test.json`) | 0 | | `node scripts/check-changeset-presence.mjs` | 0, "no changeset is owed", so none is added (`packages/types/examples/**` is outside `@object-ui/types`' `files`, and the catalog and hello-world are private examples) | | `pnpm check:new-line-citations` | 0, "0 new citation(s)" | | `pnpm check:control-bytes` | 0 | | `pnpm docs:check-links` | 0 | | `pnpm check:doc-types` | 0 | | `node scripts/check-governed-queue-guard.mjs --test` over the 14 paths | 0, NOT GOVERNED | | `pnpm check` (the CLI self-check `lint.yml` runs) | NOT MEASURED: it needs the CLI build. It exits non-zero only on unreadable JSON or an expression refusal, and every edited JSON file parses. Declared to CI | ## Acceptance notes - **Class (ii), not repaired here.** `login-form.ts`'s `defaultChecked` is read through the checkbox field widget. Slice B measured the same channel for a text field's `defaultValue`. The strict face refuses both, so `objectui validate` tells an author to remove keys that work. Reported on the card for the declaration side; nothing is declared here. - **Docs interface blocks still advertise three of the removed keys:** `content/docs/components/form/button.mdx` (`fullWidth`), `form.mdx` (`submitButton`) and `label.mdx` (`required`, "Show required indicator"). The probes above show nothing reads them. Those pages are outside both slices' file surfaces, so this is reported on the card rather than changed here. The session that produced this change is `https://claude.ai/code/session_01DwLS3LzXyNmyTunMGbpc8W`. --- _Generated by [Claude Code](https://claude.ai/code/session_01DwLS3LzXyNmyTunMGbpc8W)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 69bca0a commit 802f0bc

14 files changed

Lines changed: 17 additions & 29 deletions

File tree

‎examples/hello-world/schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"children": [
99
{ "type": "text", "content": "Welcome to ObjectUI!" },
1010
{ "type": "text", "content": "This UI is rendered from a JSON schema." },
11-
{ "type": "button", "content": "Get Started", "variant": "default" }
11+
{ "type": "button", "label": "Get Started", "variant": "default" }
1212
]
1313
}
1414
]

‎examples/schema-catalog/src/schemas/components-basic-navigation-menu/documentation-nav.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"items": [
44
{
55
"label": "Getting Started",
6-
"items": [
6+
"children": [
77
{
88
"label": "Introduction",
99
"description": "Learn the basics",

‎examples/schema-catalog/src/schemas/components-basic-navigation-menu/site-navigation.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
{
99
"label": "Products",
10-
"items": [
10+
"children": [
1111
{
1212
"label": "All Products",
1313
"href": "/products"

‎examples/schema-catalog/src/schemas/components-data-display-list/basic-list.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22
"type": "list",
33
"items": [
44
{
5-
"type": "text",
65
"content": "Item 1"
76
},
87
{
9-
"type": "text",
108
"content": "Item 2"
119
},
1210
{
13-
"type": "text",
1411
"content": "Item 3"
1512
}
1613
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "button",
33
"label": "Full Width Button",
4-
"fullWidth": true,
4+
"className": "w-full",
55
"variant": "default"
66
}

‎examples/schema-catalog/src/schemas/components-form-combobox/country-selector.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"type": "combobox",
33
"placeholder": "Select country...",
4-
"searchPlaceholder": "Search countries...",
54
"options": [
65
{
76
"value": "us",

‎examples/schema-catalog/src/schemas/components-form-combobox/searchable-combobox.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"type": "combobox",
33
"placeholder": "Select language...",
4-
"searchPlaceholder": "Search languages...",
5-
"emptyText": "No language found.",
64
"options": [
75
{
86
"value": "js",

‎examples/schema-catalog/src/schemas/components-form-form/contact-form.json‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131
"name": "address",
3232
"label": "Address",
3333
"type": "textarea",
34-
"columnSpan": 2
34+
"colSpan": 2
3535
}
3636
],
37-
"submitButton": {
38-
"label": "Submit"
39-
}
37+
"submitLabel": "Submit"
4038
}

‎examples/schema-catalog/src/schemas/components-form-form/login-form.json‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@
1818
"required": true
1919
}
2020
],
21-
"submitButton": {
22-
"label": "Sign In"
23-
}
21+
"submitLabel": "Sign In"
2422
}

‎examples/schema-catalog/src/schemas/components-form-form/registration-form.json‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,5 @@
2727
"max": 120
2828
}
2929
],
30-
"submitButton": {
31-
"label": "Register"
32-
}
30+
"submitLabel": "Register"
3331
}

0 commit comments

Comments
 (0)