Skip to content

v0.40.0 — Usage history rework + chart navigation

Choose a tag to compare

@hazptr hazptr released this 22 Jun 04:55
· 9 commits to main since this release

Usage history: server-side aggregation, energy splice, and focused navigation

A ground-up rework of the Usage history interval widget (#145).

Performance

  • /api/interval aggregates in Postgres (reconcile + SUM into the zoom-appropriate bucket), returning ≤600 points instead of hydrating ~20k rows. Wide load ~150–200ms → ~42ms on full-history data; all zoom levels 11–42ms. Short Cache-Control; stale-while-revalidate (no cold-blank).

Energy-correct, finest-grain-by-zoom

  • No more 1h/15m toggle — grain is chosen by the zoom span, always by SUMming adjacent intervals (4×15-min == 1h). An "end of 15-min data" marker shows where the 15-min archive begins; a straddle window renders real 15-min plus flat hourly/4 quarter-steps (no cliff). Hourly→15-min extrapolation only in the genuine straddle. Reconcile never double-counts overlapping grains; the line reaches the latest reading at every grain. In-grid grain pill.

Focused mouse navigation

  • Click to focus (amber ring). Wheel = zoom on cursor; shift/horizontal-wheel = pan; ctrl+drag = move the viewport. Overscan preloads data left/right for smooth, live panning. Modifier cursors (grab / ew-resize). Fixes for macOS horizontal-wheel shift+scroll, the cockpit paginator stealing the gesture, and pan stability.

Notes

  • Display-only: never touches billed numbers; /api/verify unaffected. No schema change (additive query). 930 unit tests; verified on a prod-seeded copy.