fix(web): stop mobile layout viewport expanding past device width

On mobile the dashboard opened "zoomed in" — the layout viewport reported
~548px instead of the device's 390px, so users had to pinch-zoom out to
fit. Root cause: the dashboard main column (flex flex-1 flex-col) is a flex
item with the default min-width:auto, so it refused to shrink below its
content's intrinsic width. The subscription feature-comparison table
(~514px: a w-48 label column + 4 plan columns) therefore dragged the whole
column — and the mobile layout viewport — wider than the screen, despite
the table sitting in an overflow-x-auto wrapper.

Adding min-w-0 lets the column shrink to the viewport; the wide table now
scrolls inside its own container. Verified with iPhone-class emulation
(390px): innerWidth/scrollWidth = 390 with no horizontal overflow across
/dashboard, /dashboard/search and /dashboard/subscription. Fix lives in the
shared dashboard layout, so it repairs every dashboard page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-25 15:43:33 +03:00
parent 4ba06615a1
commit a631380e74

View File

@@ -317,7 +317,11 @@ function DashboardLayout() {
</aside>
{/* ─── Main Content Area ────────────────────────────────────────── */}
<div className="flex flex-1 flex-col">
{/* min-w-0: lets this flex column shrink below its content's intrinsic
width so wide children (e.g. the subscription feature-comparison
table) scroll inside their own overflow-x container instead of
forcing the whole mobile layout viewport wider than the device. */}
<div className="flex min-w-0 flex-1 flex-col">
{/* Top Header Bar */}
<header className="flex h-16 items-center justify-between border-b border-border px-4 sm:px-6">
{/* Left: Mobile menu + User welcome */}