mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 14:40:52 +00:00
fix(a11y): keyboard-reachable admin log rows, range-bar marker, heatmap cells
Admin app-log rows opened their JSON detail dialog through a click-only <tr> with no keyboard path; the Action cell now wraps a real <button> that carries the same handler plus a descriptive aria-label, leaving the row onClick as a pointer convenience. The target range-bar's current-value marker showed value + band only in a hover-only tooltip on a non-focusable div. It is now focusable (tabIndex, role=img) with an aria-label that reuses the same value / range / delta copy the tooltip already renders, so focus opens the tooltip and a screen reader gets the text alternative either way. Mood and medication-compliance heatmap day cells were pointer-only SVG rects. Each cell is now focusable with its own per-day aria-label (reusing the existing tooltip copy), and Escape dismisses any open tooltip — pinned (touch) or focus-shown. Reference: 2026-07-17 a11y audit, H1 + M1 + M2.
This commit is contained in:
1 parent
247bc4f33c
commit
4c436d7dfc
15 files changed
+243
-27
No files matched your search
@@ -161,7 +161,13 @@ describe("<MetricTargetSummary>", () => {
|
||||
// redundant "Target: 60.1–80.9 kg" string above it.
|
||||
expect(html).toContain('data-slot="tile-header"');
|
||||
expect(html).toContain("Target");
|
||||
expect(html).not.toContain("Target: 60.1–80.9 kg");
|
||||
// 2026-07-17 a11y audit (M1) — the range-bar marker now carries an
|
||||
// `aria-label` that reuses this same string as a text alternative
|
||||
// (screen-reader only, not a rendered heading) — strip attribute
|
||||
// values before asserting no redundant VISIBLE "Target: …" text node
|
||||
// exists above the bar.
|
||||
const visibleText = html.replace(/aria-label="[^"]*"/g, "");
|
||||
expect(visibleText).not.toContain("Target: 60.1–80.9 kg");
|
||||
// The min / max endpoints surface as the range-bar axis labels.
|
||||
expect(html).toContain("60.1 kg");
|
||||
expect(html).toContain("80.9 kg");
|
||||
|
||||
Reference in new issue
Block a user