feat(budget) : adopter le repli multi-niveaux sur la grille Budget #293

Open
maximus wants to merge 1 commit from issue-289-budget-collapse into issue-288-collapse-socle
Owner

Resolves #289

Stacks on #292 (issue #288's collapse socle) — base is issue-288-collapse-socle, NOT main. Review/merge #292 first.

Summary

  • Budget grid now collapses/expands at every category level (reversing #278), opens fully collapsed, and gets a one-click "Expand all" — reusing the #288 useCollapsibleGroups socle with accessors declared inline (no budgetTableModel.ts).
  • Section subtotals switched to the tested sumLeavesForType on the raw group, so folding is purely visual; STORAGE_KEY renamed to budget-subtotals-position to decouple from the real-vs-budget report.
  • Extracted the pure buildBudgetYearRows from useBudget and pinned its level-order (BFS) emission with a regression test — the invariant the abandoned v1 collapse plan got wrong.

Build clean (0 TS errors), 828 vitest pass, cargo check clean.

Generated autonomously by /autopilot run of 2026-07-15

Resolves #289 **Stacks on #292** (issue #288's collapse socle) — base is `issue-288-collapse-socle`, NOT `main`. Review/merge #292 first. ## Summary - Budget grid now collapses/expands at **every** category level (reversing #278), opens **fully collapsed**, and gets a one-click "Expand all" — reusing the #288 `useCollapsibleGroups` socle with accessors declared inline (no `budgetTableModel.ts`). - Section subtotals switched to the tested `sumLeavesForType` on the **raw** group, so folding is purely visual; `STORAGE_KEY` renamed to `budget-subtotals-position` to decouple from the real-vs-budget report. - Extracted the pure `buildBudgetYearRows` from `useBudget` and pinned its **level-order (BFS)** emission with a regression test — the invariant the abandoned v1 collapse plan got wrong. Build clean (0 TS errors), 828 vitest pass, `cargo check` clean. Generated autonomously by /autopilot run of 2026-07-15
maximus added 1 commit 2026-07-16 01:16:35 +00:00
Reverse #278's deliberate no-collapse decision for the budget grid: it now
folds/unfolds at every category level like the hierarchical reports, opening
fully collapsed with a one-click "Expand all".

- BudgetTable: wire useCollapsibleGroups (defaultExpanded: false), inline
  BUDGET_COLLAPSE_ACCESSORS + BUDGET_EXPANDED_KEY (mirrors ComparePeriodTable /
  BudgetVsActualTable — no budgetTableModel.ts). Chevron + aria-expanded +
  aria-level on every parent row; groups.visible(group) before reorderRows.
- BudgetTable: section subtotal now uses the tested sumLeavesForType on the RAW
  group (drop-in for the hand-rolled loop) so folding stays purely visual.
- BudgetTable: rename STORAGE_KEY to "budget-subtotals-position", decoupling the
  subtotals-position preference from BudgetVsActualTable (they collided).
- useBudget: extract the pure buildBudgetYearRows(); the grid's rows are
  level-order (BFS), not DFS — document the invariant and pin it in a test, since
  the #288 ancestor-walk collapse is order-independent (the v1 plan assumed DFS
  and would have broken here).
- Tests: useBudget.test.ts locks the level-order emission, the DFS-killer, the
  end-to-end multi-level collapse on real builder output, and that subtotals sum
  raw rows regardless of collapse. 828 vitest pass.

Resolves #289

Generated autonomously by /autopilot run of 2026-07-15
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maximus added the
autopilot:pending-human
label 2026-07-16 01:16:52 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-289-budget-collapse:issue-289-budget-collapse
git checkout issue-289-budget-collapse

Merge

Merge the changes and update on Forgejo.
git checkout issue-288-collapse-socle
git merge --no-ff issue-289-budget-collapse
git checkout issue-288-collapse-socle
git merge --ff-only issue-289-budget-collapse
git checkout issue-289-budget-collapse
git rebase issue-288-collapse-socle
git checkout issue-288-collapse-socle
git merge --no-ff issue-289-budget-collapse
git checkout issue-288-collapse-socle
git merge --squash issue-289-budget-collapse
git checkout issue-288-collapse-socle
git merge --ff-only issue-289-budget-collapse
git checkout issue-288-collapse-socle
git merge issue-289-budget-collapse
git push origin issue-288-collapse-socle
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: maximus/Simpl-Resultat#293
No description provided.