Create dialog: sidecar create-flag for optional fields + land in properties when fields were hidden #81

Closed
opened 2026-07-17 23:28:20 +02:00 by dominik.polakovics · 1 comment

What to build

Page-type sidecars gain a per-field create: true flag 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.yaml marks teaser and image with create: true (author stays out — so news creates land in properties afterward, which is intended).

Key code: web/src/components/ListModule.tsx (CreateDialog, dialogFields filter, onCreated), internal/pagetype/schema.go (flag parsing), scaffold/features/news/editor/pagetypes/news-item.yaml.

Acceptance criteria

  • Page-type sidecar field accepts create: true; engine rejects/ignores it per existing schema-strictness conventions for required fields (they are always shown anyway)
  • List-module create dialog shows Title + required fields + create: true optional fields, in sidecar field order
  • After create: navigate to the new page with the properties panel open iff the type has fields not shown in the dialog; otherwise stay in the list (dialog closes, list refreshes)
  • Tree phantom-row create behavior unchanged
  • News bundle: teaser and image flagged create: true
  • scaffold/site/AGENTS.md documents the create: flag in the page-type sidecar section
  • Tests cover dialog field selection and the conditional post-create navigation

Blocked by

None - can start immediately

## What to build Page-type sidecars gain a per-field `create: true` flag 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.yaml` marks `teaser` and `image` with `create: true` (`author` stays out — so news creates land in properties afterward, which is intended). Key code: `web/src/components/ListModule.tsx` (`CreateDialog`, `dialogFields` filter, `onCreated`), `internal/pagetype/schema.go` (flag parsing), `scaffold/features/news/editor/pagetypes/news-item.yaml`. ## Acceptance criteria - [ ] Page-type sidecar field accepts `create: true`; engine rejects/ignores it per existing schema-strictness conventions for required fields (they are always shown anyway) - [ ] List-module create dialog shows Title + required fields + `create: true` optional fields, in sidecar field order - [ ] After create: navigate to the new page with the properties panel open iff the type has fields not shown in the dialog; otherwise stay in the list (dialog closes, list refreshes) - [ ] Tree phantom-row create behavior unchanged - [ ] News bundle: `teaser` and `image` flagged `create: true` - [ ] `scaffold/site/AGENTS.md` documents the `create:` flag in the page-type sidecar section - [ ] Tests cover dialog field selection and the conditional post-create navigation ## Blocked by None - can start immediately
Author
Owner

This was generated by AI during triage.

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 in internal/element/load.go (RawParam, ~lines 187–195), not internal/pagetype/schema.go. Page-type sidecars reuse the element param vocabulary (internal/pagetype/load.go decodes Fields []element.RawParam strictly and runs element.ParseParams), so one addition to RawParam + element.Param (internal/element/schema.go ~221–235) covers both elements and page-types. Both sidecar loaders use yaml.Strict(), so without the schema addition any create: key is rejected at load — the flag must be added to the shared type.

Confirmed current behavior:

  • Dialog filter today: dialogFields in web/src/components/ListModule.tsx (~line 111) is fields.filter(f => f.required && !isTitleName(f.name)) — Title + required non-title fields, exactly as the brief states.
  • Post-create today: onCreated (~line 342) does setCreating(false) + refetchTree() — no navigation. The tree phantom row (web/src/components/TreePane.tsx, confirmPhantom ~line 534) shares only the createPage API helper, not UI code — its handleCreated does navigate. Leave it untouched.
  • news-item.yaml: only date is required; teaser, image, author are 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).
  • Existing tests: web/src/test/ListModule.test.tsx, describe("list module: the create dialog") (~line 168) — extend there.
  • AGENTS.md: document the flag under the page-type sidecar section (### Page types, ~line 105 of scaffold/site/AGENTS.md); the field-key vocabulary is in the element sidecar section.

Coordination note: #83 also adds a key to RawParam/element.Param and touches AGENTS.md — expect a small rebase if both are in flight simultaneously.

> *This was generated by AI during triage.* ## 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 in `internal/element/load.go` (`RawParam`, ~lines 187–195), not `internal/pagetype/schema.go`. Page-type sidecars reuse the element param vocabulary (`internal/pagetype/load.go` decodes `Fields []element.RawParam` strictly and runs `element.ParseParams`), so one addition to `RawParam` + `element.Param` (`internal/element/schema.go` ~221–235) covers both elements and page-types. Both sidecar loaders use `yaml.Strict()`, so without the schema addition any `create:` key is rejected at load — the flag must be added to the shared type. **Confirmed current behavior:** - Dialog filter today: `dialogFields` in `web/src/components/ListModule.tsx` (~line 111) is `fields.filter(f => f.required && !isTitleName(f.name))` — Title + required non-title fields, exactly as the brief states. - Post-create today: `onCreated` (~line 342) does `setCreating(false)` + `refetchTree()` — no navigation. The tree phantom row (`web/src/components/TreePane.tsx`, `confirmPhantom` ~line 534) shares only the `createPage` API helper, not UI code — its `handleCreated` *does* navigate. Leave it untouched. - `news-item.yaml`: only `date` is required; `teaser`, `image`, `author` are 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). - Existing tests: `web/src/test/ListModule.test.tsx`, `describe("list module: the create dialog")` (~line 168) — extend there. - AGENTS.md: document the flag under the page-type sidecar section (`### Page types`, ~line 105 of `scaffold/site/AGENTS.md`); the field-key vocabulary is in the element sidecar section. **Coordination note:** #83 also adds a key to `RawParam`/`element.Param` and touches `AGENTS.md` — expect a small rebase if both are in flight simultaneously.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/deckle#81
No description provided.