Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .changeset/drop-test-setup-shadow-stubs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
"@object-ui/components": patch
---

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 that measures 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.
14 changes: 14 additions & 0 deletions packages/components/src/renderers/layout/containers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,20 @@ ComponentRegistry.register('header', PageHeaderRenderer, {
skipFallback: true,
label: 'Page Header',
category: 'layout',
// The renderer reads all of these off the schema (or off `properties.*` —
// the spec bridge may inline or preserve the bag), so an author configures
// the header through them. `className` is left out as a styling
// pass-through, and the host-injected `RecordContext.headerSystemActions`
// is not authored here at all.
inputs: [
{ name: 'title', type: 'string', label: 'Title', description: 'Supports {field} interpolation and inline translation maps; falls back to the record title' },
{ name: 'subtitle', type: 'string', label: 'Subtitle', description: 'Same interpolation as Title' },
{ name: 'actions', type: 'array', label: 'Actions', description: 'Action buttons rendered in the header, before any host-injected system actions' },
{ name: 'breadcrumb', type: 'boolean', label: 'Breadcrumb', defaultValue: true },
{ name: 'recordChrome', type: 'boolean', label: 'Record Chrome', defaultValue: true, description: 'Set false for the bare h1 header on non-record pages' },
{ name: 'showStar', type: 'boolean', label: 'Show Follow Star', defaultValue: true },
{ name: 'showCopyId', type: 'boolean', label: 'Show Copy-ID', defaultValue: true },
],
});

// ---------------------------------------------------------------------------
Expand Down
Loading
Loading