feat(studio): seed a new record page from the object's default detail page (#1541)#1574
Merged
Merged
Conversation
… page (#1541) Creating a record page bound to an object started blank. Add a generic async `createSeed` hook to MetadataResourceConfig (merged into the create body after createBuildBody/createDefaults, best-effort), and register one on `page`: when creating a `pageType: 'record'` page with an `object`, fetch the object and seed `regions` from buildDefaultPageSchema(objectDef) — the same default detail layout the runtime renders. Authors tweak the default instead of rebuilding it. Live-verified: New page (record, object=showcase_invoice) persists regions with page:header / record:highlights / record:path / page:tabs / record:discussion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
Why
After PR #1572 you can create a record page bound to an object in Studio — but it started blank. The valuable workflow is "tweak the auto-generated default detail page," not "rebuild it from scratch."
What
createSeedhook toMetadataResourceConfig— create-time body augmentation that can reach runtime context the purecreateBuildBodycan't (e.g. fetch another metadata item). Merged into the create body aftercreateBuildBody/createDefaults; best-effort (a failure leaves the un-augmented body).createSeedon thepageresource: when creating apageType: 'record'page with anobject, fetch the object (client.get('object', …)) and seedregionsfrombuildDefaultPageSchema(objectDef)— the same default detail layout the runtime renders. (Lazy-imports the synth to avoid load-order coupling.)Verification
createSeedtests (seeds regions from a mock object def; returns{}for non-record / no-object / on failure) + 187 metadata-admin tests pass.showcase_invoice→ Save persiststype: record,object: showcase_invoice, and regions seeded withpage:header / record:highlights / record:path / page:tabs / record:discussion(the auto default), not blank.Completes the Studio authoring path for #1541 (create → seeded design → edit in PagePreview → publish via the existing draft/publish chrome → renders on records via
usePageAssignment). The end-user runtime edit entry remains intentionally deferred.🤖 Generated with Claude Code