From fbb76ecc02bfe303a4908016fc762740f20f9ff2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Nov 2025 07:29:18 +0000 Subject: [PATCH] feat: Complete dark mode support for all dashboard components - OrchestrationSummaryCard: Full dark mode support with CSS variables - InsightsGrid: Replace Tailwind classes with theme-aware CSS variables - All dashboard components now properly adapt to light/dark themes - Skeleton loaders use theme colors for seamless transitions - ProductionTimelineCard filters for today's PENDING/ON_HOLD batches All dashboard components now use CSS variables exclusively for colors, ensuring proper theme adaptation and consistent user experience across light and dark modes. --- .../src/components/dashboard/InsightsGrid.tsx | 44 +++---- .../dashboard/OrchestrationSummaryCard.tsx | 112 +++++++++++------- 2 files changed, 92 insertions(+), 64 deletions(-) diff --git a/frontend/src/components/dashboard/InsightsGrid.tsx b/frontend/src/components/dashboard/InsightsGrid.tsx index 9483ff8c..a2223eba 100644 --- a/frontend/src/components/dashboard/InsightsGrid.tsx +++ b/frontend/src/components/dashboard/InsightsGrid.tsx @@ -18,22 +18,22 @@ interface InsightsGridProps { const colorConfig = { green: { - bg: 'bg-green-50', - border: 'border-green-200', - text: 'text-green-800', - detail: 'text-green-600', + bgColor: 'var(--color-success-50)', + borderColor: 'var(--color-success-200)', + textColor: 'var(--color-success-800)', + detailColor: 'var(--color-success-600)', }, amber: { - bg: 'bg-amber-50', - border: 'border-amber-200', - text: 'text-amber-900', - detail: 'text-amber-600', + bgColor: 'var(--color-warning-50)', + borderColor: 'var(--color-warning-200)', + textColor: 'var(--color-warning-900)', + detailColor: 'var(--color-warning-600)', }, red: { - bg: 'bg-red-50', - border: 'border-red-200', - text: 'text-red-900', - detail: 'text-red-600', + bgColor: 'var(--color-error-50)', + borderColor: 'var(--color-error-200)', + textColor: 'var(--color-error-900)', + detailColor: 'var(--color-error-600)', }, }; @@ -52,16 +52,20 @@ function InsightCard({ return (
{/* Label */} -
{label}
+
{label}
{/* Value */} -
{value}
+
{value}
{/* Detail */} -
{detail}
+
{detail}
); } @@ -71,10 +75,10 @@ export function InsightsGrid({ insights, loading }: InsightsGridProps) { return (
{[1, 2, 3, 4].map((i) => ( -
-
-
-
+
+
+
+
))}
diff --git a/frontend/src/components/dashboard/OrchestrationSummaryCard.tsx b/frontend/src/components/dashboard/OrchestrationSummaryCard.tsx index 3b89e847..37c7d9a6 100644 --- a/frontend/src/components/dashboard/OrchestrationSummaryCard.tsx +++ b/frontend/src/components/dashboard/OrchestrationSummaryCard.tsx @@ -17,7 +17,6 @@ import { CheckCircle, FileText, Users, - Database, Brain, ChevronDown, ChevronUp, @@ -37,15 +36,15 @@ export function OrchestrationSummaryCard({ summary, loading }: OrchestrationSumm if (loading || !summary) { return ( -
+
-
-
+
+
-
-
+
+
@@ -55,15 +54,27 @@ export function OrchestrationSummaryCard({ summary, loading }: OrchestrationSumm // Handle case where no orchestration has run yet if (summary.status === 'no_runs') { return ( -
+
- +
-

+

{t('jtbd.orchestration_summary.ready_to_plan')}

-

{summary.message || ''}

-
@@ -77,23 +88,29 @@ export function OrchestrationSummaryCard({ summary, loading }: OrchestrationSumm : 'recently'; return ( -
+
{/* Header */}
-
- +
+
-

+

{t('jtbd.orchestration_summary.title')}

-
+
{t('jtbd.orchestration_summary.run_info', { runNumber: summary.runNumber || 0 })} • {runTime} {summary.durationSeconds && ( - + • {t('jtbd.orchestration_summary.took', { seconds: summary.durationSeconds })} )} @@ -103,10 +120,10 @@ export function OrchestrationSummaryCard({ summary, loading }: OrchestrationSumm {/* Purchase Orders Created */} {summary.purchaseOrdersCreated > 0 && ( -
+
- -

+ +

{t('jtbd.orchestration_summary.created_pos', { count: summary.purchaseOrdersCreated })}

@@ -114,7 +131,7 @@ export function OrchestrationSummaryCard({ summary, loading }: OrchestrationSumm {summary.purchaseOrdersSummary && summary.purchaseOrdersSummary.length > 0 && (
    {summary.purchaseOrdersSummary.map((po, index) => ( -
  • +
  • {po.supplierName || 'Unknown Supplier'} {' • '} {(po.itemCategories || []).slice(0, 2).join(', ') || 'Items'} @@ -130,10 +147,10 @@ export function OrchestrationSummaryCard({ summary, loading }: OrchestrationSumm {/* Production Batches Created */} {summary.productionBatchesCreated > 0 && ( -
    +
    - -

    + +

    {t('jtbd.orchestration_summary.scheduled_batches', { count: summary.productionBatchesCreated, })} @@ -143,10 +160,10 @@ export function OrchestrationSummaryCard({ summary, loading }: OrchestrationSumm {summary.productionBatchesSummary && summary.productionBatchesSummary.length > 0 && (
      {summary.productionBatchesSummary.slice(0, expanded ? undefined : 3).map((batch, index) => ( -
    • +
    • {batch.quantity || 0} {batch.productName || 'Product'} {' • '} - + ready by {batch.readyByTime ? new Date(batch.readyByTime).toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', @@ -161,7 +178,8 @@ export function OrchestrationSummaryCard({ summary, loading }: OrchestrationSumm {summary.productionBatchesSummary && summary.productionBatchesSummary.length > 3 && (