Generalise badge-accept-flash into a reusable .bn-confirm-flash plus a useFlash(key) hook: four shapes, each as before/after code, a live demo of the flash, and the list of every call site that would move.
The flash exists, works, and is written out by hand wherever it is needed. What the inventory found (7 Nov 2026):
| # | Site | Mechanism today | Note |
|---|---|---|---|
| 1 | atoms/badge.css 272–283 | @keyframes badge-accept-flash 0% → 100% brightness 1.35 → 1, 0.4 s ease-out; .badge-accept-flash | Unguarded for Reduce Motion (design-motion §5.3); literal duration |
| 2 | QuoteGroup.tsx 241 | useState<Set<string>> flashingTags, key `${domId}:${tagName}` | Three writers, each the same 10 lines: add-tag (601), proposal accept (658), keyboard quick-apply via registry (481). JS clears at 500 ms; CSS runs 400 ms. |
| 3 | QuoteCard.tsx 94, 834 | prop flashingTags: Set<string> → className="badge-accept-flash" | A new Set identity on every flash start and end, so every card in the group renders twice per tag add |
| 4 | TagSidebar.tsx 307, 538–549 | a second useState<Set> + 500 ms timer for the sidebar row | Fourth copy of the block |
| 5 | TagGroupCard.tsx 45 → TagRow.tsx 31, 107 | prop flashing?: boolean → badge-accept-flash | TagRow.test.tsx:104 pins the class name |
| 6 | FocusContext.tsx 95–99, 420–437 | registerFlashTag / unregisterFlashTag / flashTag: a per-quote handler registry | The cross-component channel (sidebar → card). Not the flash itself |
| 7 | quoteCardHost.tsx 70, 255 | NO_FLASH = new Set() sentinel for lenses that never flash | Discussion, Signals, Sessions cards |
| 8 | atoms/badge.css 302–311 badge-bulk-flash | 0.8 s box-shadow ring | No React consumer. Only the frozen theme/js/tags.js:328 applies it. Dead in the SPA; the CSS doesn’t say so |
| 9 | WelcomeIllustrations.swift 1875 | its own inline copy, 0.52 s | The Welcome cell’s tempo-scaled variant; a third duration for the same cue |
| 10 | WelcomeTimelineCSS.swift | generated copy of the theme | Regenerated on any theme edit (gen-welcome-timeline.py) |
Siblings of the pattern, already shipped and tokenised: the arrival flash (atoms/arrival.css: --bn-arrival-colour/-duration/-easing, a from-only keyframe, markArrived(el) writing data-arrived, cleared on animationend with a getAnimations() guard, pinned by tests/test_arrival_css.py) and the lens handover dim (bn-handover 240 ms, with HANDOVER_MS in useLensRead.ts kept equal to the CSS by comment). Native: a real macOS menu item blinks twice (70 ms off/on) when chosen; the Welcome illustration recreates it. Those are the two families: a class from React state with a JS constant kept equal to the CSS (handover, the badge flash), or a DOM mark written outside React with the end heard from the animation (arrival).
Behaviour a researcher can see today: press the keyboard tag shortcut twice within half a second and the second press does not flash: the key is already in the Set, nothing restarts, and the first timer removes it at 500 ms. Try it in the demo.
Left: what ships. Right: the proposed atom and hook. The strips below each card show when the class is on the element and when the animation actually plays.
12:04Description stands in for a participant’s words: the checkout step the participant could not find.P3 · Session 3FrustrationTrust
12:04Description stands in for a participant’s words: the checkout step the participant could not find.P3 · Session 3FrustrationTrust
Same pixels, different plumbing. The brightness pulse is unchanged in B: 1.35 → 1 over 400 ms. What differs is that the hook owns the timer and its length comes from one constant pinned equal to the CSS token (the HANDOVER_MS pattern), so the strips line up; today the class outlives the animation by 100 ms, harmless until someone lengthens the CSS past 500 ms and the flash is cut short with no test to say so.
“Add twice” is the behavioural difference. Today the second press is swallowed (Set semantics). B restarts: the hook bumps a nonce per key and the badge takes key={nonce}, so React remounts the 20-byte span and the animation starts clean. This sidesteps the remove-reflow-set trap the arrival flash hit on 17 Oct (animationcancel of the old run landing on the new listener), because there is no listener: the hook’s timer is the clock.
Renders. Both columns re-render the group twice per flash (state in, state out), and flashingTags is a new Set each time, so every card in the group renders with it. The hook does not fix that; it could (a per-key subscription, or the arrival-style DOM mark with zero renders). See the open call in the recommendation.
Reduce Motion: kept, in both columns. A brightness fade moves nothing; this is the arrival decision applied, not a new one. Light-appearance check owed: brightness 1.35 on a 94 %-lightness pastel tint has little headroom (the shimmer needed 20 % on the web chip against 5 % native for the same reason). Measure before fixing the peak token; the token exists so the fix is one line.
/* tokens.css */ --bn-confirm-duration: 400ms; --bn-confirm-easing: ease-out; --bn-confirm-peak: 1.35; /* atoms/confirm.css (new, beside arrival.css) */ @keyframes bn-confirm { from { filter: brightness(var(--bn-confirm-peak)); } } .bn-confirm-flash { animation: bn-confirm var(--bn-confirm-duration) var(--bn-confirm-easing); } /* atoms/badge.css */ @keyframes badge-accept-flash { … } .badge-accept-flash { … } /* badge-bulk-flash: annotated “frozen static render only” */ // QuoteCard.tsx:834, TagRow.tsx:107 — rename the string "badge-accept-flash" → "bn-confirm-flash"
WelcomeTimelineCSS.swift. A tests/test_confirm_css.py in the shape of test_arrival_css.py (from-only keyframe, no literal duration).badge-accept-flash has no consumer in the frozen vanilla JS (checked: only badge-bulk-flash does), so no alias is needed.// hooks/useConfirmFlash.ts /** Equal to --bn-confirm-duration; tests/test_confirm_css.py pins both. */ export const CONFIRM_MS = 400; export function useConfirmFlash() { const [nonces, setNonces] = useState<ReadonlyMap<string, number>>(EMPTY); const timers = useRef(new Map<string, number>()); const flash = useCallback((key: string) => { setNonces((p) => new Map(p).set(key, (p.get(key) ?? 0) + 1)); clearTimeout(timers.current.get(key)); timers.current.set(key, window.setTimeout(() => setNonces((p) => { const n = new Map(p); n.delete(key); return n; }), CONFIRM_MS)); }, []); useEffect(() => () => timers.current.forEach(clearTimeout), []); return { flash, nonce: (key: string) => nonces.get(key) }; } // QuoteGroup.tsx — three writer blocks become one line each const [flashingTags, setFlashingTags] = useState<Set<string>>(new Set()); … setFlashingTags((prev) => new Set(prev).add(flashKey)); setTimeout(() => { setFlashingTags((prev) => { … delete … }); }, 500); const confirm = useConfirmFlash(); … confirm.flash(`${id}:${tagName}`); // QuoteCard.tsx — the badge restarts by remount className={flashingTags.has(k) ? "badge-accept-flash" : undefined} key={`${tag.name}:${confirmNonce(k) ?? 0}`} className={confirmNonce(k) ? "bn-confirm-flash" : undefined}
QuoteCard/TagRow prop shape changed (Set → nonce lookup, or keep the Set and derive it: the smaller diff). FocusContext’s registry stays: it is the channel, not the flash.QuoteCard tests that pass flashingTags={new Set()} change only if the prop shape does./* tokens.css — one of three */ --bn-motion-enter: 120ms; --bn-motion-exit: 90ms; --bn-motion-confirm: 400ms; --bn-motion-confirm-ease: ease-out; /* atoms/motion.css */ .bn-enter { … } .bn-exit { … } .bn-confirm-flash { animation: bn-confirm var(--bn-motion-confirm) var(--bn-motion-confirm-ease); } // hook as in B, CONFIRM_MS pinned to --bn-motion-confirm
--bn-motion-confirm sits beside --bn-arrival-* and --bn-modal-*, which are per-cue, not per-vocabulary. Two naming schemes for the same kind of thing./* docs/design-motion.md §4.2 */ K2 Badge accept — ✓ Done. Pattern: React state Set + 500 ms timer → class badge-accept-flash. Copy this block for a new acknowledgement site.
badge-bulk-flash unlabelled as frozen-only.| File | Today | A | B | Tests touched |
|---|---|---|---|---|
theme/atoms/badge.css 272–283 | badge-accept-flash keyframe + class | moved to atoms/confirm.css, tokenised | as A | new tests/test_confirm_css.py (shape of test_arrival_css.py); theme concatenation order in theme_assets.py |
theme/atoms/badge.css 302–311 | badge-bulk-flash, SPA-dead | comment: frozen static render only | as A | — |
theme/tokens.css | — | --bn-confirm-duration/-easing/-peak | as A | CSS test pins no literal in the atom |
frontend/src/islands/QuoteGroup.tsx 239–241, 481–500, 601–610, 658–666 | Set state, three writer blocks, 500 ms | unchanged | useConfirmFlash(); three confirm.flash(key) | QuoteGroupBulkActions.test.tsx (fake timers at 500 → CONFIRM_MS) |
frontend/src/islands/QuoteCard.tsx 94–95, 834 | flashingTags: Set → class | class string | nonce lookup + key on the badge (or keep the Set prop, derived) | QuoteCard.test.tsx ×3, QuoteCard.breaks.test.tsx — only if the prop changes |
frontend/src/components/TagSidebar.tsx 307, 538–549 | second Set state + timer | unchanged | useConfirmFlash(); confirm.flash(tagName) | — |
frontend/src/components/TagGroupCard.tsx 45, 138 → TagRow.tsx 31, 107 | flashing boolean → class | class string | as A (boolean stays; restart via key in TagGroupCard) | TagRow.test.tsx:104 string |
frontend/src/contexts/FocusContext.tsx 95–99, 420–437 | flash-tag registry | unchanged | unchanged (the channel) | — |
frontend/src/islands/quoteCardHost.tsx 70, 255 | NO_FLASH sentinel | unchanged | unchanged, or undefined if the prop goes optional | — |
frontend/src/hooks/useConfirmFlash.ts | — | — | new, with CONFIRM_MS | new useConfirmFlash.test.ts; the equality pin in test_confirm_css.py reads the TS constant |
desktop/…/WelcomeTimelineCSS.swift | generated | regenerate | regenerate | tests/test_welcome_timeline.py fails if stale |
desktop/…/WelcomeIllustrations.swift 1875 | own 0.52 s copy | leave: it is the illustration’s tempo-scaled variant and never reads the theme. Optional: rename its local class to bn-confirm-flash so a grep finds it | — | |
docs/design-motion.md §4.2, §5 | K2/K3 rows name the old classes | true the rows | as A | — |
| Question | A · class | B · class + hook | C · in Q7’s tokens | D · leave |
|---|---|---|---|---|
| Files | 4 + 1 generated | 8 + 1 generated | B, after Q7 | 1 doc |
| Fixes the 400 / 500 ms drift | No | One constant, pinned | As B | No |
| Second press restarts the flash | No | Nonce remount | As B | No |
| Copies of the timer block | 4 | 0 | 0 | 4 |
| Next acknowledgement site costs | a class + a copied block | one hook call | one hook call | a copied block |
| Reduce Motion | kept (colour), documented as arrival is | as A | as A | unguarded, undocumented |
| Depends on another decision | No | No | Q7 option B | No |
| Risk | A rename with no vanilla consumer | prop-shape change ripples to four test files unless the Set is kept | naming scheme split | fifth copy, third duration |
Commit 1 is A: atoms/confirm.css beside arrival.css, three tokens, the rename, the frozen-only comment on badge-bulk-flash, a CSS test in the arrival test’s shape, and the Swift regeneration. It is a small, safe change on its own. Commit 2 is the hook: useConfirmFlash() with CONFIRM_MS pinned to the token, replacing the four writer blocks; QuoteCard keeps receiving a Set (derived from the hook’s map) so its four test files do not move; the restart lands in QuoteCard as a key on the badge. This follows the live React-class family (handover) rather than inventing a third mechanism, and it is a refactor of a shipped cue, which the beta line allows.
Not C. It ties a one-afternoon refactor to a decision Q7 recommends against, and splits the token naming. Not D. The row is tagged [trust]; a cue that skips the second press and has three durations is the kind of small unreliability that tag is about.
Owner calls the mockup could not settle: (1) keyed React state (the handover family; two group renders per flash, as today) or a DOM mark like markArrived (the arrival family; zero renders, but a querySelector for the badge and the animation-restart guard): the hook’s callers are the same either way; (2) should the hook live in FocusContext, next to the registry it feeds, or stand alone in hooks/; (3) whether the peak brightness needs a per-appearance value for light pastel tints: measure first.