fix(ui): responsive mobile — full phone/tablet adaptation across all components

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>
This commit is contained in:
Bastien ChanotandClaude Opus 4.6 committed 2026-05-23 20:01:50 +02:00
1 parent 1f30280762
commit a73d8da263
10 files changed
+909 -19

No files matched your search

+3 -3
View File
@@ -276,15 +276,15 @@ export default function EditorRoute() {
return (
<main className="min-h-screen flex flex-col">
<ReportHeader report={report} onEditInfos={openEditInfos} />
<div className="flex-1 grid grid-cols-1 lg:grid-cols-[2fr_3fr] gap-6 p-6">
<section className="border border-[var(--color-border)] rounded-2xl bg-[var(--color-surface)] overflow-hidden">
<div className="flex-1 grid grid-cols-1 lg:grid-cols-[2fr_3fr] gap-4 sm:gap-6 p-4 sm:p-6">
<section className="border border-[var(--color-border)] rounded-2xl bg-[var(--color-surface)] overflow-hidden max-h-[55vh] lg:max-h-none">
<AnatomyCanvas
src={species.mainSvg}
boneStates={boneStates}
onZoneClick={(id) => onZoneClick(id)}
/>
</section>
<section className="space-y-6">
<section className="space-y-4 sm:space-y-6">
<ObservationList
observations={report.observations}
activeIndex={activeIndex}
+1 -1
View File
@@ -113,7 +113,7 @@ export default function AnatomyCanvas({
ref={wrapperRef}
className={`svg-canvas relative w-full h-full ${className}`}
>
<div ref={svgRef} className="w-full h-full" />
<div ref={svgRef} className="w-full h-full [&>svg]:max-w-full [&>svg]:max-h-full [&>svg]:mx-auto" />
<div
ref={tooltipRef}
className="zone-tooltip"
@@ -39,7 +39,7 @@ export default function ObservationList({
return (
<div className="space-y-3">
<div className="flex items-center justify-between">
<h2 className="font-serif text-xl text-[var(--color-ink)]">
<h2 className="font-serif text-lg sm:text-xl text-[var(--color-ink)]">
{t('observation.section_title')}
</h2>
<Button size="sm" onClick={onAdd}>
@@ -92,7 +92,7 @@ export default function VertebraPicker({
aria-selected={activeRegion === r}
onClick={() => setActiveRegion(r)}
className={[
'rounded-full px-4 py-1.5 text-sm font-medium border',
'rounded-full px-4 py-2.5 sm:py-1.5 text-sm font-medium border min-h-[2.75rem]',
activeRegion === r
? 'bg-[var(--color-accent)] text-white border-[var(--color-accent)]'
: 'bg-white text-[var(--color-ink)] border-[var(--color-border)]',
+1 -1
View File
@@ -24,7 +24,7 @@ export default function ConclusionPanel({
const t = useT()
return (
<section className="space-y-4">
<h2 className="font-serif text-xl text-[var(--color-ink)]">
<h2 className="font-serif text-lg sm:text-xl text-[var(--color-ink)]">
{t('conclusion.section_title')}
</h2>
<div>
+3 -3
View File
@@ -18,9 +18,9 @@ const VARIANTS: Record<NonNullable<ButtonProps['variant']>, string> = {
}
const SIZES: Record<NonNullable<ButtonProps['size']>, string> = {
sm: 'h-8 px-3 text-sm rounded-md',
md: 'h-10 px-4 text-base rounded-lg',
lg: 'h-12 px-6 text-base rounded-lg',
sm: 'h-9 px-3 text-sm rounded-md',
md: 'h-10 px-4 text-sm sm:text-base rounded-lg',
lg: 'h-12 px-5 sm:px-6 text-base rounded-lg',
}
export default function Button({
+4 -4
View File
@@ -27,7 +27,7 @@ export default function Dialog({ open, onClose, title, children, size = 'md' }:
return (
<AnimatePresence>
{open && (
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
<div className="fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-4">
<motion.div
data-testid="dialog-backdrop"
className="absolute inset-0 bg-black/40"
@@ -45,9 +45,9 @@ export default function Dialog({ open, onClose, title, children, size = 'md' }:
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.96 }}
transition={{ duration: 0.18 }}
className={`relative w-full ${SIZE[size]} max-h-[90vh] overflow-y-auto rounded-2xl bg-[var(--color-surface)] shadow-xl`}
className={`relative w-full ${SIZE[size]} max-h-[85vh] overflow-y-auto rounded-2xl bg-[var(--color-surface)] shadow-xl`}
>
<header className="flex items-center justify-between px-6 py-4 border-b border-[var(--color-border)]">
<header className="flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-[var(--color-border)]">
<h2 className="text-lg font-semibold text-[var(--color-ink)]">{title}</h2>
<button
type="button"
@@ -58,7 +58,7 @@ export default function Dialog({ open, onClose, title, children, size = 'md' }:
✕
</button>
</header>
<div className="px-6 py-4">{children}</div>
<div className="px-4 sm:px-6 py-3 sm:py-4">{children}</div>
</motion.div>
</div>
)}
+37 -5
View File
@@ -1,5 +1,6 @@
.svg-editor-root {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
overflow: hidden;
@@ -8,6 +9,12 @@
background: var(--color-bg);
}
@media (min-width: 768px) {
.svg-editor-root {
flex-direction: row;
}
}
.svg-editor-root * { box-sizing: border-box; margin: 0; padding: 0; }
.svg-editor-canvas {
@@ -16,6 +23,13 @@
background: var(--color-surface);
overflow: hidden;
padding: 10px;
min-height: 40vh;
}
@media (min-width: 768px) {
.svg-editor-canvas {
min-height: 0;
}
}
.svg-editor-canvas-inner {
width: 100%;
@@ -95,12 +109,22 @@
.svg-editor-root .polygon-preview-pt { fill: var(--color-accent); }
.svg-editor-sidebar {
width: 380px;
width: 100%;
background: var(--color-surface);
border-left: 1px solid var(--color-border);
border-top: 1px solid var(--color-border);
display: flex;
flex-direction: column;
overflow: hidden;
max-height: 50vh;
}
@media (min-width: 768px) {
.svg-editor-sidebar {
width: 380px;
max-height: none;
border-top: none;
border-left: 1px solid var(--color-border);
}
}
.svg-editor-sidebar header {
padding: 14px 16px;
@@ -251,16 +275,24 @@
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.svg-editor-zoom-controls button {
width: 32px;
height: 32px;
width: 40px;
height: 40px;
padding: 0;
margin: 0;
font-size: 16px;
font-size: 18px;
display: flex;
align-items: center;
justify-content: center;
}
@media (min-width: 768px) {
.svg-editor-zoom-controls button {
width: 32px;
height: 32px;
font-size: 16px;
}
}
.svg-editor-root input[type="checkbox"] { width: auto; display: inline; margin: 0 6px 0 0; }
.svg-editor-root .cat-row {