From 9935c3dc6eadc17b0bbef39d307c448638173929 Mon Sep 17 00:00:00 2001 From: chinesepowered <22500229+chinesepowered@users.noreply.github.com> Date: Sun, 19 Jul 2026 21:46:45 -0700 Subject: [PATCH] a11y: give icon-only chrome buttons accessible names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dock, the sidebar/grid close buttons, and the annotation toolbar are all icon-only. Their labels came only from `data-tip`, which is a CSS hover tooltip ([data-tip]::after { content: attr(data-tip) }) and is not exposed to assistive tech — so screen readers announced them as an unlabeled "button". Add aria-label to each, plus aria-pressed on the toggle buttons (sidebar, grid, annotate, and the tool/color/size selectors) so their on/off state is conveyed too. No visual or behavioral change. --- src/deck/Annotator.tsx | 18 +++++++++++++++++- src/deck/Deck.tsx | 12 ++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/deck/Annotator.tsx b/src/deck/Annotator.tsx index c37e1e3..2ffe348 100644 --- a/src/deck/Annotator.tsx +++ b/src/deck/Annotator.tsx @@ -55,7 +55,15 @@ const TOOLS: { id: Tool; label: string; path: string }[] = [ }, ]; const COLORS = ['var(--primary)', '#ffffff', '#ef4444', '#f5b73a', '#4aa8ff']; +const COLOR_LABELS: Record = { + 'var(--primary)': 'Accent', + '#ffffff': 'White', + '#ef4444': 'Red', + '#f5b73a': 'Amber', + '#4aa8ff': 'Blue', +}; const SIZES = [3, 6, 11]; +const SIZE_LABELS = ['Small stroke', 'Medium stroke', 'Large stroke']; const IconUndo = () => ( setTool(t.id)} > setColor(c)} style={{ background: c }} /> ))} - {SIZES.map((s) => ( + {SIZES.map((s, i) => (