feat: sidecar create-flag for the List create dialog + conditional post-create properties hand-off #85

Merged
dominik.polakovics merged 1 commit from afk/81 into main 2026-07-18 00:38:06 +02:00

Page-type sidecar fields gain a per-field `create: true` flag that pulls an optional field into the List module's create dialog; after a create whose dialog could not show every field, the editor opens the new page's properties view so the author can finish.

Engine (internal/element, shared with page-types)

  • `RawParam` accepts `create:` (pointer, absent ≠ false); `Param` carries `Create bool` (`json:"create,omitempty"`) with a doc comment mirroring `ItemDisplay`'s (client-only, inert for element params).
  • `create:` on a required field is a load error either value — required fields always appear in the dialog, there is no opt-out — following the required+hidden `itemDisplay` rejection precedent, with an actionable message.
  • Page-type sidecars get this for free via the shared `element.ParseParams`; a pagetype test proves the wiring.

Editor (web)

  • `CreateDialog`'s field filter is now `(required || create) && !title`, preserving sidecar order; `SchemaParam` gains `create?: boolean`.
  • `onCreated` now receives the created `PageId` + chosen type. When the type has fields the dialog did not show, the module refetches the tree and navigates to the new page with `?props=1` — wrapped in `followMutation` so route repair doesn't prune the not-yet-in-tree URL (same mutation-follow pattern as TreePane's rename/move). Otherwise behavior is unchanged: close dialog, refetch, stay in the list.
  • The tree's phantom-row create path is untouched.

Bundle + docs

  • `news-item.yaml`: `teaser` and `image` flagged `create: true`; `author` deliberately not, so a fresh news item lands in properties (intended per the issue).
  • `scaffold/site/AGENTS.md`: the page-type section documents the flag (example line + bullet, including the post-create behavior).

Tests

  • Go: rejection cases (create true/false on required), optional-field parsing (absent/true/false), pagetype wiring — `go test ./...` green (21 pkgs).
  • Web: dialog field selection with load-bearing sidecar-order interleaving; navigation to the props view asserting the strongest observable (PageSettings mounted for the new page, `props=1`, tree refetched); stay-in-list when the dialog showed everything — 778 tests / 38 files green, `vite build` clean.

Closes #81

🤖 Generated with Claude Code

Page-type sidecar fields gain a per-field \`create: true\` flag that pulls an **optional** field into the List module's create dialog; after a create whose dialog could not show every field, the editor opens the new page's properties view so the author can finish. ## Engine (internal/element, shared with page-types) - \`RawParam\` accepts \`create:\` (pointer, absent ≠ false); \`Param\` carries \`Create bool\` (\`json:"create,omitempty"\`) with a doc comment mirroring \`ItemDisplay\`'s (client-only, inert for element params). - \`create:\` on a **required** field is a load error either value — required fields always appear in the dialog, there is no opt-out — following the required+hidden \`itemDisplay\` rejection precedent, with an actionable message. - Page-type sidecars get this for free via the shared \`element.ParseParams\`; a pagetype test proves the wiring. ## Editor (web) - \`CreateDialog\`'s field filter is now \`(required || create) && !title\`, preserving sidecar order; \`SchemaParam\` gains \`create?: boolean\`. - \`onCreated\` now receives the created \`PageId\` + chosen type. When the type has fields the dialog did not show, the module refetches the tree and navigates to the new page with \`?props=1\` — wrapped in \`followMutation\` so route repair doesn't prune the not-yet-in-tree URL (same mutation-follow pattern as TreePane's rename/move). Otherwise behavior is unchanged: close dialog, refetch, stay in the list. - The tree's phantom-row create path is untouched. ## Bundle + docs - \`news-item.yaml\`: \`teaser\` and \`image\` flagged \`create: true\`; \`author\` deliberately not, so a fresh news item lands in properties (intended per the issue). - \`scaffold/site/AGENTS.md\`: the page-type section documents the flag (example line + bullet, including the post-create behavior). ## Tests - Go: rejection cases (create true/false on required), optional-field parsing (absent/true/false), pagetype wiring — \`go test ./...\` green (21 pkgs). - Web: dialog field selection with load-bearing sidecar-order interleaving; navigation to the props view asserting the strongest observable (PageSettings mounted for the new page, \`props=1\`, tree refetched); stay-in-list when the dialog showed everything — 778 tests / 38 files green, \`vite build\` clean. Closes #81 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Page-type sidecar fields (and element params — shared vocabulary) accept a
per-field `create: true` flag. The List module's create dialog now shows
Title + required fields + create-flagged optionals, in sidecar order.
Required fields always appear and cannot opt out: a `create:` key on a
required field is a load error, following the required+hidden itemDisplay
precedent.

After a List-module create, when the chosen type has fields the dialog did
not show, the editor navigates to the new page with the properties view
open (`?props=1`) — wrapped in followMutation so route repair does not
prune the URL before the refetched tree carries the new page. When the
dialog gathered everything, behavior is unchanged: close, refetch, stay in
the list. The tree's phantom-row create path is untouched.

The news bundle flags `teaser` and `image` with `create: true`; `author`
deliberately stays out so a fresh news item opens in page properties.
scaffold/site/AGENTS.md documents the flag in the page-type section.

Closes #81

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
Owner

This was generated by AI while landing a PR.

Landing audit — PR #85

Verdict: PASS

Verification signal relied on: Forgejo Actions CI ci / build-and-testsuccess (run #73, 5m26s). Not re-run.

Checks performed:

  • Convention lint: title feat: … is Conventional Commits.
  • AFK contract: head afk/81, body carries working Closes #81.
  • Mergeability: branch already contains the main tip — no conflict.
  • Diff review vs. issue #81 intent:
    • Engine: create: *bool added to shared RawParam/element.Param; rejected on required fields (either value) mirroring the itemDisplay precedent — matches the triage addendum's pointer correction (internal/element/load.go, not pagetype/schema.go).
    • Editor: dialog filter now (required || create) && !title in sidecar order; onCreated opens ?props=1 iff hasHiddenFields (exact complement of the filter), wrapped in followMutation — same mutation-follow pattern as TreePane rename/move. createPage returns PageId (path+lang), consumed correctly.
    • TreePane phantom-row create path untouched.
    • Bundle: news-item.yaml flags teaser+image create: true, author left out (lands in properties) — per issue.
    • Docs: scaffold/site/AGENTS.md page-type section documents the flag + post-create behavior.
  • Tests: Go rejection/parse/pagetype-wiring cases; web dialog-selection + conditional-navigation + stay-in-list. CI green.

No blockers. Awaiting free-text merge confirmation.

> *This was generated by AI while landing a PR.* ## Landing audit — PR #85 **Verdict: PASS** **Verification signal relied on:** Forgejo Actions CI `ci / build-and-test` — **success** (run #73, 5m26s). Not re-run. **Checks performed:** - **Convention lint:** title `feat: …` is Conventional Commits. ✅ - **AFK contract:** head `afk/81`, body carries working `Closes #81`. ✅ - **Mergeability:** branch already contains the `main` tip — no conflict. ✅ - **Diff review vs. issue #81 intent:** - Engine: `create: *bool` added to shared `RawParam`/`element.Param`; rejected on required fields (either value) mirroring the `itemDisplay` precedent — matches the triage addendum's pointer correction (`internal/element/load.go`, not `pagetype/schema.go`). ✅ - Editor: dialog filter now `(required || create) && !title` in sidecar order; `onCreated` opens `?props=1` iff `hasHiddenFields` (exact complement of the filter), wrapped in `followMutation` — same mutation-follow pattern as TreePane rename/move. `createPage` returns `PageId` (`path`+`lang`), consumed correctly. ✅ - TreePane phantom-row create path untouched. ✅ - Bundle: `news-item.yaml` flags `teaser`+`image` `create: true`, `author` left out (lands in properties) — per issue. ✅ - Docs: `scaffold/site/AGENTS.md` page-type section documents the flag + post-create behavior. ✅ - **Tests:** Go rejection/parse/pagetype-wiring cases; web dialog-selection + conditional-navigation + stay-in-list. CI green. No blockers. Awaiting free-text merge confirmation.
Sign in to join this conversation.
No reviewers
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!85
No description provided.