design: undo banner pattern for reversible actions#189
Open
dumbdevss wants to merge 1 commit into
Open
Conversation
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>
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[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 acountdown 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 pendingsummary. Responsive (w-full max-w-md,truncating message).
useUndoBanners— owns the reversible-window timing via a single shared ticker;exposes
registerUndo/undo/dismisswithonUndoandonCommitcallbacks (the documented action contract).
useReducedMotion— swaps the animated ring for a static seconds count underprefers-reduced-motion.Accessibility (WCAG 2.1 AA)
role="status",aria-live="polite").aria-hiddencountdown; labelled controls with visible focus rings.jest-axeasserts 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
jest-axeas a devDependency for the accessibility assertion.