Document stock visual decisions and operational UI examples

This commit is contained in:
mchus committed 2026-10-03 09:15:31 +03:00
1 parent 714447aa06
commit 08ff987edb
14 files changed
+532 -7

No files matched your search

+20 -1
View File
@@ -1,6 +1,6 @@
# Contract: Modal Workflows
Version: 1.3
Version: 1.4
## State Machine
@@ -37,6 +37,25 @@ closed → open → submitting → success | error
move the dialog only, and reaching the dialog's end must not chain to the page. Reserve the
scrollbar gutter so locking the page does not shift the layout under the backdrop.
## Explicit Save and Unsaved Changes
- Edit modals persist only on the labeled Save action. Field changes, autofill, child additions,
removals and state toggles remain draft state; no hidden writes on `change` or `blur`.
- Visually mark staged toggles (for example a dashed outline) and explain that Save applies
them. Do not present a draft state as already persisted.
- Track dirty state against a snapshot taken after initial asynchronous loading. Include state
outside inputs, such as pending deletions and toggle maps. Reset the snapshot only after
loading or successful save, never after an unrelated rerender of the edited content.
- Route Escape, backdrop and close buttons through one shared close guard. For dirty forms,
show an in-page choice: Continue editing / Close without saving. Escape on that confirmation
keeps the edits; Escape elsewhere acts on only the topmost modal.
- While submitting, block closing as well as double submission. On failure retain entered
values and show the error inline. If saving requires multiple requests, remember applied
operations so retry does not duplicate them; do not imply that partial success was rolled back.
- Removing a draft child may be staged without an immediate confirmation. Before committing
destructive deletion of persisted data, the separate confirmation required above must still
name the affected records and any cascade. A Save label alone is not that confirmation.
## Validation
Validation UX follows the `forms-validation` contract (server-side on submit, inline field