feat: open the Reports on « Cette année » and let « Tout » reach every date (#479) #517

Merged
maximus merged 5 commits from issue-479-reports-period-filters into main 2026-10-30 00:39:11 +00:00

5 commits

Author SHA1 Message Date
le king fu
4d1ac59c1a docs(adr): amend ADR 0007 for the default Reports period (#479)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m24s
ADR 0007 still said « Default: current civil year. » for the shared
reporting period, a fact this PR makes false. A dated amendment under
the header list, in the ADR's language and on the pattern of ADR 0017
and ADR 0018, records what changes: the Reports open on « Cette année »
(`period=year`, January 1st to today), a `custom` period without two
valid dates falls back to it, and `period=all` reaches every date, no
bounds being sent to the services. The stale sentence stays, pointed
to the amendment, as ADR 0018 annotates a stale passage. The rest of
the ADR is unchanged.

Resolves #479

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:20:17 -04:00
le king fu
9b03a710e9 test: fix the day of the Reports period tests in local time (#479)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m35s
resolveReportsPeriod reads the local date of the day it is given, and
the fixture was noon UTC: April 15 already in UTC+12 and beyond. Harmless
while the tests only read the year, it turned six of the new exact-date
cases red under TZ=Pacific/Auckland (found in the self-review, replayed).
The fixture is now local noon, April 14 in every time zone; the seven
test files of #479 pass from UTC-11 to UTC+14.

Resolves #479

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:13:07 -04:00
le king fu
a877f080b1 docs(state): manual check of the Reports period (#479)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 2m24s
One sub-bullet at the end of « Vérifications dues à la release
suivante »: the Reports opened without any parameter on « Cette année »,
« Tout » on Trends, Category Analysis and Compare, the two texts, in
French and in English. The unit tests mock the database and the router,
and the SQLite replay runs the zoom's SQL with python3: none of them
runs tauri-plugin-sql's NULL binding nor the pages in the app.
Procedure in the body of PR #517.

Resolves #479

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:10:08 -04:00
le king fu
f1fd4829c7 docs: the Reports period in the user guide and changelogs (#479)
docs/guide-utilisateur.md, section Rapports:
- the hub's second question reads « où je vais, mois par mois ? »
  (wording fixed by Max, 2026-10-27), like the Trends card;
- the shared period selector names its URL parameters: `?period=…` for
  a preset, such as `?period=year` for « Cette année » or `?period=all`
  for « Tout », and `?period=custom&from=…&to=…` for a custom period;
  the Reports opened without any parameter show « Cette année ».

No `docs.*` key describes the default period or the Trends question
(checked); docs/architecture.md cites no fact this change makes false.

CHANGELOG.md / CHANGELOG.fr.md, under [Unreleased]:
- Changed / Modifié: the Reports open on « Cette année » (the year to
  date), the help tip and the Trends card no longer say "12 months",
  and on Compare the rolling presets chosen right after opening no
  longer move the reference month (they end today, like the default);
- Fixed / Corrigé: « Tout » shows every date on Trends and Category
  Analysis, and no longer moves the reference month of Compare to
  December of the current year.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:04:40 -04:00
le king fu
ce25ddc191 feat: open the Reports on « Cette année » and let « Tout » reach every date (#479)
Without any period in the URL, the Reports opened on the whole calendar
year (January 1st to December 31st, months to come included) under the
« Personnalisé » button. They now open on « Cette année », the year to
date (January 1st to today), as the Dashboard does, with its button lit
(decision 1 of Max, 2026-10-20). « Tout » showed the current calendar
year too: resolveReportsPeriod replaced its empty range by that year.
It now leaves `from` and `to` absent, and the services add no date
clause (decision 2).

- computeDateRange takes `today` as a last optional parameter (default:
  the current day); no existing caller changes, the Dashboard included.
- resolveReportsPeriod: a bookmark with two valid dates is kept as it
  is; a valid preset other than `custom` gets its range for `today`
  (`all`: none); anything else (no parameter, an invalid period,
  `custom` without two valid dates) falls back to « Cette année ».
  currentYearRange is gone; `from` and `to` are optional in
  UseReportsPeriodResult.
- getCategoryZoom takes optional bounds: its four queries skip a bound
  bound to NULL, `($2 IS NULL OR t.date >= $2) AND ($3 IS NULL OR
  t.date <= $3)`, with the same parameters in the same order
  ([id, from ?? null, to ?? null]). In the per-child query the
  condition stays in the LEFT JOIN's ON, so a subcategory without any
  transaction in the period keeps its row (total 0).
- useTrends and useCategoryZoom pass absent bounds through.
- useCompare: syncReferenceOnPeriodChange takes an absent `to`; on
  « Tout » the reference month shown does not move, and a later switch
  to a dated period syncs it to the end of that period (decision of
  Max, 2026-10-27). The ref is typed `string | undefined`, so a direct
  opening on ?period=all works.
- Texts fixed by Max (2026-10-27): reports.help.tips[2] and
  reports.hub.trendsDescription, FR and EN, no longer say "12 months":
  Trends follows the period selector.

Tests: the default, a custom bookmark, `custom` without dates, a preset
and `all` resolved for a fixed day; computeDateRange with `today`;
getCategoryZoom without bounds ([42, null, null] in every query, no
bare date condition), with bounds, and the per-child bounds in the ON;
the sync on « Tout »; wiring tests (src/test/hookHarness.ts) of
useCompare (mount on « Cette année » or « Tout », « Tout » then a dated
period, a user-picked month kept), useTrends (both views) and
useCategoryZoom (absent bounds reach the service).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:04:27 -04:00