From 5393b237de517968c0b7191c0a62890cd2b1364f Mon Sep 17 00:00:00 2001 From: Daniel Bedeleanu Date: Sat, 25 Apr 2026 12:43:38 +0300 Subject: [PATCH] feat(07.1-frontend-overhaul): refine StatCard and Data Tables - Applied #121212 background and #222222 border to StatCards and Tables. - Tightened internal padding to 8px-12px. - Enforced 0px border radius and removed shadows. - Numeric values in StatCards now match label size. - Caution Orange used for emphasis in StatCards. - Removed zebra-striping and applied 1px horizontal dividers to Tables. - Headers updated to Title Case Space Grotesk. - Complies with AI_RULES.md (no bold, no uppercase). --- frontend/components/InventoryTable.tsx | 54 ++++---- frontend/components/LogsTable.tsx | 169 ++++++++++++++----------- frontend/components/StatCard.tsx | 4 +- 3 files changed, 120 insertions(+), 107 deletions(-) diff --git a/frontend/components/InventoryTable.tsx b/frontend/components/InventoryTable.tsx index 547d701b..e664f77b 100644 --- a/frontend/components/InventoryTable.tsx +++ b/frontend/components/InventoryTable.tsx @@ -53,57 +53,56 @@ export default function InventoryTable({ if (categories.length === 0) { return ( -
+
-

No results found

+

No Results Found

); } return ( -
+
{categories.map(cat => { const categoryItems = items.filter(i => i.category === cat); return ( -
+
onExpandCategory(expandedCategory === cat ? null : cat)} >
-
- +
+
-

{cat}

-

- {categoryItems.length} Item types in stock +

{cat}

+

+ {categoryItems.length} Item Types In Stock

- {expandedCategory === cat ? : } + {expandedCategory === cat ? : } {onEditCategory && ( )}
{expandedCategory === cat && ( -
-
+
{categoryItems.map(item => (
handleItemClick(item)} @@ -115,7 +114,7 @@ export default function InventoryTable({ e.stopPropagation(); setSelectedPhotoItem(item); }} - className="w-12 h-12 rounded-xl shrink-0 border-2 border-slate-300 overflow-hidden cursor-pointer hover:border-primary transition-colors active:scale-95" + className="w-10 h-10 shrink-0 border border-border overflow-hidden cursor-pointer hover:border-primary transition-colors" >
) : ( -
+
)}
-

{item.name}

- {item.photo_path || item.image_url ? ( -

Tap photo for details

- ) : ( - <> -

{item.specs}

-

No photo

- - )} +

{item.name}

+

+ {item.specs || (item.photo_path || item.image_url ? 'Tap Photo For Details' : 'No Specs')} +

{item.quantity} -

Stock

+

Stock

))} diff --git a/frontend/components/LogsTable.tsx b/frontend/components/LogsTable.tsx index b11cd035..054ca20a 100644 --- a/frontend/components/LogsTable.tsx +++ b/frontend/components/LogsTable.tsx @@ -25,21 +25,21 @@ export default function LogsTable({ logs, loading }: LogsTableProps) { if (loading) { return ( -
-
-

Securing Audit Stream...

+
+
+

Securing Audit Stream...

); } if (logs.length === 0) { return ( -
-
+
+
-

No events found

+

No events found

Refine your strategic filters

@@ -48,81 +48,100 @@ export default function LogsTable({ logs, loading }: LogsTableProps) { return ( <> -
- {logs.map((log) => ( -
- -
-
0 ? "text-green-500" : ((log.quantity_change || 0) < 0 ? "text-rose-500" : "text-primary/50") - )}> - {log.quantity_change ? (log.quantity_change > 0 ? `+${log.quantity_change}` : log.quantity_change) : (log.action.includes('DB') ? 'SYS' : '±')} -
-
- - ))} + + ))} +
{/* Selected Log Modal */} {selectedLog && (
-
+
- {selectedLog.action} + {selectedLog.action.replace('_', ' ').toLowerCase().replace(/\b\w/g, l => l.toUpperCase())}
-

+

{selectedLog.resolved_name}

-
-
-
-

Protocol Operator

-

{selectedLog.username || 'Automated Process'}

+
+
+

Protocol Operator

+

{selectedLog.username || 'Automated Process'}

-
-

Quantity Delta

+
+

Quantity Delta

0 ? "text-green-500" : "text-rose-500" @@ -134,10 +153,10 @@ export default function LogsTable({ logs, loading }: LogsTableProps) {

-
+
-

Universal Timestamp

-

+

Universal Timestamp

+

{new Date(selectedLog.timestamp).toLocaleString(undefined, { dateStyle: 'full', timeStyle: 'medium' })}

@@ -146,18 +165,18 @@ export default function LogsTable({ logs, loading }: LogsTableProps) { try { const snap = JSON.parse(selectedLog.target_snapshot) as Record; return ( -
-
-
-

Snapshot Record

-
+
+
+
+

Snapshot Record

+
-
+
{Object.entries(snap).map(([key, val]) => ( (val && key !== 'image_url' && key !== 'id') ? ( -
-

{key.replace('_', ' ')}

-

{String(val)}

+
+

{key.replace('_', ' ').toLowerCase().replace(/\b\w/g, l => l.toUpperCase())}

+

{String(val)}

) : null ))} @@ -168,10 +187,10 @@ export default function LogsTable({ logs, loading }: LogsTableProps) { })()} {selectedLog.details && ( -
-

Intervention Details

-
- "{selectedLog.details}" +
+

Intervention Details

+
+ {selectedLog.details}
)} @@ -179,7 +198,7 @@ export default function LogsTable({ logs, loading }: LogsTableProps) { diff --git a/frontend/components/StatCard.tsx b/frontend/components/StatCard.tsx index 205998d6..174ed375 100644 --- a/frontend/components/StatCard.tsx +++ b/frontend/components/StatCard.tsx @@ -9,7 +9,7 @@ interface StatCardProps { export default function StatCard({ label, value, icon: Icon }: StatCardProps) { return ( -
+
{Icon &&
- + {value}