From 1b8f03af869fdea4dcedf1aacd93531a0c2a155f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 15 May 2026 18:02:15 +0200 Subject: [PATCH] docs(planning): mobile audit report for the coach surface --- .planning/research/v1427-r3c-mobile-coach.md | 196 +++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 .planning/research/v1427-r3c-mobile-coach.md diff --git a/.planning/research/v1427-r3c-mobile-coach.md b/.planning/research/v1427-r3c-mobile-coach.md new file mode 100644 index 000000000..8458b3f95 --- /dev/null +++ b/.planning/research/v1427-r3c-mobile-coach.md @@ -0,0 +1,196 @@ +--- +file: .planning/research/v1427-r3c-mobile-coach.md +purpose: Mobile capability audit — Coach panel and sub-components +created: 2026-05-15 +auditor: MA3 +--- + +# Mobile audit — Coach panel surface + +## Summary + +Reviewed 9 components under `src/components/insights/coach-panel/` (drawer +shell, drawer-body, composer, message thread, settings sheet, history rail, +sources rail, source chips, use-coach hook) plus the four launch surfaces +that feed the drawer (`hero-strip.tsx`, `suggested-prompts.tsx`, +`health-score-card.tsx`, `target-coach-button.tsx`). + +17 findings: 1 Critical, 5 High, 8 Medium, 3 Low. The drawer's structural +choices are sound for mobile (full-width Sheet, `100dvh`, rail-tray +chevrons, persistent thread disclaimer, `max-w-[80%]` bubbles, `aria-live` +on the streaming bubble). The mobile hostility lives in three clusters: +(a) the Coach is unreachable from any insight sub-page (`/insights/blutdruck` +and siblings never mount the drawer), (b) several controls sit below the +44 pt touch-target minimum (window pill, thumbs feedback, history-rail +delete, settings-sheet default close X, info-icon hint), and (c) two +hover-only affordances (history-rail delete `opacity-0 group-hover:opacity-100`, +Radix Tooltip without a tap toggle) silently degrade on touch. + +## Findings + +### F1 — Coach drawer not mounted on insight sub-pages +- Severity: Critical +- Axis: logic +- File: `src/app/insights/blutdruck/page.tsx`, `gewicht/page.tsx`, `puls/page.tsx`, `stimmung/page.tsx`, `medikamente/page.tsx`, `bmi/page.tsx`, `schlaf/page.tsx` (none import `CoachDrawer`); only `src/app/insights/page.tsx:221` and `src/app/targets/page.tsx:285` mount it. +- Symptom: From any insights sub-page a user has no path to the Coach. The CTA Marc designed into the hero strip (B1 retirement of the HSC button moved the affordance to the action row) only exists on `/insights` itself, and the seven sub-pages render their own status-card surfaces with no equivalent. On a phone where the user lands on `/insights/blutdruck` from a deep-link push, there is literally no Coach entry point. +- Evidence: `grep -rn "CoachDrawer" src/app/insights/` returns only `page.tsx` and `layout.tsx` (the latter comments that the drawer is "NOT mounted in this layout"). The launcher prop chain in the hero is also unique to `/insights/page.tsx`. +- Recommended fix: Move the drawer mount to `src/app/insights/layout.tsx` with a layout-level `useState` + a context provider (`CoachLaunchProvider`) that exposes `askCoach(prefill, scope)` to every child page. Sub-pages render a `` (sticky FAB on ``. +- Symptom: The per-conversation window override (`Last 7 / 30 / 90 days / All time`) is a 28 px tall pill (`h-7`) tucked between the title and the three header icon-buttons. On a 320 px viewport it sits ≈ 60 px from the right edge, with a tap zone smaller than the user's fingertip. +- Evidence: Class `h-7 ... rounded-full px-2.5 text-[11px]`. The Radix `` does not internally expand its hit target — the rendered button stays exactly 28 × ~70 px. +- Recommended fix: Raise the pill to `h-9` (36 px) and accept the slightly taller header — the surrounding icon-buttons are already `size-9`, so the row baselines remain aligned. The pill text stays `text-[11px]`; only the chrome grows. +- Effort: S + +### F4 — Per-message thumbs feedback row well below touch minimum +- Severity: High +- Axis: visual +- File: `src/components/insights/coach-panel/message-thread.tsx:544-563` — both `` with no `onClick`/`onPointerDown`. Radix `Tooltip.Root` doesn't expose a `triggerEvent="click"` mode; the upstream guidance is `` for tap-toggle. +- Recommended fix: Swap `` → `` (shadcn already ships `popover.tsx`). The `` button stays the trigger; the popover content is the same translation string. Add `aria-haspopup="dialog"` to the trigger. Keeps the tooltip-style appearance with proper tap behaviour on mobile. +- Effort: S + +### F8 — No `enterKeyHint` on the composer textarea +- Severity: Medium +- Axis: code +- File: `src/components/insights/coach-panel/coach-input.tsx:162-182`. +- Symptom: The Coach composer is the only multi-line text-entry surface where Enter actually submits (vs. Shift+Enter for newline). On iOS Safari + Android Chrome the on-screen keyboard's return key reads "return" / "↵" with no indication that it sends — the user pulls up the keyboard, types a question, then hunts for the send button instead of using the return key. WCAG-adjacent UX gap. +- Evidence: `