Skip to content

Redesign the report, and print money in each currency's own decimals - #3

Merged
rlaope merged 5 commits into
mainfrom
design/report-v3
Sep 25, 2026
Merged

rlaope merged 5 commits into
mainfrom
design/report-v3

Conversation

@rlaope

@rlaope rlaope commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Currency: new jeval/currency.py formats money in each currency's ISO 4217 decimals. KRW 38,524,590.16 becomes KRW 38,524,590. The report slider follows the same rules, and a node-run parity test checks that the JS and Python output match.
  • Report redesign:
    • New type, colour and scale: serif headings, sans body, tabular figures. Warm paper palette with its own dark palette. Blue is used only for the recommended threshold and vermilion only for the line in use; the pair is validated for colour-vision deficiency.
    • Verdict threshold ruler, and key figures beside the reliability chart.
    • Cost chart labels no longer collide.
    • Charts render at the size they were drawn for instead of stretching.
    • Tables: text left, numbers right, and change-direction marks in the change column.
    • Phone layout for the ruler and charts.
  • Fix: the verdict labelled the line in use as "auto below it"; cases at or above the threshold run automatically, and the label now says so.
  • Examples and docs: the demo screen and workbench are restyled in the same design language. README rebuilt with theme-aware screenshots and a section on how money is written.

Test plan

  • uv run pytest (all pass, none skipped; includes the new currency, parity, wiring and regression tests)
  • uv run ruff format --check ., uv run ruff check ., uv run mypy jeval
  • Golden SVGs regenerated deliberately. Test assertions were updated only for the new money format and the new markup; no tolerance was widened.
  • Visual check with Playwright: 1280 light/dark, 390 mobile, and edge cases (line in use near 0 or at the minimum, JPY/USD)

KRW and JPY have no minor unit, so "KRW 38,524,590.16" printed cents the won does not have.
jeval/currency.py formats amounts from the ISO 4217 minor-unit table: none for KRW and JPY, three
for BHD, KWD and the rest of the three-decimal currencies, two otherwise. An average smaller than
one minor unit keeps two significant figures instead of rounding to zero, a free-form unit such as
"credits" is printed as written, and halves round away from zero, which is what a browser's
toFixed does, so a table and the live readout under it agree on every tie. Compact figures carry
three significant figures and move up a suffix rather than reading "1000k".

The module is presentation only: it never converts between currencies and never guesses one from
a locale. `--currency krw` is normalised to KRW.

Signed-off-by: rlaope <[email protected]>
Cases run automatically when confidence >= threshold (jeval/costs.py), but the verdict labelled the
threshold in use "auto below it".

Signed-off-by: rlaope <[email protected]>
The report reads as a technical document: a masthead with provenance as a definition list, a
numbered section index, a serif for headings over a sans for reading, tabular lining figures
instead of monospace digits, a warm paper palette and a separately chosen dark one. No web font is
loaded; each stack names the best face a reader is likely to have.

Colour carries two meanings only: blue for the recommended threshold and vermilion for the line in
use, a pair validated for colour-vision deficiency. Data is drawn in greys.

- The verdict draws both lines on one 0-1 ruler with the recommendation's 95% interval, and a phone
  gets its own narrow drawing.
- The reliability chart has ECE with its interval, MCE, Brier, n and the widest gap beside it.
- The cost curve names both lines in a lane above the plot and places point labels where the curve
  leaves room, checked against segments rather than vertices.
- Charts render at their drawn size instead of stretching labels with the column.
- Tables align text left and numbers right, wrap long reasons, and mark each change with a
  direction and, backed by a title, whether it helps.
- The slider formats money through the same rules as jeval.currency, and a node-run test compares
  the two on the same inputs.
- The phone layout is scoped to screen so it cannot leak into print, and the dark palette remaps
  ink polygons too.

Signed-off-by: rlaope <[email protected]>
…nguage

Same palette, type and currency formatting as the report; the committed artifacts are rebuilt from
the scripts, and examples/report-example.html is regenerated with the documented command.

Signed-off-by: rlaope <[email protected]>
Theme-aware screenshots, a section on how money is written, the quoted KRW figures without the
minor unit the won does not have, the shared design language in examples/README.md, and
jeval/currency.py in the CLAUDE.md architecture map.

Signed-off-by: rlaope <[email protected]>
@rlaope
rlaope merged commit 40cdce0 into main Sep 25, 2026
5 checks passed
@rlaope
rlaope deleted the design/report-v3 branch September 25, 2026 11:20
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