Editor: form screen with General · Appearance · Access tabs, validation at rest, one unsaved-changes guard #172
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle#172
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?
Parent
#168 — the editing screens overhaul, Direction A (page module). Mockup and decision log:
docs/mockups/editing-screens/(README item 8; indist/deckle-page-module.htmlclick any card), merged in #169.Summary
Rebuild the element edit screen and the page properties screen as one
FormScreen = Docheader + ElementForm | PageForm: TYPO3's tab set General · Appearance · Access, validation visible at rest, one unsaved-changes guard behind every way out, Save / Save & close / Close / Preview in the docheader, ⌘S. The sameFieldGroupandFieldwidgets serve both forms and, later, the feature modules' entry editor.Current behavior
/edit/<lang>/<page>/<uid>rendersEditPane.tsx: Close / Save / "Save & Close", the element icon and label, "Saved", and the server-described form (POST /api/form,web/src/api/forms.ts, widgets inweb/src/widgets/) capped at 820px, with no tabs; fields are checked when they lose focus (#164) and row messages move with their row; number fields keep what the user types.PageSettings.tsxbehind?props=1(the page-module issue turns that into a docheader tab pointing at the same component).guard.ts,UnsavedChangesDialog) is wired per navigation site; wording differs ("Save & Close" vs "Save & close"); ✎ ⋮ × are text glyphs next to lucide icons.Desired behavior
Everything below is shown in the mockup; where this text and the mockup differ, the mockup wins.
Docheader of an element form: row 1 left: × Close, Save (primary), Save & close, | Preview; right: Enable/Disable, Duplicate, ⋯ (Cut, Copy, Move up/down, Delete…, from the shared
Menu). Row 2: crumbs Home / Services / Main (the last crumb is the slot the element lives in), the element's icon, label,#uid, and a status: "Saved just now" or an Unsaved changes badge as soon as any field changes. Preview opens the View module with the element highlighted and scrolled into view.Form: tabs General · Appearance · Access, sticky under the docheader, max width ~880px, left-aligned.
FieldGroup"Content", then oneFieldGroupper items collection (title = the collection label, hint "N of up to M" if a limit exists).#uid, hint "Link to this element with #uid.").tab: general | appearance(default general).scaffold/site/AGENTS.mddocuments it; the scaffold assignsside,cols,lightbox,variant-style params to appearance.web/src/widgets/); layout isFieldGroup→Field(label, required marker, control, hint or error).Validation at rest: the required/format checks the server already runs on focus-lost are also shown for the loaded state: a field with a problem shows its message; a collapsed item row shows a chip naming the missing fields ("Alternative text missing"); a tab containing a problem carries a red dot. Save stays available; the server's save response decides (today's contract).
Unsaved-changes guard: one
leaveForm()path used by Close, Esc, the Content/Properties tabs, the tree, the module menu, the host navigation and browser navigation, showingUnsavedChangesDialogwith Stay / Discard changes / Save & continue. ⌘/Ctrl+S saves. Esc closes the form only when no menu, dialog or notes layer is open (the #140 rule).Page properties use the same screen: docheader Close / Save / Save & close with the Content/Properties tabs; form tabs General (title, description, menu title, …: the page type's fields), Appearance (backend layout, layout for subpages, and page-type fields marked
tab: appearance), Access (Enabled, the page type's navigation flags such ashidden, read-only path).Wording: "Save & close" everywhere; icons from lucide only.
Decisions
Key interfaces
FormDescription/FormField(web/src/api/forms.ts, server side ininternal/element/form.goand the properties/create description) — the tab marker per field; the Enabled field from the first issue lands on Access.internal/element/schema.go— the paramtabkey;scaffold/site/AGENTS.md;internal/element/agentsdoc_test.go.web/src/components/EditPane.tsx,PageSettings.tsx,FormPane.tsx(legacy) →FormScreen,ElementForm,PageForm,FieldGroup,Field, usingDocheader,Tabs,Badge,Menufrom the page-module issue.guard.ts(GuardStore,DirtySource,unguarded),UnsavedChangesDialog,leave.ts,returnnav.ts— the singleleaveForm().bridge.ts/PreviewPane— Preview opens the View module at the element (the highlight message exists; the scroll-to may not).EntryEditor.tsx(feature modules) — its Properties tab should be able to adoptPageFormlater; do not rebuild it here, but do not make that impossible.Acceptance criteria
tab: appearancerenders on Appearance; others on General; Enabled and Anchor on Access; AGENTS.md documentstaband the drift test passes.FormPane.tsxand its only test are gone.How to verify
make test; tests for tab assignment, validation-at-rest rendering, the guard covering each exit, and the Esc layer rule.make runontestdata/site: open Text & media on a page, compare with the mockup form (General, Appearance, Access), break a required item field, switch tabs, try every exit with unsaved changes.Assumptions to check
POST /api/formreports problems for the loaded state or onlyPOST /api/form/checkper field; if only the latter, the screen runs the checks on load.bridge.ts,previewmap.ts) or only highlight.FormDescriptiongroups fields (first issue) in a way that maps to tabs, or the tab marker must be added here.useBeforeLeave,leave.ts) already exists for some routes; confirm which exits are uncovered today rather than assuming.Out of scope
EntryEditorand the create dialog (they may adopt the components later).Blocked by