From bf54511db17040284d00a72a58d6b5ae00da3c74 Mon Sep 17 00:00:00 2001 From: SJCoetz Date: Thu, 6 Aug 2026 18:21:38 +0200 Subject: [PATCH] fix(buyer-tasks): make card layout mobile-friendly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At <=640px the buyer-tasks card content was crushed by the action column sitting beside it: the PO number badge broke mid-string ('PO-2026-08-042' wrapping to 4 lines), supplier names wrapped to 6 lines, and the new 'Sent to ...' caption overlapped the PO badge on the PO Sent tab. Three responsive tweaks, all using Tailwind breakpoint utilities: 1. Outer card container switches from 'flex items-start' to 'flex flex-col sm:flex-row sm:items-start'. The action column drops below the info column on mobile, giving the info all the available width and the buttons full-width tap targets. 2. PO number badge gains 'whitespace-nowrap'. The badge stays atomic; the parent's 'flex-wrap' carries the whole badge to a new line when it doesn't fit. 3. PO Sent right column: buttons stack vertically on mobile ('flex-col sm:flex-row' + 'flex-1 sm:flex-none' on each button) and the caption switches from 'text-right' to 'text-left sm:text-right' so it sits under the buttons. Desktop layout is unchanged — verified at 1280px that the side-by-side buttons, right-aligned caption, and inline single button all still render exactly as before. Co-Authored-By: Claude Co-authored-by: Orca --- .../buyer-tasks/buyer-task-group-card.tsx | 40 ++++++++++++++----- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/src/components/buyer-tasks/buyer-task-group-card.tsx b/src/components/buyer-tasks/buyer-task-group-card.tsx index 81a23b8..9d72504 100644 --- a/src/components/buyer-tasks/buyer-task-group-card.tsx +++ b/src/components/buyer-tasks/buyer-task-group-card.tsx @@ -67,17 +67,25 @@ export function BuyerTaskGroupCard({ /> -
+ {/* On mobile the action column drops below the info column so + neither gets crushed — the PO number badge no longer wraps + mid-number and the buttons get full-width tap targets. On + `sm:` and up the original side-by-side layout returns. */} +
{/* PO number + order number on the top row so they're both scannable. The PO number is the headline — the thing the operator needs to find quickly — so it goes first and gets its own visual weight. Only shown when - a PO has been generated (po_draft / po_sent tabs). */} + a PO has been generated (po_draft / po_sent tabs). The + badge uses `whitespace-nowrap` so a long PO number + (`PO-26071401`) never breaks mid-string when the info + column gets narrow — the parent `flex-wrap` carries + it onto the next line as a whole. */}
{group.poNumber && ( @@ -88,7 +96,7 @@ export function BuyerTaskGroupCard({ {group.orderNumber} -
+ // + // Mobile (below `sm:`): the buttons stack vertically and + // stretch to the full card width so the tap target is easy + // to hit; the caption aligns left to sit under the buttons + // naturally. On `sm:` and up the original side-by-side + // button row + right-aligned caption returns. +
+
{group.emailPayload?.sentAt ? (
{group.emailPayload.to ? ( @@ -169,12 +187,16 @@ export function BuyerTaskGroupCard({ ) : null}
) : ( - // needs_po / po_draft: single button (unchanged behaviour). + // needs_po / po_draft: single button. On mobile the button + // stretches full-width below the info column (better tap + // target, gives the info column all the available width); + // on `sm:` it sits inline to the right of the info.