You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(spec): make page regions and component properties optional (unblock Studio non-list page creation) (#2254)
* fix(spec): make page `regions` and component `properties` optional
Two required-but-unauthorable fields made it impossible to create
record/home/app pages in the Studio metadata editor:
- `PageSchema.regions` was required, but the New Page form has no region
editor and list/interface pages don't use regions at all — forcing
`regions: []` boilerplate on every page and a hard dead-end for the rest.
- `PageComponentSchema.properties` was required, but the create-form seeds a
record page's layout from the object's synthesized default page
(buildDefaultPageSchema), whose nodes carry props at the top level — so
every seeded block failed with
"regions.N.components.M.properties: expected record". Many components
(record:activity, element:divider, …) also legitimately carry no props.
Both become `.optional().default(...)`; an empty full page falls back to the
synthesized default layout, slotted pages compose via `slots`, and list pages
ignore regions. Also drops the now-unneeded `required` flag on the page form's
regions repeater and updates the three tests that asserted the old contract.
Verified end-to-end: a record page now creates successfully through the
Studio form. 802 spec UI tests + spec/platform-objects typechecks green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore: changeset for page regions/properties optional
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
properties: z.record(z.string(),z.unknown()).describe('Component props passed to the widget. See component.zod.ts for schemas.'),
77
+
// Optional with an empty-object default. Many components carry no props
78
+
// (record:activity, element:divider, …), and the platform's own default-page
79
+
// synthesizer (buildDefaultPageSchema) emits nodes with props at the top
80
+
// level rather than under `properties`. Requiring `properties` forced
81
+
// `properties: {}` boilerplate and — worse — made every Studio attempt to
82
+
// seed a record page from its object's synthesized default layout fail
83
+
// validation ("regions.N.components.M.properties: expected record"), which
84
+
// was the real reason record/home/app pages couldn't be created in Studio.
85
+
properties: z.record(z.string(),z.unknown()).optional().default({}).describe('Component props passed to the widget. See component.zod.ts for schemas.'),
.describe('Layout regions (header, main, sidebar, footer) with their components. Optional — list pages use interfaceConfig, slotted pages use slots, and an empty full page falls back to the synthesized default layout.'),
0 commit comments