diff --git a/rules/patterns/modal-workflows/README.md b/rules/patterns/modal-workflows/README.md new file mode 100644 index 0000000..c5aa652 --- /dev/null +++ b/rules/patterns/modal-workflows/README.md @@ -0,0 +1,23 @@ +# Shared modal example + +A shared component owns the header layout, close and backdrop behavior, busy +state and navigation control placement. Each dialog provides only its title, +body, available actions and optional wizard steps. The left and right navigation +icons use the same icon family and have accessible labels. + +```html + + + + + +``` + +The shared shell places close and navigation on the left and centers the title. +The footer action is text only. A dialog without wizard steps omits navigation; +its content and actions remain specific to that dialog. diff --git a/rules/patterns/modal-workflows/contract.md b/rules/patterns/modal-workflows/contract.md index 21cdca3..ef4391c 100644 --- a/rules/patterns/modal-workflows/contract.md +++ b/rules/patterns/modal-workflows/contract.md @@ -1,6 +1,6 @@ # Contract: Modal Workflows -Version: 1.3 +Version: 1.4 ## State Machine @@ -20,6 +20,15 @@ closed → open → submitting → success | error ## Rules +- Use one shared modal shell and behavior for every modal. Individual dialogs + supply their title, content and actions; they do not reimplement shell layout, + dismissal, busy handling or wizard navigation controls. +- Place the close control at the left of the header, as in macOS, and center + the title in the modal. Place wizard back and next controls beside the close + control, using a matching left/right icon pair. Keep primary and other header + actions accessible without overlapping the title, including on narrow screens. +- Modal footers contain no icon buttons. Where an action belongs in the footer, + use a text-labelled button that states the action. Do not hide required actions. - Destructive actions (delete, archive, bulk remove) require a separate confirmation modal — not just a disabled button. Confirmation modal must name the target: "Delete component ABC-123?" - Never close a modal automatically on error — keep it open so the user can retry or copy the error. diff --git a/rules/patterns/web-visual-baseline/contract.md b/rules/patterns/web-visual-baseline/contract.md index 9d0e1ee..917a9b2 100644 --- a/rules/patterns/web-visual-baseline/contract.md +++ b/rules/patterns/web-visual-baseline/contract.md @@ -78,6 +78,8 @@ Copy `assets/view.css` as the starting stylesheet and adapt tokens; do not rewri `title` and `aria-label`; do not put a text label next to the icon. Items of a popup menu (`role="menuitem"`) keep their text, because the menu has no other way to tell them apart. +- Modal footer actions use text labels without icons; modal header controls + follow the shared `modal-workflows` contract. - One icon means one action across the whole interface. Restore, refresh, restart, connection test and similar actions each get their own distinct icon; never reuse one icon for a different action. Keep the action-to-icon table in