From 0382e8119d7de58c3cbd59045b6b4e56ff580d67 Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Fri, 12 Dec 2025 20:44:12 -0800 Subject: [PATCH] fix: improve batch card display with batch code badges and room location --- frontend/src/pages/BatchesPage.tsx | 111 ++++++++++++++++------------- 1 file changed, 63 insertions(+), 48 deletions(-) diff --git a/frontend/src/pages/BatchesPage.tsx b/frontend/src/pages/BatchesPage.tsx index 4501013..81c70c5 100644 --- a/frontend/src/pages/BatchesPage.tsx +++ b/frontend/src/pages/BatchesPage.tsx @@ -141,60 +141,75 @@ export default function BatchesPage() { />
- {group.items.map(batch => ( -
- {/* Clickable Header */} - -
-
-

- {batch.name} -

-
- {batch.strain} - - {batch.plantCount} plants + {group.items.map(batch => { + // Extract batch code from name (e.g., "B001" from "[DEMO] Gorilla Glue #4 - B001") + const batchCode = batch.name.match(/B\d{3}/)?.[0] || batch.id.slice(0, 6).toUpperCase(); + + return ( +
+ {/* Clickable Header */} + +
+
+ {/* Batch Code Badge + Strain Name */} +
+ + {batchCode} + +

+ {batch.strain} +

+
+ {/* Plant count + Room */} +
+ {batch.plantCount} plants + {batch.room && ( + <> + + {batch.room.name?.replace('[DEMO] ', '')} + + )} +
+
- -
- {/* Progress & Days */} -
- - -
- + {/* Progress & Days */} +
+ + +
+ - {/* Quick Actions */} -
- {batch.room?.name || 'No Room'} -
- setScoutingBatch(batch)} - variant="accent" - /> - setIpmBatch(batch)} - variant="destructive" - /> - setSelectedBatch(batch)} - variant="success" - /> + {/* Quick Actions */} +
+
+ setScoutingBatch(batch)} + variant="accent" + /> + setIpmBatch(batch)} + variant="destructive" + /> + setSelectedBatch(batch)} + variant="success" + /> +
-
- ))} + ); + })}
))