Skip to content

feat(report): the month as a waterfall, with one line less on top - #75

Merged
danielededo merged 2 commits into
mainfrom
feat/waterfall
Oct 23, 2026
Merged

danielededo merged 2 commits into
mainfrom
feat/waterfall

Conversation

@danielededo

@danielededo danielededo commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two changes to the month, in two commits.

1. "Where your gross pay goes" as a waterfall

This section was a stacked bar with a legend below it. It is now a waterfall: a row per step, from the gross pay down to the net pay. Each row has a span on its own track, which starts where the one before it ended.

The rows

  • Gross pay: a full grey span. Its items open from its row.
  • Added: what is added to the gross, such as an expense refund, a contribution relief or a tax bonus. This row appears only when the payslip has such items. Items that some payroll software leaves out of the gross are listed here, no longer among the gross pay's items.
  • Deductions: one row each for contributions, taxes and the others, shown as negative amounts.
  • Net pay: the blue span that is left.

A rounding under a euro with no item of its own makes no step.

Code

  • The list of items left out of the gross moves from extract/validate.go to payslip.OutsideGross, so that the checks and the report share it.
  • report.Part loses Color and gains From/Width, the span on the track.
  • The colour now comes from a CSS class. html/template blocks a var(...) written in a style attribute.

2. One line less at the top of the month

Before, the month opened with three short lines: "October 2026 ✓ the numbers add up" with the arrows, then "Net pay", then the amount. Now it opens with two:

  • First line: "Net pay for October 2026", with the arrows.
  • Under the amount: "out of 2.194,50 € gross pay · ✓ the numbers add up".

The heading text is built in Go (Month.NetOf), because the template's text map is already formatted.

Type of change

  • New feature (non-breaking)

Checklist

  • Commits follow the commit convention
  • Tests added or updated for the change
  • All tests and linters pass locally
  • Documentation updated (README, docs/, comments) where behavior changed
  • CHANGELOG.md updated under Unreleased for user-visible changes

Notes for the reviewer

Tests

  • TestAddedToGross covers:
    • the added step and its span;
    • a rounding under a euro making no step.
  • The e2e test checks the rows instead of the bar, and reads "Net pay for September 2026".

Checks run locally on top of main after #74 (all pass)

  • gofmt and vet, including vet for wasm;
  • go test -race ./...;
  • piiscan;
  • the 19 web unit tests;
  • the 14 e2e tests in Chromium.

I also looked at it on a phone-sized screen (light and dark) and on desktop.

The month's stacked bar is gone. The rows under "Where your gross pay
goes" now step from the gross pay, through what is added to it (an
expense refund, a contribution relief, a tax bonus), down each deduction
to the net pay; each row has a span on a track that starts where the one
before it ended. The gross pay's items open from its row, and the items
some payroll software leaves out of the gross are listed under what is
added rather than among them. A rounding under a euro with no item of
its own makes no step.

The list of items left out of the gross moves to the payslip package, so
that the checks and the report share it.
The line with the month and whether the numbers add up, and the "Net
pay" label under it, become one line: "Net pay for October 2026", with
the arrows to the month before and after. Whether the numbers add up
moves beside the gross pay under the amount.
@danielededo danielededo changed the title feat(report): where the gross pay goes, as a waterfall feat(report): the month as a waterfall, with one line less on top Oct 23, 2026
@danielededo
danielededo merged commit 219a26f into main Oct 23, 2026
3 checks passed
@danielededo
danielededo deleted the feat/waterfall branch October 23, 2026 22:35
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