计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
ux【效率与协作】Forms, destructive actions and flows users get wrong. Use when "users keep deleting the wrong thing", "add a confirmation dialog", "this flow is error-prone", or building a delete, bulk action, checkout or settings page. Covers undo over confirmation, type-to-confirm, safe defaults, input constraints, double-submit. For the server-side rules behind t…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Shingo built jigs so an assembly worker could not seat a part backwards. A form is a jig. The same ladder applies, and the design literature arrived at the same place independently, Don Norman's forcing functions and Nielsen's error prevention heuristic describe the same move from a different tradition.
The single reframing that does most of the work here: an error message is a failure of the design, not a feature of it. If your interface can tell the user they did something wrong, it usually could have stopped them doing it. Validation that fires after submission is rung 3. An input that cannot hold the wrong value is rung 1.
Most of the time this mode is reached while someone is building the thing, not afterwards. That changes the deliverable. They asked for the interface, so produce the interface, working, complete, in their stack. Do not hand back a severity table when the person is mid-feature; a list of findings about code they have not written yet is not useful to them.
Then add a short closing note, three or four lines, covering:
That closing note is what stops the device being undone in six months by someone who cannot see why it is there. It is also the difference between mistake-proofing and a code generator: the reasoning travels with the code.
When the code already exists and they are asking what is wrong with it, switch to the audit voice, ranked findings with the mistake, the consequence, and the device. Match the mode to where they are in the work, not to this file's default.
| Rung | In a UI | Example |
|---|---|---|
| 1 Control | The wrong action cannot be taken | Date picker that excludes unavailable dates · quantity capped at stock · Submit that does not exist until the form is valid · destructive action absent for users without permission |
| 2 Warning | Possible, but flagged at the moment it happens | Inline field validation on blur · a live character counter turning red · a banner warning that this will affect 4,312 users |
| 3 Detection | Caught after submission | Error summary at the top of the page · server rejects it · support ticket |
| 0 | Relies on reading | Helper text · tooltips · a warning in a modal that everyone dismisses |
A confirmation dialog a user sees fifty times a day stops being a decision point. They develop click-through blindness and press "Confirm" with the same reflex they press "OK", which means the dialog protects nobody while adding friction to every legitimate action. It is the interface equivalent of a comment saying "be careful": present, visible, and inert.
The preference order for destructive actions, strongest first:
A dialog that names the exact object and the exact count is doing fixed-value inspection. A dialog that says "This action cannot be undone" is doing nothing.
Same ritual as API design, different failure modes. Before laying out a screen, ask:
Constrain the input rather than validate it. A picker instead of a text field, a stepper
instead of a number input, a mask that only accepts a valid shape, inputmode and type so
mobile keyboards offer the right keys, max/min that the control actually enforces. Every
value the field cannot hold is a validation rule you never have to write and a user who never
sees an error.
Disable the action until it can succeed, but always show why. A greyed-out Submit with
no explanation is its own dead end; pair it with the specific unmet requirement. Pick between
the two shapes deliberately: native disabled, which takes the button out of the tab order,
so the reason has to live in adjacent text a screen reader will reach anyway; or
aria-disabled with the handler refusing the submit, which keeps the button focusable so the
reason is announced on the control itself.
Validate at the right moment. On blur for the field just left, never on every keystroke while someone is still typing, validating a half-typed email as invalid trains people to ignore your validation. Re-validate on submit, and put focus on the first offending field.
Preserve the user's work. Losing entered data to a validation error, a session timeout, or a back button is one of the most common and most infuriating mistakes an interface permits. Draft autosave, restore-on-return, and never clear a form on a failed submit.
Make defaults safe rather than convenient. The preselected option should be the one whose consequences are smallest if chosen inattentively, least-privilege, narrowest scope, private rather than public, opt-in rather than opt-out. Many users never change a default, so a default is a decision you are making for most of your users.
Prevent double submission structurally. Disable the control on submit and carry an idempotency key on the request, because the button is not the only path, refresh, back, and a flaky network all retry. The UI device and the API device are the same hazard (M2 in the hazard catalog) seen from two sides.
Show scale before a bulk action. "This will email 12,400 people" is fixed-value inspection and it stops the mistake that a confirmation dialog does not.
Read the actual component code, forms, buttons, modals, mutation handlers: not just screenshots. What to look for, in priority order:
Report using the same structure as audit: mistake, consequence, current rung,
proposed device and rung. Propose before editing.
Friction is a cost paid by every user on every legitimate use, and the mistake is made rarely. Confirmations on reversible actions, validation on optional fields, and are-you-sure dialogs on ordinary saves make an interface exhausting without preventing anything, and they train users to dismiss the dialogs that matter. Aim devices at what is irreversible and consequential; let everything else be fast, and make it undoable instead.
The pattern reference at ../../references/ux-patterns.md has the concrete
forms of each device and the standard destructive-action patterns. The hazard catalog at
../../references/hazard-catalog.md still applies to the code behind the
screen: a mistake-proof form in front of a non-idempotent endpoint is only half a device.