docs/mockups · overnight options · Q8

One confirm flash for everything that lands — class, hook, or leave it?

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.

Palette Appearance
Artefact — the pixels, as they would ship Commentary — why, cost, what can go wrong

The question, as found at HEAD

The flash exists, works, and is written out by hand wherever it is needed. What the inventory found (7 Nov 2026):

#SiteMechanism todayNote
1atoms/badge.css 272–283@keyframes badge-accept-flash 0% → 100% brightness 1.35 → 1, 0.4 s ease-out; .badge-accept-flashUnguarded for Reduce Motion (design-motion §5.3); literal duration
2QuoteGroup.tsx 241useState<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.
3QuoteCard.tsx 94, 834prop 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
4TagSidebar.tsx 307, 538–549a second useState<Set> + 500 ms timer for the sidebar rowFourth copy of the block
5TagGroupCard.tsx 45 → TagRow.tsx 31, 107prop flashing?: boolean → badge-accept-flashTagRow.test.tsx:104 pins the class name
6FocusContext.tsx 95–99, 420–437registerFlashTag / unregisterFlashTag / flashTag: a per-quote handler registryThe cross-component channel (sidebar → card). Not the flash itself
7quoteCardHost.tsx 70, 255NO_FLASH = new Set() sentinel for lenses that never flashDiscussion, Signals, Sessions cards
8atoms/badge.css 302–311 badge-bulk-flash0.8 s box-shadow ringNo React consumer. Only the frozen theme/js/tags.js:328 applies it. Dead in the SPA; the CSS doesn’t say so
9WelcomeIllustrations.swift 1875its own inline copy, 0.52 sThe Welcome cell’s tempo-scaled variant; a third duration for the same cue
10WelcomeTimelineCSS.swiftgenerated copy of the themeRegenerated 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.

The flash, live

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.

Quotes · one card, and its tag in the sidebar
Todaybadge-accept-flash · Set + 500 ms timer
12:04Description stands in for a participant’s words: the checkout step the participant could not find.
P3 · Session 3
FrustrationTrust
Emotion
Frustration12
Confusion8
class on element
animation plays
0250500750 ms
group renders this gesture: 0
B · proposed.bn-confirm-flash · useConfirmFlash()
12:04Description stands in for a participant’s words: the checkout step the participant could not find.
P3 · Session 3
FrustrationTrust
Emotion
Frustration12
Confusion8
class on element
animation plays
0250500750 ms
group renders this gesture: 0
Commentary

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.

The options

A A CSS class only

sibling: atoms/arrival.css (tokens + from-only keyframe)
Code shape
/* 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"
Consequences
  • S build — 2 CSS files, 2 string renames, 1 test string, regenerate WelcomeTimelineCSS.swift. A tests/test_confirm_css.py in the shape of test_arrival_css.py (from-only keyframe, no literal duration).
  • Safe rename: badge-accept-flash has no consumer in the frozen vanilla JS (checked: only badge-bulk-flash does), so no alias is needed.
  • Leaves the four hand-written Set/timer blocks and the 400/500 drift exactly where they are. The next acknowledgement site (star toggle, copy-to-clipboard, a Signals card) copies the block a fifth time.
  • Rules out nothing; B is this plus a hook.

B Class plus hook

siblings: A, and useLensRead.ts (HANDOVER_MS kept equal to the CSS) for the hook’s shape
Code shape
// 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}
Consequences
  • M build — A, plus one hook with its own test, four writer blocks collapsed, the 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.
  • Fixes the drift (one constant, pinned), the swallowed second press (nonce restart), and the leaked timers on unmount (today none are cleared).
  • Test surface: jsdom runs no animations, so the hook test pins the Map and the timer with fake timers; the restart is proven once in Playwright. Four QuoteCard tests that pass flashingTags={new Set()} change only if the prop shape does.
  • Rules out: nothing. Converting later to a DOM-mark implementation changes the hook’s body, not its callers.

C Fold into Q7’s motion tokens

sibling: Q7 option B (--bn-motion-enter / -exit / -confirm)
Code shape
/* 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
Consequences
  • M+ build — B’s work, but it cannot land until Q7’s vocabulary is decided and built; if Q7 chooses restraint (its recommendation), C has no home and becomes B with a different token prefix.
  • Naming: --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.
  • Rules out: tuning the confirm cue independently of enter/exit without a token split later.

D Leave it as it is

sibling: none needed
Code shape
/* 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.
Consequences
  • 0 build — a paragraph in the motion doc.
  • Keeps: four copies of the block; 400 vs 500 vs 520 ms; a swallowed second keypress; uncleared timers; badge-bulk-flash unlabelled as frozen-only.
  • Consistent with “beta ≈ no new features”, but this row is a refactor of a shipped cue, not a feature; the trust tag on the row is about the cue being reliable.
  • Rules out nothing; it is deferral.

Call-site migration list

FileTodayABTests touched
theme/atoms/badge.css 272–283badge-accept-flash keyframe + classmoved to atoms/confirm.css, tokenisedas Anew tests/test_confirm_css.py (shape of test_arrival_css.py); theme concatenation order in theme_assets.py
theme/atoms/badge.css 302–311badge-bulk-flash, SPA-deadcomment: frozen static render onlyas A—
theme/tokens.css—--bn-confirm-duration/-easing/-peakas ACSS test pins no literal in the atom
frontend/src/islands/QuoteGroup.tsx 239–241, 481–500, 601–610, 658–666Set state, three writer blocks, 500 msunchangeduseConfirmFlash(); three confirm.flash(key)QuoteGroupBulkActions.test.tsx (fake timers at 500 → CONFIRM_MS)
frontend/src/islands/QuoteCard.tsx 94–95, 834flashingTags: Set → classclass stringnonce 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–549second Set state + timerunchangeduseConfirmFlash(); confirm.flash(tagName)—
frontend/src/components/TagGroupCard.tsx 45, 138 → TagRow.tsx 31, 107flashing boolean → classclass stringas A (boolean stays; restart via key in TagGroupCard)TagRow.test.tsx:104 string
frontend/src/contexts/FocusContext.tsx 95–99, 420–437flash-tag registryunchangedunchanged (the channel)—
frontend/src/islands/quoteCardHost.tsx 70, 255NO_FLASH sentinelunchangedunchanged, or undefined if the prop goes optional—
frontend/src/hooks/useConfirmFlash.ts——new, with CONFIRM_MSnew useConfirmFlash.test.ts; the equality pin in test_confirm_css.py reads the TS constant
desktop/…/WelcomeTimelineCSS.swiftgeneratedregenerateregeneratetests/test_welcome_timeline.py fails if stale
desktop/…/WelcomeIllustrations.swift 1875own 0.52 s copyleave: 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, §5K2/K3 rows name the old classestrue the rowsas A—

Comparison

QuestionA · classB · class + hookC · in Q7’s tokensD · leave
Files4 + 1 generated8 + 1 generatedB, after Q71 doc
Fixes the 400 / 500 ms driftNoOne constant, pinnedAs BNo
Second press restarts the flashNoNonce remountAs BNo
Copies of the timer block4004
Next acknowledgement site costsa class + a copied blockone hook callone hook calla copied block
Reduce Motionkept (colour), documented as arrival isas Aas Aunguarded, undocumented
Depends on another decisionNoNoQ7 option BNo
RiskA rename with no vanilla consumerprop-shape change ripples to four test files unless the Set is keptnaming scheme splitfifth copy, third duration

Recommendation: B, done in two commits, with the Set kept as the prop

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.