feat(reports/compare): 8-column table with monthly + cumulative YTD blocks (#104) #109
No reviewers
Labels
No labels
source:analyste
source:defenseur
source:human
source:medic
status:approved
status:blocked
status:in-progress
status:needs-fix
status:ready
status:review
status:triage
type:bug
type:feature
type:infra
type:refactor
type:schema
type:security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: maximus/Simpl-Resultat#109
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-104-compare-eight-col-table"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Mirrors the BudgetVsActualTable rich 8-column structure in the Actual vs actual compare mode (/reports/compare). Both MoM and YoY now surface a Monthly block (reference month vs comparison month) and a Cumulative YTD block (progress through the reference month vs progress through the previous window).
Closes #104.
Key decisions
Files changed
Test plan
Generated with Claude Code
Mirror the BudgetVsActualTable structure in the Actual-vs-Actual compare mode so MoM and YoY both surface a Monthly block (reference month vs comparison month) and a Cumulative YTD block (progress through the reference month vs progress through the previous window). - CategoryDelta gains cumulative{Previous,Current}Amount and cumulativeDelta{Abs,Pct}. Legacy previousAmount / currentAmount / deltaAbs / deltaPct are kept as aliases of the monthly block so the Highlights hub, Cartes dashboard and ComparePeriodChart keep working unchanged. - getCompareMonthOverMonth: cumulative-previous window ends at the end of the previous month within the SAME year; when the reference month is January, the previous window sits entirely in the prior calendar year (Jan → Dec). - getCompareYearOverYear: now takes an optional reference month (defaults to December for backward compatibility). Monthly block compares the single reference month across years; cumulative block compares Jan → refMonth across years. - ComparePeriodTable rebuilt with two colspan header groups, four sub-columns each, a totals row and month/year boundary sub-labels. - ComparePeriodChart unchanged: still reads the monthly primary fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>Revue — APPROVE ✅
Verdict
Refonte substantielle et bien structurée. Le tableau Réel-vs-Réel réplique fidèlement la structure 8 colonnes du tableau Réel-vs-Budget, avec des sémantiques cumulatives documentées et testées.
Points validés
CategoryDeltaétendu aveccumulativePreviousAmount/cumulativeCurrentAmount/cumulativeDeltaAbs/cumulativeDeltaPct. Champs legacy conservés comme alias du bloc mensuel → aucune régression pour Highlights, Cartes top-movers, ComparePeriodChart.CASE WHENpar fenêtre — efficace, pas d'interpolation.getCompareYearOverYear(year, month=12)—monthoptionnel avec défaut pour backward-compat (bien queuseComparepasse toujours explicitement).cumulativeCurrentLabel/cumulativePreviousLabeldistinguent clairement les fenêtres (→ mars 2026MoM,2026 → mars 2026YoY). Lisibilité bonne en FR et EN.deltaAbs/deltaPctdu bloc mensuel.Changed/Modifié.Point d'attention (non-bloquant)
La sémantique YoY monthly block est maintenant "même mois l'an dernier" (via refMonth) au lieu de "année entière vs année entière". C'est exactement ce que demandait l'issue, mais c'est un changement de comportement visible : si un utilisateur avait bookmarké l'onglet YoY, il verra désormais un seul mois dans le bloc mensuel. Le bloc cumulatif couvre la comparaison YTD complète, donc l'info n'est pas perdue — juste réorganisée.
Vérifications locales
npm test -- --run: 103/103 verts (3 nouveaux)npm run build: ✅ (5.17s)Stats
ComparePeriodTable.tsx(+221 lignes pour la refonte visuelle).Rien ne bloque le merge.