Work and recovery

Help people save changes, fix an error and pick up where they left off.

Review and correct a form

Keep entered values after an error. Link each message to the field that needs attention.

Implementation guide for review and correct a form

When to use it

Use a form when related inputs contribute to one result. Keep simple edits inline when context helps; choose a full page for long, complex or shareable work. Use a short modal only when the task fits and returning to its parent is useful. A review step is appropriate for a consequential commitment, not every trivial preference.

States and recovery

Pristine, editing, locally invalid, server-invalid, submitting, successful and failed. Required requirements appear before submission. Validate at a useful moment; do not show a wall of errors on initial load or move focus on each keystroke. Retain allowed values after failure; distinguish a field problem from service failure. Correcting one field must not erase others. Review reflects the actual values that will be committed, including derived price/scope where applicable.

Keyboard and screen readers

Use native form controls, visible labels and fieldset/legend for related choices. Associate hints/errors and aria-invalid. If replacing native validation with novalidate, implement the full summary/field/focus/recovery contract. Focus the error summary after failed submit; each summary link targets its corresponding enabled field. Keep error text specific and actionable. Success that leaves focus in place uses one persistent status.

Layout and preferences

Use a readable single-column form where possible; label placement follows reading order. Textareas, help, summaries and review values grow naturally. Test long names, RTL values, 320px, short screens, actual zoom and virtual keyboard. Preserve the shared select reservation and viewport-centred modal, including from a scrolled parent. Colour and an icon alone cannot identify errors.

Implementation

Reuse .ex-form, .ex-field, .ex-error-summary, validateFields and focusFormField; choose native validation unless replacement is justified. Example: Common asks for a collection name, identifies a missing value, allows correction and reviews a destructive sharing change only when consequential. Product validators define domain rules and server error mapping; core required/length checks cannot establish business correctness.

Data and permissions

Server validation repeats relevant constraints and authorises the operation. Never return raw stack traces or database details to a field. Sanitize/render text safely and allow only intended fields to be changed. Sensitive values may require deliberate clearing even while nonsensitive work is retained; explain that exception. Do not collect optional information merely because the layout has space.

Checks to run

  • Submit multiple errors, follow each summary link and correct them without losing input.
  • Server-only rejection maps to the right field or useful form error.
  • Review can be corrected; displayed scope matches the committed snapshot.
  • Test Enter submission, disabled/readonly/native choices and long error messages in both themes. Not verified; edition 0.2.0-rc.2.

Save and retry

Show when a save is pending. After a connection drops, check whether the change went through before offering a retry.

Implementation guide for save and retry

When to use it

Use explicit Save for a coherent commitment; autosave suits frequent low-risk edits when its timing and status are clear. Avoid autosaving actions that carry major external consequences. Optimistic updates are appropriate only when rollback or reconciliation is reliable; a loading state may be safer for uncertain results.

States and recovery

Edited → saving → acknowledged saved, rejected, conflict or outcome unknown. A timeout may occur after the server committed; “not saved” is then an unsupported claim. Provide “Check status” or a safely repeatable request. Concurrent edits need version/conflict handling: show the current saved version and preserve the user's draft; do not silently overwrite. Autosave reports unsaved work and settles stale responses by version, not arrival order.

Keyboard and screen readers

Keep the initiating action focusable while busy, expose busy/unavailable state and guard activation. Keep focus during ordinary save; announce saved/failure/uncertainty once. Do not repeatedly announce every autosave keystroke. A conflict review can focus its heading after the user opens it; avoid an unexpected modal on background updates. Stable pending/result labels must preserve the actual accessible name.

Layout and preferences

Reserve known asynchronous labels/messages through natural sizing, including long and subsequently shortened names; fixed-height status boxes are unsuitable. Keep a visible unsaved state when controls wrap. Do not use only a tiny colour dot, spinner or disappearing toast. Reduced motion retains the text state.

Implementation

The existing lifecycle can call a product adapter:

// Integration outline, not a supplied service or executable example.
const controller = createFormSubmission({
  submit: (snapshot, {signal}) => productSave(snapshot, {signal}),
  onState: state => productRenderSaveState(state),
});
// Validate and capture one deliberate snapshot before controller.run(snapshot).
// On unmount: controller.dispose().

productSave and productRenderSaveState do not exist in this package. The adopter maps conflict/unknown outcomes, provides a stable logical operation ID where needed, checks authoritative saved state and guards against stale UI updates. Duplicate prevention within one mounted form is not server idempotency.

Data and permissions

Verify actor/resource permissions, CSRF protection where applicable and the expected record version. Bind a safe-retry key to the actor and operation/payload; define retention and handling of a repeated key with different input. Do not embed personal information in the key. Define cancellation separately from rollback and make service logs safe.

Checks to run

  • Double-click, press Enter repeatedly, refresh after timeout and retry; one intended logical change results.
  • Simulate response loss after commit and recover authoritative status without a duplicate.
  • Edit in two clients and resolve conflict without silent loss.
  • Pending→success/failure→retry and long→short values do not cause avoidable delayed jumps. All service/geometry cases unexecuted for this pattern; edition 0.2.0-rc.2.

Remove and undo

For a reversible change, keep Undo within reach. Before permanent removal, name the item and explain the consequence.

Implementation guide for remove and undo

When to use it

Prefer reversible removal with a persistent recovery route for common low-risk actions. Use deliberate review for irreversible or substantial consequences. “Archive”, “Remove from this list” and “Delete permanently” describe different effects. Do not train users to dismiss identical confirmations for every action. For financial/legal/data commitments, provide the applicable checking, review/correction or reversal safeguard. W3C error-prevention guidance.

States and recovery

Proposed → confirmed/removed → undo available or processing → restored/completed/failed/unknown. State what undo restores, for how long and whether external effects can be reversed. Avoid an essential undo available only in a rapidly disappearing toast; provide Trash/history or another persistent route when appropriate. An expired undo offers an honest alternative, not a dead action.

Keyboard and screen readers

Name the affected object and scope in the confirmation and final button. A real modal has a heading, explicit safe exit, logical initial focus and focus return. After removing the focused object, focus the next suitable control or a useful surviving heading/add action; never leave focus on a detached node. Announce the outcome and restoration once. If a menu opened the dialog, use its surviving trigger as the return target until removal makes another destination necessary.

Layout and preferences

Keep consequences readable before the destructive action at 320px/short views; long names wrap. Avoid sticky footers obscuring review text or error feedback. Destructive styling uses text and structure as well as the danger colour. Do not require precise pointer placement or a timed gesture to undo.

Implementation

Use createMenu for an optional object action, openDialog for appropriate review and .ex-button--danger for commitment. Example: Common archives “Travel” and offers “Restore Travel”; permanent deletion separately states that its links will also be deleted. These are alternative proposed behaviours, not storage implementations. The pinned RC includes focusAfterChipRemoval in core/removable-chips.js. Retain the removed index among all group controls, call after the renderer commits, and provide a logical fallback. It restores usable focus only; the product still removes/announces/restores items. This is RC implementation, not canonical release or acceptance of a new deletion workflow.

Data and permissions

Recheck permission at execution, not only when opening the dialog. Bind confirmation to the actual resource/version and refresh review if scope changes. The service owns atomic effects, duplicate handling, undo authorization and retention. A client modal cannot make a destructive endpoint safe; typed confirmation text is not authentication.

Checks to run

  • Cancel from every precommit route makes no change; stale scope requires a fresh review.
  • Remove first/middle/last/only focused item, then undo, with useful visible focus.
  • Double commit and timeout cannot repeat deletion or falsely report restoration.
  • Denied/expired undo retains an explanation and persistent recovery/contact route if available. Not verified; edition 0.2.0-rc.2.

Work through an interruption

Keep available results on screen when part of a request fails. Tell people what is missing and which part they can retry.

Implementation guide for work through an interruption

When to use it

Provide recovery for the actual failure domain. A network-dependent tool may offer a useful disconnected state without claiming full offline support. Add offline queues only if conflict, privacy, permission expiry and replay behaviour have been designed. A static document can use a simple unavailable page; it does not need a background job system.

States and recovery

Loading, slow/stalled, offline or unreachable, partial, stale, forbidden, missing, rate-limited and service-unavailable are distinct. Successful suboperations remain identified; retry only failed work when safe. A connectivity signal is a hint, not proof the service works. Keep allowed drafts; give a next action and explain whether data is current. Do not endlessly spin or erase usable content because a secondary request failed.

Keyboard and screen readers

Use a meaningful page heading for a full-page failure and a local status for a failed subsection. A retry button says what it retries. Keep focus when background connectivity changes; avoid unsolicited redirects. A progress bar is determinate only when progress is measured. Announce meaningful completion/failure, not every increment. Mark the affected region busy while keeping its status outside it.

Layout and preferences

Recovery controls remain in normal flow and reachable without a hover tooltip. Long diagnostic references wrap; do not expose technical dumps. Placeholder geometry follows actual expected content and reduced motion. On short mobile views, the useful existing content and retry remain reachable without overlay collisions.

Implementation

Combine native headings/paragraphs, existing status/button styles and ordinary links. Example: “We couldn’t refresh this collection. Showing the last loaded version.” with “Try again” is truthful only if that version is actually retained. Core does not supply a network queue, error boundary, cache, progress controller or HTTP router. The adopter defines retry eligibility, cancellation, cache freshness and partial-success reconciliation.

Data and permissions

Hosted missing resources return real 404 responses; forbidden/unauthenticated routes follow the chosen non-leaking access policy (including concealment where appropriate). Missing assets must not fall back to a private app shell. Keep private responses out of public caches and return safe errors without internal identifiers that disclose other users. An offline queue must reauthorise on replay; revocation does not disappear while disconnected.

Checks to run

  • Disconnect before/during/after a write and distinguish failure from unknown outcome.
  • Fail one item in a batch; retry preserves successful items and the draft.
  • Direct missing page/asset, signed-out and forbidden requests have correct policy/status and no private body.
  • Retry after permission expiry cannot replay a privileged operation.
  • Navigate away during a slow response; it cannot overwrite the new view. Not verified; edition 0.2.0-rc.2.