From cab4fcda4c47912ee56478f9773fd3970d2bc428 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Sun, 22 Feb 2026 09:22:34 +0100 Subject: [PATCH] safety(web-dashboard): theme-consistent chart colors, a11y attributes, WS reconnect, loading skeletons - Replace all hardcoded hex colors in chart components with CSS custom properties (getCssVar helper), making charts respect theme changes - Add scope="col" to all table headers (PositionsTable, OrdersTable, BacktestingDashboard trade list) - Connect form labels to inputs via htmlFor/id pairs (OrderForm, BacktestingDashboard) - Add role="alert" to validation error messages - Add aria-label to cancel button, progressbar role to backtest progress - Add WsManager.reconnect() method with backoff reset - Add Reconnect button to StatusBar when WS disconnected - Add shimmer skeleton loading states to CandlestickChart and PnLChart Co-Authored-By: Claude Opus 4.6 --- .../components/charts/CandlestickChart.tsx | 54 ++++++++++++++----- .../src/components/charts/PnLChart.tsx | 42 +++++++++++---- .../src/components/common/StatusBar.tsx | 14 ++++- .../src/components/risk/DrawdownChart.tsx | 25 ++++++--- .../src/components/risk/RiskGauge.tsx | 11 +++- .../src/components/trading/OrderForm.tsx | 20 ++++--- .../src/components/trading/OrdersTable.tsx | 19 +++---- .../src/components/trading/PositionsTable.tsx | 12 ++--- web-dashboard/src/lib/websocket.ts | 16 ++++++ .../src/pages/BacktestingDashboard.tsx | 34 +++++++----- 10 files changed, 179 insertions(+), 68 deletions(-) diff --git a/web-dashboard/src/components/charts/CandlestickChart.tsx b/web-dashboard/src/components/charts/CandlestickChart.tsx index bc953cb17..854ecfe35 100644 --- a/web-dashboard/src/components/charts/CandlestickChart.tsx +++ b/web-dashboard/src/components/charts/CandlestickChart.tsx @@ -1,6 +1,10 @@ import { useEffect, useRef } from 'react'; import { createChart, CandlestickSeries, type IChartApi, type CandlestickData, type Time } from 'lightweight-charts'; +function getCssVar(name: string): string { + return getComputedStyle(document.documentElement).getPropertyValue(name).trim(); +} + interface Props { symbol: string; data?: CandlestickData