From 3feddebcaaed11e986b9aeed774f56b3ebb7dd3d Mon Sep 17 00:00:00 2001 From: DEls Date: Sun, 27 Sep 2026 09:44:19 +0200 Subject: [PATCH] fix(mobile): audit and fix layout overflow across dashboard pages at 375/768px MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audited /dashboard, /dashboard/sites (+ detail), /dashboard/workforce/workers, /dashboard/workforce/on-site, /dashboard/plant/vehicles (+ detail), /dashboard/plant/equipment (+ detail), /dashboard/plant/fuel-logs, /dashboard/financial/purchase-orders (+ detail), /dashboard/financial/delivery-notes/inbox, /dashboard/financial/suppliers, and /dashboard/chat at 375x812 and 768x1024 using a scroll-right test to catch real horizontal page overflow (as opposed to a table's own, intentional internal scroll). Two repeating bug patterns accounted for every overflow found: 1. A page-specific `right={
...}` passed to Topbar can carry two or three labelled buttons (edit/import/ merge/back etc.). Without `flex-wrap` they don't fit a 375px screen in one row and push the whole page sideways. Fixed on the vehicles, equipment, and site detail pages, plus their list-page counterparts (vehicles fuel-view, equipment plant-view) — all five instances of this exact pattern. Same fix applied to a delivery-note card's button cluster on the PO detail page, and to Topbar's own right-side container as a general backstop. 2. `Intl.NumberFormat("en-ZA", ...)` joins currency/number groups with non-breaking spaces, so a wide value like "R 24 988 663" can't wrap. In a 3-up grid (site cards' Contract/Spent/Remaining) that overflowed the column; fixed by stacking those to 1-up below `sm`. In a 2-up grid (PO detail KPI tiles) added `min-w-0` so the tile clips instead of growing the grid track past the viewport. Also: the shared Dialog now caps at `max-h-[90dvh]` with internal scroll (a dialog taller than the phone viewport had no way to reach its close button or footer before), and the sidebar hamburger button was overlapping the Topbar's title on every page below `lg` — reserved space for it instead. Tables already scroll horizontally inside their own card via the shared `` component or an `overflow-auto` wrapper, and KPI grids already collapse responsively — both were fine everywhere checked. Co-Authored-By: Claude Opus 5.5 --- .../purchase-orders/[poId]/po-detail-view.tsx | 10 ++++++++-- .../dashboard/plant/equipment/[vehicleId]/page.tsx | 3 ++- src/app/dashboard/plant/equipment/plant-view.tsx | 4 +++- .../dashboard/plant/vehicles/[vehicleId]/page.tsx | 3 ++- src/app/dashboard/plant/vehicles/fuel-view.tsx | 5 ++++- src/app/dashboard/sites/[id]/page.tsx | 3 ++- src/app/dashboard/sites/sites-view.tsx | 14 +++++++++++--- src/components/layout/sidebar.tsx | 7 ++++++- src/components/ui/dialog.tsx | 7 ++++++- 9 files changed, 44 insertions(+), 12 deletions(-) diff --git a/src/app/dashboard/financial/purchase-orders/[poId]/po-detail-view.tsx b/src/app/dashboard/financial/purchase-orders/[poId]/po-detail-view.tsx index 7f33d83..49377e1 100644 --- a/src/app/dashboard/financial/purchase-orders/[poId]/po-detail-view.tsx +++ b/src/app/dashboard/financial/purchase-orders/[poId]/po-detail-view.tsx @@ -124,7 +124,11 @@ function amberTile( ? "text-blue-600 dark:text-blue-400" : "text-[#F2B165]"; return ( - + // `min-w-0`: without it, a grid item won't shrink below its content's + // intrinsic width — a wide, non-breaking-space-grouped number (e.g. + // "4 777,92 u") then grows the grid track past the column's share, + // pushing the whole page wider than the viewport at 2-up. + -
+ {/* flex-wrap: up to three buttons (review link, view slip, + verify) here would overflow a 375px screen in one row. */} +
{dn.batchNoteId && (