diff --git a/docs/adr/0007-reports-hub-refactor.md b/docs/adr/0007-reports-hub-refactor.md index 58031d9..c62c070 100644 --- a/docs/adr/0007-reports-hub-refactor.md +++ b/docs/adr/0007-reports-hub-refactor.md @@ -4,6 +4,8 @@ - Date: 2026-04-14 - Milestone: `spec-refonte-rapports` +> **Amendment of 2026-10-27 (#479)** — the default reporting period changes; the shared, bookmarkable query-string period and the rest of this decision are unchanged. Without any period in the URL, the Reports now open on « Cette année » (`period=year`: January 1st to today, the year to date, as on the Dashboard) instead of the whole current civil year under « Personnalisé » (`custom`), and a `custom` period without two valid dates falls back to it too. `period=all` (« Tout ») now reaches every date: `resolveReportsPeriod` leaves `from` and `to` absent instead of substituting the civil year, so no bounds are sent to the services (`getCategoryZoom` binds the missing bounds as NULL and skips them). + ## Context The original `/reports` page exposed five tabs (`trends`, `byCategory`, `overTime`, `budgetVsActual`, `dynamic`) as independent analytic views backed by a single monolithic `useReports` hook. Three problems built up over time: @@ -26,7 +28,7 @@ Refactor `/reports` into a **hub + four dedicated sub-routes**, wired to a share /reports/category → single-category zoom with rollup ``` -All pages share the reporting period through the URL query string (`?from=YYYY-MM-DD&to=YYYY-MM-DD&period=...`), resolved by a pure `resolveReportsPeriod()` helper. Default: current civil year. The query string approach is deliberately **not** a React context — it keeps the URL bookmarkable and stays consistent with the rest of the project, which does not use global React contexts for UI state. +All pages share the reporting period through the URL query string (`?from=YYYY-MM-DD&to=YYYY-MM-DD&period=...`), resolved by a pure `resolveReportsPeriod()` helper. Default: current civil year *(until #479; see the amendment at the top)*. The query string approach is deliberately **not** a React context — it keeps the URL bookmarkable and stays consistent with the rest of the project, which does not use global React contexts for UI state. ### Per-domain hooks