A form declaration can hold settings its layout family never reads #185

Open
opened 2026-10-06 21:25:23 +00:00 by cgalo5758 · 0 comments
Owner

forms.FormSpec and forms.Binding are flat structs, so either can carry settings only one family uses: Wide (bar), Columns (table), CommitAction, RowCommit and field placement (rows), MessageAfter (preview), and on the binding Body, Staged, Rows, Tray (rows, in two modes). A declaration also names its family, which its kind decides. About a dozen rules in internal/forms/invariants.go refuse wrong combinations, checkRowsBinding and checkRowCommitBinding panic on first render, and family == X branches spread over Render, renderFieldAs, boxFor and CommitClasses.

Done when: the family is derived from the kind; each family's settings live in a value only that family carries; one check that the value matches the kind replaces the per-setting rules and panics; and the form-library spec says how a declaration gives them.

`forms.FormSpec` and `forms.Binding` are flat structs, so either can carry settings only one family uses: `Wide` (bar), `Columns` (table), `CommitAction`, `RowCommit` and field placement (rows), `MessageAfter` (preview), and on the binding `Body`, `Staged`, `Rows`, `Tray` (rows, in two modes). A declaration also names its family, which its kind decides. About a dozen rules in `internal/forms/invariants.go` refuse wrong combinations, `checkRowsBinding` and `checkRowCommitBinding` panic on first render, and `family == X` branches spread over `Render`, `renderFieldAs`, `boxFor` and `CommitClasses`. Done when: the family is derived from the kind; each family's settings live in a value only that family carries; one check that the value matches the kind replaces the per-setting rules and panics; and the form-library spec says how a declaration gives them.
cgalo5758 added the
kind
design
area/operator-ui
labels 2026-10-06 21:25:23 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#185