Skip to content

feat(dashboard): add battery endurance tracker widget#219

Merged
jacobjurek merged 3 commits into
mainfrom
jacobjurek/battery-endurance-widget
Jun 20, 2026
Merged

feat(dashboard): add battery endurance tracker widget#219
jacobjurek merged 3 commits into
mainfrom
jacobjurek/battery-endurance-widget

Conversation

@jacobjurek

Copy link
Copy Markdown
Contributor

Full-width gr26 BCU dashboard widget for monitoring the accumulator lap-by-lap during an endurance event.

Changes

  • New "Battery Endurance Tracker" widget (gr26 → BCU, span 12), registered in registry.tsx.
  • Manual lap capture (Lap +1) snapshots current live SOC / min cell voltage / max cell temp.
  • Lap table with per-lap deltas and % change; latest row highlighted; stale-capture flagging.
  • Projection cards: laps until max cell temp > 60 °C, SOC < 20 %, SOC = 0 %, from trailing per-lap rates (color-toned by urgency).
  • Statistics: per-signal min/avg/max, avg lap time, and regression-projected SOC/V/T at the 35-min mark.
  • Graph: 0–35 min dual-axis voltage/temperature line chart (data via /query/pairs) with dashed regression projection lines extended to each boundary, plus 60 °C / voltage-floor reference lines and a finish marker.
  • Persistence: localStorage key battery_endurance_v1_<vehicleId>. Survives page refresh and Sentinel token expiry — the persisted table is decoupled from the live socket (uses useLiveSignals directly rather than wrapping LiveWidget), so it stays visible when the connection drops.
  • Editable thresholds (temp max, SOC low, cell-V floor), persisted with the event.
  • New dashboard/src/lib/batteryEndurance.ts (state/persistence + least-squares regression and projection math) with unit tests.

Verification

  • npm run build, tsc --noEmit, eslint --max-warnings 0 clean; 14 unit tests pass (batteryEndurance.test.ts).
  • Manually verified against the local stack: widget renders for GR26, lap capture + table persist across refresh and after clearing sentinel_access_token.

jacobjurek and others added 3 commits June 20, 2026 10:28
Lap-by-lap SOC, min cell voltage, and max cell temperature with boundary projections (laps until >60C, <20% SOC, 0% SOC), per-lap deltas/% change, event statistics, and a 0-35 min voltage/temperature graph with regression projection lines. Manual lap capture persists to localStorage so the table survives page refresh and Sentinel token expiry. Registered as a full-width gr26 BCU widget.
@jacobjurek jacobjurek merged commit e20172d into main Jun 20, 2026
17 checks passed
@jacobjurek jacobjurek deleted the jacobjurek/battery-endurance-widget branch June 20, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant