From 4d1ac59c1aa0b0e25eb95944af80fb6034cde3fb Mon Sep 17 00:00:00 2001 From: le king fu Date: Tue, 27 Oct 2026 23:20:17 -0400 Subject: [PATCH] docs(adr): amend ADR 0007 for the default Reports period (#479) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- docs/adr/0007-reports-hub-refactor.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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