fix(cli): show real timer units, readable durations and fractions in gram view #38

Merged
abiwab merged 4 commits from fix/cli-view-timer-units into main 2026-09-29 11:28:58 +02:00
Owner

Closes #25

Root cause is in packages/cli, not the renderer: the timer unit lives on the token (item.unit), but the CLI read quantity.unit and fell back to min.

  • gram view and cook mode show the real timer unit (~{1h} → ~1h, ~{20s} → ~20s)
  • formatDuration rounds to the minute from 1h up and to the second below (64.5 → 1h 5m, 25.08 → 25m 5s)
  • resting time now shows in the header (the view model set idle while the header read rest)
  • common fractions stay fractions in the shopping list (1/4 càc, not 0,3)
  • new renderer helpers formatTimer and toCommonFraction, documented in the API reference (EN/FR)

Not changed: renderer HTML/Markdown timer output (already correct, snapshots untouched), ui/diff.ts and EndScreen duration formats.

Checks: build, typecheck, lint, 1090 tests and 94 conformance cases pass.

Closes #25 Root cause is in `packages/cli`, not the renderer: the timer unit lives on the token (`item.unit`), but the CLI read `quantity.unit` and fell back to `min`. - `gram view` and cook mode show the real timer unit (`~{1h}` → `~1h`, `~{20s}` → `~20s`) - `formatDuration` rounds to the minute from 1h up and to the second below (`64.5` → `1h 5m`, `25.08` → `25m 5s`) - resting time now shows in the header (the view model set `idle` while the header read `rest`) - common fractions stay fractions in the shopping list (`1/4 càc`, not `0,3`) - new renderer helpers `formatTimer` and `toCommonFraction`, documented in the API reference (EN/FR) Not changed: renderer HTML/Markdown timer output (already correct, snapshots untouched), `ui/diff.ts` and `EndScreen` duration formats. Checks: build, typecheck, lint, 1090 tests and 94 conformance cases pass.
abiwab scheduled this pull request to auto merge when all checks succeed 2026-09-29 11:28:38 +02:00
abiwab merged commit c362d313e0 into main 2026-09-29 11:28:58 +02:00
abiwab deleted branch fix/cli-view-timer-units 2026-09-29 11:28:59 +02:00
Sign in to join this conversation.
No description provided.