Create dialog: sidecar create-flag for optional fields + land in properties when fields were hidden #81
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle#81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Page-type sidecars gain a per-field
create: trueflag that pulls an optional field into the List module's create dialog. Required fields keep appearing automatically (today's rule, unchanged); there is no opt-out direction. After a List-module create, if the page-type has fields that were NOT shown in the dialog, the editor navigates to the new page with the properties panel open; if the dialog showed everything, it stays in the list as today. The tree's inline "New subpage" phantom row is untouched.The news bundle uses the flag:
news-item.yamlmarksteaserandimagewithcreate: true(authorstays out — so news creates land in properties afterward, which is intended).Key code:
web/src/components/ListModule.tsx(CreateDialog,dialogFieldsfilter,onCreated),internal/pagetype/schema.go(flag parsing),scaffold/features/news/editor/pagetypes/news-item.yaml.Acceptance criteria
create: true; engine rejects/ignores it per existing schema-strictness conventions for required fields (they are always shown anyway)create: trueoptional fields, in sidecar field orderteaserandimageflaggedcreate: truescaffold/site/AGENTS.mddocuments thecreate:flag in the page-type sidecar sectionBlocked by
None - can start immediately
Triage addendum — verified against the codebase
The brief holds up against the current code. Corrections and confirmed facts for the implementing agent:
Pointer correction: the
create:flag is parsed ininternal/element/load.go(RawParam, ~lines 187–195), notinternal/pagetype/schema.go. Page-type sidecars reuse the element param vocabulary (internal/pagetype/load.godecodesFields []element.RawParamstrictly and runselement.ParseParams), so one addition toRawParam+element.Param(internal/element/schema.go~221–235) covers both elements and page-types. Both sidecar loaders useyaml.Strict(), so without the schema addition anycreate:key is rejected at load — the flag must be added to the shared type.Confirmed current behavior:
dialogFieldsinweb/src/components/ListModule.tsx(~line 111) isfields.filter(f => f.required && !isTitleName(f.name))— Title + required non-title fields, exactly as the brief states.onCreated(~line 342) doessetCreating(false)+refetchTree()— no navigation. The tree phantom row (web/src/components/TreePane.tsx,confirmPhantom~line 534) shares only thecreatePageAPI helper, not UI code — itshandleCreateddoes navigate. Leave it untouched.news-item.yaml: onlydateis required;teaser,image,authorare optional — so today's news create dialog is Title + date, and with this change it becomes Title + date + teaser + image, landing in properties afterward (author was hidden).web/src/test/ListModule.test.tsx,describe("list module: the create dialog")(~line 168) — extend there.### Page types, ~line 105 ofscaffold/site/AGENTS.md); the field-key vocabulary is in the element sidecar section.Coordination note: #83 also adds a key to
RawParam/element.Paramand touchesAGENTS.md— expect a small rebase if both are in flight simultaneously.