Surgical CSS/className-only changes, zero behavior impact. 155/155 tests green. - Dialog: tighter mobile padding (p-3/px-4), reduced max-height to 85vh - Button: sm size h-8→h-9 (36px touch target), responsive text sizing - VertebraPicker: 44px min-height touch targets on mobile region tabs - SVG editor: sidebar stacks below canvas <768px, full-width mobile, zoom controls 40px, canvas min-height 40vh - AnatomyCanvas: SVG child constrained to fit container - EditorRoute: responsive gap/padding, canvas max-h-[55vh] on mobile - ObservationList + ConclusionPanel: responsive section heading typography Target: 375px+ (iPhone SE) usable, 768px+ (iPad) polished, desktop no regressions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.9 KiB
2.9 KiB
Responsive / Mobile-First — Surgical Fixes
Date: 2026-05-23 Approach: A — surgical fixes, no layout redesign Target: phone-first (375px+), tablet perfect (768px+) Baseline score: 40/100 responsive readiness Target score: 80+/100
Scope
Pure CSS/className changes. Zero store, schema, or PDF impact. ~12-15 files.
1. Dialog viewport clamping
File: src/components/ui/Dialog.tsx
- All size variants get
max-w-[calc(100vw-2rem)]so dialogs never exceed viewport - Backdrop padding:
p-4→p-2 sm:p-4 - Dialog content padding responsive where needed
2. SVG Editor sidebar — stack on mobile
File: src/styles/svg-editor.css
- Below
md(768px): sidebar stacks below canvas viaflex-direction: column - Sidebar width:
380px→w-fullon mobile,380pxonmd+ - Canvas gets min-height to stay usable when stacked
3. AnatomyCanvas — height constraint + touch
Files: src/components/canvas/AnatomyCanvas.tsx, src/app/routes/EditorRoute.tsx
- Mobile:
max-h-[60vh]on canvas wrapper so observations panel stays visible overflow-hiddenon wrapper- CSS
touch-action: pan-x pan-yfor native scroll compatibility
4. Touch targets — minimum 40px
Files: src/components/ui/Button.tsx, src/components/observation/VertebraPicker.tsx, src/components/ui/Chip.tsx
- Button
smsize:h-8→h-9 sm:h-8(36px mobile, 32px desktop) — compromise between touch and density - VertebraPicker region tabs: add
min-h-[2.75rem](44px) - Any interactive Chip: ensure
min-h-[2.5rem]
5. Responsive typography
Files: all route components, ObservationList.tsx, ConclusionPanel.tsx
Pattern:
- Page headings:
text-xl sm:text-2xl md:text-3xl - Section headings:
text-lg sm:text-xl - Form legends:
text-lg sm:text-xl
6. Padding normalization
Files: all route components
- Route containers:
px-4 sm:px-6 - Gaps:
gap-4 sm:gap-6 - Consistent tightening on phone
7. Editor layout mobile polish
File: src/app/routes/EditorRoute.tsx
- Single-column below
lg: SVG canvas explicit height cap - Observations section scrollable independently
- Sticky observation header on mobile for context
8. Footer + Header
Files: src/components/brand/Footer.tsx, src/components/brand/AppHeader.tsx
- Footer:
gap-2 sm:gap-4 - Header: already responsive (tagline hidden <sm) — minimal tweaks if needed
Out of scope
- No layout redesign (tab-based editor, bottom sheets, etc.)
- No feature gating per viewport
- No pinch-zoom gestures on canvas
- No SVG editor feature disabling on phone
- No PDF or schema changes
Success criteria
- All routes usable on 375px viewport (iPhone SE)
- All interactive elements ≥ 40px touch target
- No horizontal overflow on any page
- Dialogs fit within viewport on all sizes
- SVG editor usable (stacked) on tablet
- Tests still pass (no behavior changes)