← all branches

fix/bill-parity

safeviewing older commit
4e342d3 · incrementalpre-PRreviewed 2026-07-31 22:43 UTC0H · 0M · 0L · 1I
The branch
Purpose
Bill PDF parity with legacy Smarter/THOR simulated bill (BAT-283, BAT-284)
Goal
Full visual parity across both PDBT (flat tariff) and GDMTH (demand tariff) PDF renders
Sub-goals
  • SG-1: Legacy header + chart-format parity for the render worker (commit 2b602ef4)
  • SG-2: Add Y-axis to the PDBT monthly BarChart (this commit)
The changes (whole branch)
What
Wrapped the PDBT daily consumption BarChart in a chartFrame row with a YAxis on the left, and split XLabels into a matching chartFrame row with a 22pt spacer for alignment.
Why
The PDBT branch was missing the Y-axis that the TOU (GDMTH) chart already had, causing visual asymmetry vs the legacy bill layout.
Areas
packages/bill-pdf+2811domains/cross-domain+295
Blast
3 files, +57/−16 across bill-pdf and cross-domain; PDF-render only, no data pipeline impact.
CI· No PR open; CI not checkedCodeRabbit· No .coderabbit.yaml

Findings · 1

improvement1

info

Duplicate max computation between YAxis and BarChart (pre-existing pattern)

packages/bill-pdf/src/bill-document.tsx:289

YAxis receives Math.max(...daily.map((d) => d.kwh), 1) while BarChart internally recomputes the same value. They are guaranteed identical here (same input array, same floor), so no mismatch risk. The same pattern exists for AreaLine+YAxis (hourly profile) and StackedDemandChart+YAxis (TOU chart). With ≤31 items this is trivial. Could be addressed globally by extracting max once and passing it as a prop to both components — deferred to a cleanup pass.

History · 4 commits

  1. 0868341needs attentionincremental0H · 1M · 2L2026-08-05 22:31
  2. 70da331needs attentionincremental2H · 3M · 6L2026-08-05 20:04
  3. 4e342d3safeincremental0H · 0M · 0L2026-07-31 22:43current
  4. 2b602efneeds attentionfull2H · 3M · 6L2026-07-31 17:41