From 4e3f1ac7d789d19096a8080bb856c16c18f1acf1 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 2 Oct 2026 16:28:07 +0200 Subject: [PATCH] Mobile: make the Sites table fit 375px without losing the VAT split MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /sites table showed seven columns and needed roughly 493px of a 343px viewport once the page padding is taken off, so at phone width the row was a sideways scroll with the sticky Site column sitting on top of the figures — the same trap the invoice table had. Below sm it now shows Site, Total incl VAT and Unbooked. The ex-VAT and VAT columns hide, but their split is not dropped: it moves under the total as two stacked lines, "ex 161 367,50" and "VAT 24 205,13", which is the same information the columns carried without the width. The split is stacked rather than on one line because "161 367,50 + 24 205,13" is wider than the total it annotates, which pushed the row back over the viewport. The unbooked badge drops its word on mobile for the same reason — the row is already tinted, and the count plus icon carry the meaning. Width budget for the three visible columns: 154 + 102 + 60 = 316px of 343px. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/sites/page.tsx | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/app/sites/page.tsx b/app/sites/page.tsx index d475693..e816843 100644 --- a/app/sites/page.tsx +++ b/app/sites/page.tsx @@ -71,7 +71,7 @@ export default async function SitesPage() { - - + - + @@ -96,7 +96,7 @@ export default async function SitesPage() { r.unbookedCount ? "bg-[#D1495B]/[0.04]" : "hover:bg-gray-50/60 dark:hover:bg-white/[0.02]" }`} > - - - -
+ Site @@ -80,12 +80,12 @@ export default async function SitesPage() { Machines Revenue ex VATRevenue ex VAT VAT Total incl VATUnbookedUnbooked
+ {r.machineCount} + {ZAR2(r.revenueExcl)} {ZAR2(r.vat)} - {ZAR2(r.revenueIncl)} + +
{ZAR2(r.revenueIncl)}
+ {/* The ex-VAT/VAT split stays visible on mobile, but as two short + stacked lines — "161 367,50 + 24 205,13" on one line is wider + than the total it annotates, which pushed the row back over the + 375px viewport. */} +
+
ex {ZAR2(r.revenueExcl)}
+
VAT {ZAR2(r.vat)}
+
+ {r.unbookedCount > 0 ? ( - + - {r.unbookedCount} unbooked + {r.unbookedCount} + unbooked ) : ( —