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 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-02-22 09:22:34 +01:00
parent c7d336ec59
commit cab4fcda4c
10 changed files with 179 additions and 68 deletions

View File

@@ -1,6 +1,7 @@
import { useWebSocket } from '../../hooks/useWebSocket';
import { useAuth } from '../../hooks/useAuth';
import { getTokenClaims } from '../../lib/auth';
import { wsManager } from '../../lib/websocket';
const EMPTY_TOPICS: string[] = [];
@@ -19,7 +20,18 @@ export function StatusBar() {
}`}
aria-hidden="true"
/>
WS: {connected ? 'Connected' : 'Disconnected'}
WS: {connected ? 'Connected' : (
<>
Disconnected
<button
onClick={() => wsManager.reconnect()}
className="ml-1 px-1.5 py-0.5 rounded text-[var(--color-accent)] hover:bg-[var(--color-accent)]/10 transition-colors"
aria-label="Reconnect WebSocket"
>
Reconnect
</button>
</>
)}
</span>
{authenticated && claims && (
<span>User: {claims.sub}</span>