From 41dcdce993e79fdb4d62572fee55399438455f76 Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Tue, 6 Jan 2026 12:07:41 -0800 Subject: [PATCH] feat: Improve Pulse analytics and Environment Report theming for light/dark mode --- .../components/dashboard/PulseSensorCard.tsx | 50 +++--- frontend/src/pages/EnvironmentReportPage.tsx | 59 +++---- frontend/src/pages/PulseTestPage.tsx | 150 +++++++++--------- 3 files changed, 129 insertions(+), 130 deletions(-) diff --git a/frontend/src/components/dashboard/PulseSensorCard.tsx b/frontend/src/components/dashboard/PulseSensorCard.tsx index 3fd571d..18f4098 100644 --- a/frontend/src/components/dashboard/PulseSensorCard.tsx +++ b/frontend/src/components/dashboard/PulseSensorCard.tsx @@ -78,9 +78,9 @@ export function PulseSensorCard({ reading, history, thresholds, onClick }: Pulse onClick={handleClick} className={cn( "group relative overflow-hidden rounded-2xl cursor-pointer transition-all", - "bg-gradient-to-br from-slate-800/80 to-slate-900/80", - "border border-slate-700/50 hover:border-emerald-500/50", - "shadow-xl hover:shadow-2xl hover:shadow-emerald-500/10" + "bg-white dark:bg-gradient-to-br dark:from-slate-800/80 dark:to-slate-900/80", + "border border-slate-200 dark:border-slate-700/50 hover:border-emerald-500/50", + "shadow-sm dark:shadow-xl hover:shadow-md dark:hover:shadow-2xl hover:shadow-emerald-500/10" )} > {/* Header */} @@ -90,28 +90,28 @@ export function PulseSensorCard({ reading, history, thresholds, onClick }: Pulse
Pulse Grow Sensor
+Pulse Grow Sensor
{reading.temperature.toFixed(1)}°
{reading.humidity.toFixed(0)}%
@@ -180,15 +180,15 @@ export function PulseSensorCard({ reading, history, thresholds, onClick }: Pulse {/* VPD */}{reading.vpd.toFixed(2)}
@@ -197,11 +197,11 @@ export function PulseSensorCard({ reading, history, thresholds, onClick }: Pulse {/* Dewpoint Row */}+
{reportData?.devices[0]?.stats.temperature.avg.toFixed(1) || '--'}°F
-+
Range: {reportData?.devices[0]?.stats.temperature.min.toFixed(1)}° – {reportData?.devices[0]?.stats.temperature.max.toFixed(1)}°
+
{reportData?.devices[0]?.stats.humidity.avg.toFixed(0) || '--'}%
-+
Range: {reportData?.devices[0]?.stats.humidity.min.toFixed(0)}% – {reportData?.devices[0]?.stats.humidity.max.toFixed(0)}%
@@ -418,16 +419,16 @@ export default function EnvironmentReportPage() { initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.2 }} - className="p-5 rounded-2xl bg-white dark:bg-gradient-to-br dark:from-purple-500/20 dark:to-pink-500/10 border border-purple-200 dark:border-purple-500/20 shadow-sm dark:shadow-none" + className="p-5 rounded-2xl bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700/50 shadow-sm dark:shadow-none" >+
{reportData?.devices[0]?.stats.vpd.avg.toFixed(2) || '--'} kPa
-+
Range: {reportData?.devices[0]?.stats.vpd.min.toFixed(2)} – {reportData?.devices[0]?.stats.vpd.max.toFixed(2)}
@@ -436,16 +437,16 @@ export default function EnvironmentReportPage() { initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.3 }} - className="p-5 rounded-2xl bg-white dark:bg-gradient-to-br dark:from-amber-500/20 dark:to-yellow-500/10 border border-amber-200 dark:border-amber-500/20 shadow-sm dark:shadow-none" + className="p-5 rounded-2xl bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700/50 shadow-sm dark:shadow-none" >+
{reportData?.alerts.total || 0}
-+
| Time | Severity | @@ -907,23 +908,23 @@ export default function EnvironmentReportPage() {Duration | |||||
|---|---|---|---|---|---|---|---|
| + | |||||||
| {new Date(alert.createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' })} | - {alert.severity} | -{alert.type.replace('_', ' ')} | -{alert.message} | -+ | {alert.type.replace('_', ' ')} | +{alert.message} | +{alert.resolutionTimeMin ? `${alert.resolutionTimeMin.toFixed(1)}m` : '-'} |
No recent alerts found for this period.
+No recent alerts found for this period.
)} diff --git a/frontend/src/pages/PulseTestPage.tsx b/frontend/src/pages/PulseTestPage.tsx index c2eff4e..ac84896 100644 --- a/frontend/src/pages/PulseTestPage.tsx +++ b/frontend/src/pages/PulseTestPage.tsx @@ -129,30 +129,30 @@ export default function PulseTestPage() { const currentReading = readings.find(r => r.deviceId === selectedDevice) || readings[0]; return ( -+
Real-time environmental monitoring with historical trends
Temp
+Temp
{reading.temperature.toFixed(1)}°
RH
-+
RH
+{reading.humidity.toFixed(0)}%
VPD
+VPD
{reading.vpd.toFixed(2)}
@@ -229,9 +229,9 @@ export default function PulseTestPage() { ))} {readings.length === 0 && !loading && ( -No sensors connected
+No sensors connected
+
{currentReading.temperature.toFixed(1)}°F
+
{currentReading.humidity.toFixed(0)}%
@@ -274,29 +274,29 @@ export default function PulseTestPage() { initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.2 }} - className="p-5 rounded-2xl bg-gradient-to-br from-purple-500/20 to-pink-500/10 border border-purple-500/20" + className="p-5 rounded-2xl bg-white dark:bg-slate-800/30 border border-purple-100 dark:border-purple-500/10 shadow-sm dark:shadow-none" >+
{currentReading.vpd.toFixed(2)}
-kPa
+kPa
+
{currentReading.dewpoint.toFixed(1)}°F