From 1c786eaf7138912e8d71e91ec5292fa38919df94 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 17 Jul 2026 18:12:57 +0000 Subject: [PATCH] Optimise phone touch targets and fix therapy-compass mobile overflow Convergence pass bringing sub-44px interactive controls up to the design system's --spacing-tap floor on phone, and fixing horizontal-overflow clipping in Therapy Compass. No visual redesign; desktop is preserved. Tap targets (phone): - answer suggestion/follow-up chips: 32px -> 44px with an 8px gap under pointer:coarse only (mouse users keep the compact 32px chip) - ClinicalDashboard: Stop, Show/Hide previous answer, Show earlier messages - header/shell: guide close button, workflow icon-cluster gap - services results (bookmark/open/select) + service/form toast dismiss - differentials-home open links, best-answer + urgent rows, empty-state CTAs - favourites hub/library filter chips, dropdowns, sort, Continue CTA - formulation builder + home controls - DocumentViewer hit prev/next, summary + secondary controls (phone 44, desktop 36 via sm:min-h-9), medication + patient-profile buttons Therapy Compass mobile overflow: - stack fixed/minmax multi-column grids to one column under 640px so clipped clinical content (review columns, contraindications) is reachable - make the comparison table scroll horizontally instead of clipping columns - raise nav/tab/segment/chip and remaining controls to the 44px tap floor Verification: typecheck clean; eslint clean on changed files; check:type-scale + check:icon-scale pass; unit suite 2681/2682 (the one failure is a pre-existing Python child-process test unrelated to this diff). Manual Playwright pass at 390x820 confirms 0 horizontal overflow on every route, 44px tap targets, and the Therapy Compass fixes; desktop unchanged. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01YKNwAjDBUTv5khn64QKwHW --- src/app/globals.css | 15 ++++++++++ src/components/ClinicalDashboard.tsx | 6 ++-- src/components/DocumentViewer.tsx | 24 +++++++-------- .../clinical-dashboard/dashboard-shell.tsx | 2 +- .../clinical-dashboard/differentials-home.tsx | 30 +++++++++---------- .../favourites-command-library-page.tsx | 12 ++++---- .../clinical-dashboard/favourites-hub.tsx | 8 ++--- .../master-search-header.tsx | 2 +- .../medication-prescribing-workspace.tsx | 2 +- .../patient-profile-panel.tsx | 2 +- src/components/forms/form-detail-page.tsx | 2 +- .../forms/forms-search-results-page.tsx | 6 ++-- .../formulation/formulation-builder-page.tsx | 8 ++--- .../formulation/formulation-home-page.tsx | 2 +- .../services/service-detail-page.tsx | 2 +- .../services/services-navigator-page.tsx | 6 ++-- src/components/therapy-compass/bindings.tsx | 8 ++--- src/components/therapy-compass/controls.ts | 2 +- .../therapy-compass/screens/brief-screen.tsx | 7 +++-- .../screens/compare-screen.tsx | 3 +- .../therapy-compass/screens/detail-screen.tsx | 5 +++- .../therapy-compass/screens/other-screen.tsx | 1 + .../screens/pathways-screen.tsx | 1 + .../screens/recommend-screen.tsx | 1 + .../therapy-compass/screens/sheets-screen.tsx | 7 +++-- src/components/therapy-compass/styles.tsx | 11 +++++++ .../therapy-compass/therapy-card.tsx | 4 ++- 27 files changed, 110 insertions(+), 69 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index a9fb9afe6..3e7440233 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1442,6 +1442,21 @@ summary::-webkit-details-marker { color: var(--clinical-accent); } +/* Touch devices: suggestion/follow-up chips are primary tap targets (the + follow-ups sit directly under the composer and each fires a new search). + Meet the 44px tap floor and widen the gap so neighbouring chips in the + horizontal scroll row don't invite mis-taps. Fine-pointer (mouse) users keep + the compact 32px chip — no desktop visual change. */ +@media (pointer: coarse) { + .answer-suggestion-chips { + gap: 0.5rem; + } + + .answer-suggestion-chip { + min-height: var(--spacing-tap); + } +} + .answer-suggestion-chip:disabled { cursor: not-allowed; } diff --git a/src/components/ClinicalDashboard.tsx b/src/components/ClinicalDashboard.tsx index 322216daf..a4a636c71 100644 --- a/src/components/ClinicalDashboard.tsx +++ b/src/components/ClinicalDashboard.tsx @@ -376,7 +376,7 @@ function PriorAnswerTurnSurface({ type="button" onClick={onToggleCollapsed} aria-expanded={!collapsed} - className="inline-flex min-h-9 items-center gap-1.5 rounded-md px-1 text-xs font-semibold text-[color:var(--text-muted)] transition hover:text-[color:var(--text-heading)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:var(--focus)]" + className="inline-flex min-h-tap items-center gap-1.5 rounded-md px-1 text-xs font-semibold text-[color:var(--text-muted)] transition hover:text-[color:var(--text-heading)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:var(--focus)]" >