fix(spec): make page regions and component properties optional (unblock Studio non-list page creation)#2254
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 91 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 24, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Found by dogfooding the Studio page designer as a business user: you cannot create a record / home / app page — saving fails with
regions: Invalid type: expected record, received undefined(×5), and there is no UI affordance to satisfy it. List pages create fine.Two required-but-unauthorable fields are responsible:
PageSchema.regionswas required, but the "New Page" form has no region editor and list/interface pages don't use regions at all. This forcedregions: []boilerplate on every page (see everyexamples/app-showcase/src/pages/*.page.ts) and a hard dead-end for record/home/app pages.PageComponentSchema.propertieswas the real gate. The create-form seeds a record page's layout from the bound object's synthesized default page (buildDefaultPageSchema), whose nodes carry their props at the top level rather than underproperties. So every seeded block failedregions.N.components.M.properties: expected record. Many components (record:activity,element:divider, …) also legitimately carry no props.Fix
regions: z.array(PageRegionSchema).optional().default([])properties: z.record(z.string(), z.unknown()).optional().default({})required: trueon the page form'sregionsrepeater (page.form.ts)Semantics are unchanged for existing pages: an empty
fullpage falls back to the synthesized default layout, slotted pages compose viaslots, list pages ignore regions.: Page-typed literals still getregions/propertiesvia the defaults (z.inferkeeps them non-optional).Verification
showcase_project) through the Studio form end-to-end → saved → editor opened with the auto-seeded default layout (path stepper / details / discussion).@objectstack/spec+platform-objectstypecheck clean.🤖 Generated with Claude Code