UX Error Prevention And Recovery established

Redo

Maintain a redo stack after undo, expose Redo only when a valid undone operation exists, replay the latest undone operation against the same target, and clear or branch that stack when new edits invalidate the future history.

Decision first

Choose this pattern when the problem matches

Use when

  • Users perform reversible sequences of edits and can undo too far.
  • The product can replay an undone operation accurately against the same target.
  • A visible command state can show when redo is available, unavailable, cleared, or invalid.

Avoid when

  • The system cannot reliably store or replay the undone operation.
  • The action has irreversible external side effects.
  • Users need long-lived recovery across sessions, trash, revisions, or drafts rather than immediate stack replay.
  • A new edit has already created a divergent history and there is no branch UI.

Problem it prevents

Users can undo too far, change their mind after an undo, or need to reapply a reversible edit without reconstructing the work manually.

Pattern anatomy

What a strong implementation has to make clear

User need

The product supports reversible editing, ordering, formatting, drawing, document, layout, or configuration actions.

Pattern promise

Maintain a redo stack after undo, expose Redo only when a valid undone operation exists, replay the latest undone operation against the same target, and clear or branch that stack when new edits invalidate the future history.

Required state

No-redo state before any undo has happened.

Recovery path

Redo button looks available but does nothing because no redo stack exists.

Access contract

Expose Redo as a named button, menu item, or command row when editing commands are visible.

Quality bar

The difference between expert and weak execution

Strong implementation

Specific, visible, recoverable

  • A document toolbar shows Undo and Redo; Redo is disabled until the user undoes Move Summary before Risk.
  • After an undo, the history panel lists Redo available: Move Summary before Risk and clears that row when the user makes a new edit.
  • A user moves a heading, chooses Undo, sees Redo move heading become available, and redoes the same move against the same document outline.
  • A user undoes a move, types a new note, and sees the redo stack cleared because the edit history has branched.
Weak implementation

Vague, hidden, hard to recover from

  • A Redo button remains enabled after the user types new content, with no indication that the old future branch is gone.
  • Redo is available only through a keyboard shortcut and gives no visible disabled, unavailable, or target-specific state.
  • A user undoes a move, selects a different heading, presses Redo, and the product applies the old operation to the wrong target.
  • A user returns after reload and the interface still implies redo is available even though the in-memory edit stack is gone.
UI guidance
  • Show Redo as a visible command, menu item, toolbar control, or command-palette row whose enabled state matches the current redo stack.
  • Name the operation or target when possible, such as Redo move heading, and show a disabled or unavailable state when no undone operation can be reapplied.
UX guidance
  • Use redo to let users recover from undoing too far without recreating work by hand.
  • Treat redo as a valid future branch only until the user makes a new edit or the original target can no longer be replayed reliably.
Implementation contract

What the implementation must handle

States

  • No-redo state before any undo has happened.
  • Undo-available state after a reversible edit.
  • Redo-available state after the user undoes an operation.
  • Redone state after the latest undone operation is reapplied.

Interaction

  • Redo is unavailable until an undo places an operation on the redo stack.
  • Activating Redo replays the most recent undone operation and returns that operation to the undo stack.
  • The command label, tooltip, menu item, status row, or history panel identifies the operation when ambiguity is possible.
  • A new edit after undo clears redo or creates an explicit branch that users can see and choose.

Accessibility

  • Expose Redo as a named button, menu item, or command row when editing commands are visible.
  • Use disabled states and accessible descriptions so assistive technology users know when no redo is available.
  • Announce redone, unavailable, cleared, and target-invalid outcomes through a status region.
  • Do not rely only on icon direction, color, or keyboard shortcut memory.

Review

  • What operation enters the redo stack when the user undoes this action?
  • What exact event clears redo, and how does the interface tell users that the branch changed?
  • Can Redo identify the original target if selection, ordering, permissions, or collaboration state changed?
  • Do visible controls and keyboard shortcuts expose the same availability?
Interactive lab

Inspect the states before you copy the pattern

Reapply an undone edit

Undo and redo a document change, then branch with a new edit and compare stale, hidden, wrong-target, and shortcut-only redo failures.

Redo
Interactive demo is ready

Launch the live UI/UX lab when you want to inspect states, keyboard behavior, and common failure modes.

State To Inspect

No-redo state before any undo has happened.

Keyboard / Access

Common platform shortcuts may invoke redo when focus is in an editor context and redo is available.

Avoid Generating

Leaving redo enabled after a new edit invalidates the undone future.

Evidence trail

Source-backed claims behind this guidance

Full agent/debug reference

Problem Context

  • The product supports reversible editing, ordering, formatting, drawing, document, layout, or configuration actions.
  • Users can issue repeated undo commands and may need to recover from undoing one step too many.
  • The system can store enough operation and target state to replay the undone action accurately.
  • New edits after undo create a divergent state unless the product has an explicit branching history model.

Selection Rules

  • Choose redo when the user has just undone a reversible operation and may need to reapply it.
  • Expose redo next to undo in editor toolbars, menus, command palettes, or keyboard help when editing workflows are central.
  • Disable or hide redo when no undone operation exists, but keep the availability discoverable in command-rich desktop-style products.
  • Clear the redo stack when the user makes a new edit after undo unless the product provides explicit branch history.
  • Replay the latest undone action in last-in-first-out order and preserve target identity, ordering, selection, and scope.
  • Use a history panel, revision history, restore from trash, or draft state when users need long-lived recovery across sessions rather than immediate redo.
  • Do not offer redo for operations whose external effects, permissions, payments, emails, or webhooks cannot be safely replayed or recalled.
  • Do not make keyboard shortcuts the only redo path in interfaces that also support mouse, touch, or assistive technology workflows.

Required States

  • No-redo state before any undo has happened.
  • Undo-available state after a reversible edit.
  • Redo-available state after the user undoes an operation.
  • Redone state after the latest undone operation is reapplied.
  • Branch-cleared state after a new edit while redo was available.
  • Multi-step redo state where repeated Redo replays the redo stack in order.
  • Target-invalid state when the original object, selection, or collaborator context can no longer accept replay.

Interaction Contract

  • Redo is unavailable until an undo places an operation on the redo stack.
  • Activating Redo replays the most recent undone operation and returns that operation to the undo stack.
  • The command label, tooltip, menu item, status row, or history panel identifies the operation when ambiguity is possible.
  • A new edit after undo clears redo or creates an explicit branch that users can see and choose.
  • Keyboard shortcuts, toolbar controls, menus, and command palette entries reflect the same enabled or disabled state.
  • If the original target is deleted, locked, changed by another user, or otherwise invalid, Redo explains why replay is unavailable.
  • Redo does not silently repeat unrelated commands or destructive external effects.

Implementation Checklist

  • Represent undo and redo as separate stacks or equivalent operation history with target identity and scope.
  • Push operations from undo to redo only after a successful undo, and push them back to undo after successful redo.
  • Clear redo on new edits unless the product intentionally supports visible history branches.
  • Keep visible controls, menu labels, command palette rows, shortcut help, and disabled states synchronized with the stack.
  • Store enough object, ordering, selection, and collaborator context to reject stale redo rather than applying it to the wrong target.
  • Announce redo availability, redone outcomes, cleared branch state, and invalid replay states in a status region.
  • Test repeated undo and redo, target deletion, route changes, collaboration updates, keyboard shortcuts, and disabled states.

Common Generated-UI Mistakes

  • Leaving redo enabled after a new edit invalidates the undone future.
  • Applying redo to the current selection instead of the original operation target.
  • Treating redo as persistent restore or version rollback without showing durable history.
  • Hiding redo behind a shortcut with no visible command state.
  • Using Redo to mean repeat last command even when users expect reapply undone change.
  • Offering redo for external side effects that cannot be safely replayed.

Critique Questions

  • What operation enters the redo stack when the user undoes this action?
  • What exact event clears redo, and how does the interface tell users that the branch changed?
  • Can Redo identify the original target if selection, ordering, permissions, or collaboration state changed?
  • Do visible controls and keyboard shortcuts expose the same availability?
  • Does Redo reapply an undone action, or is it actually repeat last command, restore from trash, or version rollback?
Accessibility
  • Expose Redo as a named button, menu item, or command row when editing commands are visible.
  • Use disabled states and accessible descriptions so assistive technology users know when no redo is available.
  • Announce redone, unavailable, cleared, and target-invalid outcomes through a status region.
  • Do not rely only on icon direction, color, or keyboard shortcut memory.
  • Make shortcut help reflect platform conventions and any product-specific alternative shortcuts.
Keyboard Behavior
  • Common platform shortcuts may invoke redo when focus is in an editor context and redo is available.
  • Keyboard shortcut activation follows the same redo stack as toolbar, menu, and command-palette activation.
  • Disabled redo shortcuts should not trigger unrelated repeat or destructive commands.
  • Focus remains in the editing context after successful redo unless a target-invalid message needs attention.
  • After a new edit clears redo, shortcut help or command state must no longer imply the old operation is available.
Variants
  • Single-step redo
  • Multi-step redo
  • Toolbar redo
  • Menu redo
  • Command palette redo
  • Keyboard shortcut redo
  • Redo with operation label
  • Branch-cleared redo
  • Invalid target redo

Verification

Last verified: