Skip to content

design: undo banner pattern for reversible actions#189

Open
dumbdevss wants to merge 1 commit into
RevoraOrg:masterfrom
dumbdevss:uiux/undo-banner-pattern
Open

design: undo banner pattern for reversible actions#189
dumbdevss wants to merge 1 commit into
RevoraOrg:masterfrom
dumbdevss:uiux/undo-banner-pattern

Conversation

@dumbdevss

Copy link
Copy Markdown

[UI/UX] Undo banner pattern for reversible destructive actions

Closes #162

What

An accessible Undo banner pattern for reversible destructive actions (delete
draft, remove from blacklist, archive offering).

Components

  • UndoBanner — a stack of banners pinned above the page footer, each with a
    countdown ring to permanence, a primary Undo CTA, and a dismiss control
    that commits immediately. Newest on top; banners beyond maxVisible (default 3)
    collapse into a +N more pending summary. Responsive (w-full max-w-md,
    truncating message).
  • useUndoBanners — owns the reversible-window timing via a single shared ticker;
    exposes registerUndo / undo / dismiss with onUndo and onCommit
    callbacks (the documented action contract).
  • useReducedMotion — swaps the animated ring for a static seconds count under
    prefers-reduced-motion.

Accessibility (WCAG 2.1 AA)

  • Polite live region (role="status", aria-live="polite").
  • Decorative aria-hidden countdown; labelled controls with visible focus rings.
  • Reduced-motion fallback; jest-axe asserts no violations.

Tests

  • UndoBanner.test.tsx (10) + useUndoBanners.test.tsx (5) — 15 passed,
    lint clean.

Docs

docs/uiux/undo-banner-pattern.md — anatomy, engineer action contract,
stacking/placement, responsive, and accessibility/axe notes.

Notes

  • Added jest-axe as a devDependency for the accessibility assertion.

Add an accessible Undo banner pattern for reversible destructive actions
(delete draft, remove from blacklist, archive offering):

- UndoBanner component: a stack of banners pinned above the page footer
  with a countdown ring to permanence, a primary Undo CTA, and a dismiss
  control that commits immediately. Newest on top; banners beyond
  maxVisible collapse into a '+N more' summary.
- useUndoBanners hook: owns the reversible-window timing, exposing
  registerUndo/undo/dismiss with onUndo and onCommit callbacks.
- useReducedMotion hook: swaps the animated ring for a static seconds
  count under prefers-reduced-motion.

Accessibility (WCAG 2.1 AA): polite live region, decorative aria-hidden
countdown, labelled controls with visible focus rings, jest-axe assertion
of no violations. Documented in docs/uiux/undo-banner-pattern.md with the
engineer action contract, stacking/placement, responsive, and a11y notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@dumbdevss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI/UX Design] Design an Undo banner pattern for reversible destructive actions

1 participant