From 8370b2d1077373283a05b5beb62a1a63e8ed4b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 9 May 2026 20:50:52 +0200 Subject: [PATCH] fix(mobile): bump chart controls + medication primary buttons + mood list icons to 44px MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase A5 / B-mobile HIGH cluster — closes 4 audit findings: 1. Chart range buttons (`7 pts | 30 pts | 90 pts | All`) on every chart card were `h-7 px-2 text-xs` (28px tall), below the WCAG 2.5.5 / Apple HIG / Material 44px minimum. Bumped to `min-h-9 px-2.5` (36px) — that's still compact enough to fit in the chart header strip on a 393px viewport but raises tap-target pass rate substantially. Files: health-chart, mood-chart, medication-compliance-chart, compliance-line-chart, compliance-charts. 2. Chart toggle switches (`7d avg`, `Trend`, `Target ranges`) inside the dashboard charts used `scale-75` to shrink the Switch primitive to ~12px tall — sub-32px hit target. Dropped the `scale-75` so each Switch returns to its default size. Files: health-chart, mood-chart. 3. Medication card primary actions ("Taken" / "Skipped"): these are the most-tapped controls in HealthLog (every dose intake is one tap). Were `size="sm"` (32px). Bumped to default size + explicit `min-h-11`. The history + edit icon-buttons on the same card go from `h-8 w-8` (32px) to `min-h-11 min-w-11` (44px). Glyph stays 16px so the visual weight doesn't change. 4. Mood-list mobile rows: the per-row Edit + Delete icon buttons were `h-8 w-8` (32px). Bumped to `min-h-11 min-w-11` on the mobile card branch only — the desktop table keeps its denser `h-8 w-8` since mouse pointers don't need 44px. `DeleteButton` gains a `mobile` prop so the existing desktop callsite is unchanged. Findings IDs: - A5/HIGH `/` (Dashboard) — chart range buttons - A5/MEDIUM `/` (Dashboard) — chart switch toggles - A5/HIGH `/medications` — Taken/Skipped sizing - A5/HIGH `/mood` — list edit/delete sizing - A5/MEDIUM `/medications` — history + edit icon buttons Verification: 823 / 823 unit tests pass, lint clean (12 pre-existing warnings unchanged), typecheck regression-free. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/charts/compliance-charts.tsx | 6 ++-- .../charts/compliance-line-chart.tsx | 2 +- src/components/charts/health-chart.tsx | 5 +-- .../charts/medication-compliance-chart.tsx | 2 +- src/components/charts/mood-chart.tsx | 15 ++++----- .../medications/medication-card.tsx | 31 ++++++++++++------- src/components/mood/mood-list.tsx | 26 +++++++++++++--- 7 files changed, 52 insertions(+), 35 deletions(-) diff --git a/src/components/charts/compliance-charts.tsx b/src/components/charts/compliance-charts.tsx index 80dca7bc2..9f7255afa 100644 --- a/src/components/charts/compliance-charts.tsx +++ b/src/components/charts/compliance-charts.tsx @@ -103,7 +103,7 @@ export function ComplianceCharts({ medications }: ComplianceChartsProps) { type="button" variant={rangePoints === 30 ? "default" : "ghost"} size="sm" - className="h-7 px-2 text-xs" + className="min-h-9 px-2.5 text-xs" onClick={() => setRangePoints(30)} title={t("charts.points30Title")} > @@ -113,7 +113,7 @@ export function ComplianceCharts({ medications }: ComplianceChartsProps) { type="button" variant={rangePoints === 90 ? "default" : "ghost"} size="sm" - className="h-7 px-2 text-xs" + className="min-h-9 px-2.5 text-xs" onClick={() => setRangePoints(90)} title={t("charts.points90Title")} > @@ -123,7 +123,7 @@ export function ComplianceCharts({ medications }: ComplianceChartsProps) { type="button" variant={rangePoints === 0 ? "default" : "ghost"} size="sm" - className="h-7 px-2 text-xs" + className="min-h-9 px-2.5 text-xs" onClick={() => setRangePoints(0)} title={t("charts.pointsAllTitle")} > diff --git a/src/components/charts/compliance-line-chart.tsx b/src/components/charts/compliance-line-chart.tsx index dab17aaa7..e9863de84 100644 --- a/src/components/charts/compliance-line-chart.tsx +++ b/src/components/charts/compliance-line-chart.tsx @@ -73,7 +73,7 @@ export function ComplianceLineChart({ key={r.label} variant={activeRangePoints === r.points ? "default" : "ghost"} size="sm" - className="h-7 px-2 text-xs" + className="min-h-9 px-2.5 text-xs" onClick={() => setActiveRangePoints(r.points)} title={r.title} > diff --git a/src/components/charts/health-chart.tsx b/src/components/charts/health-chart.tsx index 7709d3d60..e6346a949 100644 --- a/src/components/charts/health-chart.tsx +++ b/src/components/charts/health-chart.tsx @@ -622,7 +622,7 @@ export function HealthChart({ key={r.labelKey} variant={rangePoints === r.points ? "default" : "ghost"} size="sm" - className="h-7 px-2 text-xs" + className="min-h-9 px-2.5 text-xs" onClick={() => setRangePoints(r.points)} title={t(r.titleKey)} > @@ -638,7 +638,6 @@ export function HealthChart({ id={maToggleId} checked={showMA} onCheckedChange={setShowMA} - className="scale-75" />