Undo and redo actions are available for message edits
Why it matters
One mis-click on a delete button that wipes a forty-message research conversation is the kind of moment that ends a subscription. Destructive actions without undo treat every user gesture as final, which is wrong for a surface where the data is valuable, the buttons are dense, and mobile accidental taps are routine. A simple 5-second undo toast costs almost nothing to build and prevents the single worst user experience your product can produce.
Severity rationale
Medium because the loss is recoverable only if you have backups, and most chat apps do not expose them.
Remediation
Wrap every destructive action in an optimistic state update plus a toast with an "Undo" action and a 5-second duration. Keep the deleted record in memory during the window and re-insert at its original index on undo. For heavier flows (bulk clear), move to a two-step confirm dialog. Implement in src/lib/hooks/use-undoable-delete.ts.
toast('Message deleted', { action: { label: 'Undo', onClick: () => restore(deleted) }, duration: 5000 })
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the AI UX Patterns Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-ux-patterns·automated