From ae7dc184bdf6a50051e06327e23cc10e0b8238b9 Mon Sep 17 00:00:00 2001 From: Ayush Sawant <157198608+ayushhh101@users.noreply.github.com> Date: Tue, 14 Oct 2025 15:59:27 +0530 Subject: [PATCH 1/2] feat(a11y): add ARIA labels to navigation and polite announcements to notifications --- src/components/Navigation.jsx | 3 +++ src/components/NotificationList.jsx | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/Navigation.jsx b/src/components/Navigation.jsx index 646357e..05f5e3b 100644 --- a/src/components/Navigation.jsx +++ b/src/components/Navigation.jsx @@ -30,6 +30,7 @@ const Navigation = () => { - + ))} From d5c24fc55a751cce6414abf5595ced7916fb4c05 Mon Sep 17 00:00:00 2001 From: Ayush Sawant <157198608+ayushhh101@users.noreply.github.com> Date: Wed, 15 Oct 2025 23:10:28 +0530 Subject: [PATCH 2/2] feat(dashboard): connect status cards to real-time state data --- src/components/EnergyCharts.jsx | 15 --------------- src/components/StatusCard.jsx | 22 ++++++++++++++++++++-- src/pages/Dashboard.jsx | 11 ++++------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/components/EnergyCharts.jsx b/src/components/EnergyCharts.jsx index aafd3a7..83d9238 100644 --- a/src/components/EnergyCharts.jsx +++ b/src/components/EnergyCharts.jsx @@ -50,21 +50,6 @@ const EnergyCharts = () => { return (
{/* Real-time Energy Consumption */} -
-

Real-time Energy Overview

-
-
-

Current Consumption

-

{state.energyConsumption} W

-
-
-

Battery Level

-

{state.batteryLevel}%

-
-
-

Temperature

-

{state.temperature}°C

-
{ +const StatusCard = ({ title, value: propValue, subtitle: propSubtitle, icon, color: propColor, onClick }) => { const { state } = useApp(); const getStatusColor = () => { @@ -38,6 +38,11 @@ const StatusCard = ({ title, value, subtitle, icon, color, onClick }) => { const warningLevel = getWarningLevel(); + // Build derived values without mutating props + let value = propValue; + let subtitle = propSubtitle; + let color = propColor || 'status-offline'; + if (title === 'Inverter Status') { value = `${getStatusIcon()} ${state.inverterStatus.toUpperCase()}`; color = getStatusColor(); @@ -77,11 +82,24 @@ const StatusCard = ({ title, value, subtitle, icon, color, onClick }) => { } } + if (title === 'Energy Usage') { + value = `${state.energyConsumption}W`; + if (state.energyConsumption > 500) { + subtitle = 'High consumption'; + color = 'status-warning-battery'; + } else if (state.energyConsumption > 300) { + subtitle = 'Moderate consumption'; + color = 'status-standby'; + } else { + subtitle = 'Low consumption'; + color = 'status-online'; + } + } + return ( { role="region" aria-label="System status cards" > - - - - + + + + {/* Energy Usage Card - Separate row for better mobile layout */} @@ -82,10 +82,7 @@ const Dashboard = () => { >