Skip to content

Commit 9232e40

Browse files
committed
fix(test-setup): stop shadowing ten real registrations, and declare page:header's inputs
vitest.setup.dom.tsx re-registered text, email, password, textarea, image, html, avatar, select, slider and grid by hand — ~380 lines of renderer copied out of @object-ui/components — to undo bare-name fallbacks that @object-ui/fields and the plugins claimed by loading after it. Both sides now register under their own namespace with skipFallback: true, so nothing overwrites the ui: originals and the workaround is obsolete. It was not free: the copies carried no `inputs` and no `defaultProps`, so inside the test environment four curated public blocks reported an empty configuration surface while the real registrations declare one. apps/console's contract test reads that registry, so its picture of the contract was fiction for those tags — a guard measuring a fixture instead of the product. Deleting the block restores what the app actually boots with. Verified: the ten tags keep their namespace and canonical type, and their declared surface comes back — text 1 input, email 6, password 6, textarea 6, image 3, html 1, avatar 4, select 6, slider 5, grid 7, plus defaultProps. The heavy DOM setup also got roughly twice as fast (~545s to ~235s of setup time across the suite), since every file in that project was paying to evaluate the duplicated renderers. With the shadowing gone, page:header was left as a genuine gap: a curated public block whose renderer reads title, subtitle, actions, breadcrumb, recordChrome, showStar and showCopyId, with none of them declared. Now declared. element:divider keeps zero inputs on purpose — its renderer reads only className, so there is nothing to author. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N4mrr1ihhwnfEHFSWmGoMp
1 parent 4e11db8 commit 9232e40

3 files changed

Lines changed: 69 additions & 392 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
"@object-ui/components": patch
3+
---
4+
5+
fix(test-setup): stop shadowing ten real registrations, and declare page:header's inputs
6+
7+
`vitest.setup.dom.tsx` re-registered `text`, `email`, `password`, `textarea`,
8+
`image`, `html`, `avatar`, `select`, `slider` and `grid` by hand — ~380 lines of
9+
renderer copied out of @object-ui/components — to undo bare-name fallbacks that
10+
@object-ui/fields and the plugins claimed by loading after it.
11+
12+
Both sides now register under their own namespace with `skipFallback: true`, so
13+
nothing overwrites the `ui:` originals and the workaround is obsolete. It was
14+
not free: the copies carried no `inputs` and no `defaultProps`, so inside the
15+
test environment four curated public blocks reported an empty configuration
16+
surface while the real registrations declare one. `apps/console`'s contract
17+
test reads that registry, so its picture of the contract was fiction for those
18+
tags — a guard that measures a fixture instead of the product.
19+
20+
Deleting the block restores what the app actually boots with. Verified: the ten
21+
tags keep their namespace and canonical type, and their declared surface comes
22+
back — `text` 1 input, `email` 6, `password` 6, `textarea` 6, `image` 3,
23+
`html` 1, `avatar` 4, `select` 6, `slider` 5, `grid` 7, plus `defaultProps`.
24+
The heavy DOM setup also got roughly twice as fast (~545s to ~235s of setup
25+
time across the suite), since every file in that project was paying to evaluate
26+
the duplicated renderers.
27+
28+
With the shadowing gone, `page:header` was left as a genuine gap: a curated
29+
public block whose renderer reads `title`, `subtitle`, `actions`, `breadcrumb`,
30+
`recordChrome`, `showStar` and `showCopyId`, with none of them declared. Now
31+
declared.
32+
33+
`element:divider` keeps zero inputs on purpose — its renderer reads only
34+
`className`, so there is nothing to author.

packages/components/src/renderers/layout/containers.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,20 @@ ComponentRegistry.register('header', PageHeaderRenderer, {
13061306
skipFallback: true,
13071307
label: 'Page Header',
13081308
category: 'layout',
1309+
// The renderer reads all of these off the schema (or off `properties.*` —
1310+
// the spec bridge may inline or preserve the bag), so an author configures
1311+
// the header through them. `className` is left out as a styling
1312+
// pass-through, and the host-injected `RecordContext.headerSystemActions`
1313+
// is not authored here at all.
1314+
inputs: [
1315+
{ name: 'title', type: 'string', label: 'Title', description: 'Supports {field} interpolation and inline translation maps; falls back to the record title' },
1316+
{ name: 'subtitle', type: 'string', label: 'Subtitle', description: 'Same interpolation as Title' },
1317+
{ name: 'actions', type: 'array', label: 'Actions', description: 'Action buttons rendered in the header, before any host-injected system actions' },
1318+
{ name: 'breadcrumb', type: 'boolean', label: 'Breadcrumb', defaultValue: true },
1319+
{ name: 'recordChrome', type: 'boolean', label: 'Record Chrome', defaultValue: true, description: 'Set false for the bare h1 header on non-record pages' },
1320+
{ name: 'showStar', type: 'boolean', label: 'Show Follow Star', defaultValue: true },
1321+
{ name: 'showCopyId', type: 'boolean', label: 'Show Copy-ID', defaultValue: true },
1322+
],
13091323
});
13101324

13111325
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)