Skip to content

feat(report): one year at a time, or all - #73

Merged
danielededo merged 1 commit into
mainfrom
feat/year-filter
Oct 23, 2026
Merged

danielededo merged 1 commit into
mainfrom
feat/year-filter

Conversation

@danielededo

@danielededo danielededo commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

With payslips of several years, the report mixed them all. A person with payslips of two or more years now gets a row of years under their name ("All · 2023 · 2024 · 2025 · 2026"). Choosing one narrows the whole report to that year.

What the year view shows

  • The months, charts, year totals and contract of that year only.
  • A month is still compared with the one before it, even when that one is in the year before: build keeps the full list for insights.Previous.
  • Choosing a year keeps the tab shown. Choosing another person starts on all their years.

How it is built

  • The page now carries Views: for each person, the whole report and one per year.
  • Each view is a <template data-person data-year>. The script swaps them, the same way it swaps people, and re-runs init.
  • The row of years sits inside each view, with its own pressed state.
  • Rendering the year buttons inside each view, instead of in a fixed header, is what keeps each view self-contained.

Synthetic payslips: they take a year (synth -year).

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

  • TestYears covers:
    • three views for two years, with the same choices in each;
    • the 2026 view still comparing January with December 2025;
    • no choice for a single year.
  • New e2e test: three payslips over 2025 and 2026. It chooses 2025 while on "Over time", checks the tab and the months, and goes back to all.

Size

  • Each year duplicates that year's part of the page, so the HTML grows by roughly the size of the report once.

Local checks

  • On top of v0.9.0: gofmt, vet, go test -race, the web unit tests and the 14 e2e tests in Chromium pass.

A person with payslips of several years gets a report of each year
besides the whole, chosen from a row of years under their name: the
months, charts, totals and contract of that year only. A month is still
compared with the one before it, even in the year before. The choice
keeps the tab shown; another person starts on all their years.

The synthetic payslips take a year (synth -year).
@danielededo
danielededo merged commit 21046f4 into main Oct 23, 2026
3 checks passed
@danielededo
danielededo deleted the feat/year-filter branch October 23, 2026 20:49
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