Files
accounted/components/kpi
Mattsson c72b8bcee1 feat(kpi): show every month's result in the Resultat per månad pane (#2198)
* feat(kpi): show every month's result in the Resultat per månad pane

A user asked to see the sum for each month on Nyckeltal, not only the
latest bar. The pane now lists the exact net result per month in two
columns under the axis (negatives in terracotta, months after the last
active one muted), and labels every non-zero bar with its compact value
when the twelve labels fit side by side. When they would collide (a
decimal negative like "-3,4 tn" or six-figure months) the bars keep the
single latest label as before; the list always carries the numbers.

The fit rule lives in components/kpi/month-values.ts with a glyph-aware
width estimate so it is deterministic and unit-tested without a DOM.
No preference toggle: the numbers are the default the user asked for.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJUkdbACeRS93Eenr59D3H

* fix(kpi): address skeptic findings on the monthly result pane

- Never label a bar "-0": compact labels use signDisplay negative and
  stay blank under 5 ore, so an oresavrundning-only month shows nothing.
- Mute every month with no result movement, not only the trailing ones,
  so a mid-year start does not print leading no-data months full-strength.
- Measure the latest bar's label at the size it renders (10.5 vs 8) and
  test neighbours pairwise, so the fit rule guarantees what it claims.
- Let the bars pane span two grid rows so the first metric pane no longer
  stretches to fill the taller pane.
- Key the new list rows by position as well as label (18-month years).
- DECISIONS.md: no Anpassa toggle; storno asymmetry between the monthly
  and year-total paths left for a founder call.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJUkdbACeRS93Eenr59D3H

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-02 22:43:11 +02:00
..