fix: order level-4 categories under parent and reduce pie chart space (#23) #26

Closed
medic-bot wants to merge 1 commit from fix/simpl-resultat-23-category-ordering into main
Collaborator

Fixes #23

Summary

  • Level-4 category ordering: Fixed hierarchical sorting in budgetService.ts so that depth-2 categories (e.g. assurance-maison) stay grouped under their intermediate depth-1 parent (e.g. assurance) instead of appearing at the bottom of the section. The sort now correctly handles intermediate parent grouping at all levels.
  • Pie chart space reduction: Changed dashboard grid from equal 1/2 columns to 1/3 pie chart + 2/3 budget table, giving the budget vs actual table more room.
  • Collapsible pie chart legend: The category legend below the pie chart is now collapsed by default with a toggle button to expand it, reducing vertical space usage.

Files changed

  • src/services/budgetService.ts — hierarchical sort fix for parent-child grouping
  • src/pages/DashboardPage.tsx — grid layout adjustment (1fr / 2fr)
  • src/components/dashboard/CategoryPieChart.tsx — smaller chart, collapsible legend
  • src/i18n/locales/fr.json / en.json — added charts.legend key
  • CHANGELOG.md / CHANGELOG.fr.md — changelog entries

Test plan

  • Verify level-4 categories appear directly under their parent in the budget vs actual table
  • Verify the pie chart takes ~1/3 of the width, table ~2/3
  • Verify the legend is collapsed by default and expands on click
  • Verify tooltip still works on pie chart hover
  • Verify subtotals toggle (top/bottom) still works correctly
Fixes #23 ## Summary - **Level-4 category ordering**: Fixed hierarchical sorting in `budgetService.ts` so that depth-2 categories (e.g. assurance-maison) stay grouped under their intermediate depth-1 parent (e.g. assurance) instead of appearing at the bottom of the section. The sort now correctly handles intermediate parent grouping at all levels. - **Pie chart space reduction**: Changed dashboard grid from equal 1/2 columns to 1/3 pie chart + 2/3 budget table, giving the budget vs actual table more room. - **Collapsible pie chart legend**: The category legend below the pie chart is now collapsed by default with a toggle button to expand it, reducing vertical space usage. ## Files changed - `src/services/budgetService.ts` — hierarchical sort fix for parent-child grouping - `src/pages/DashboardPage.tsx` — grid layout adjustment (1fr / 2fr) - `src/components/dashboard/CategoryPieChart.tsx` — smaller chart, collapsible legend - `src/i18n/locales/fr.json` / `en.json` — added `charts.legend` key - `CHANGELOG.md` / `CHANGELOG.fr.md` — changelog entries ## Test plan - [ ] Verify level-4 categories appear directly under their parent in the budget vs actual table - [ ] Verify the pie chart takes ~1/3 of the width, table ~2/3 - [ ] Verify the legend is collapsed by default and expands on click - [ ] Verify tooltip still works on pie chart hover - [ ] Verify subtotals toggle (top/bottom) still works correctly
medic-bot added 1 commit 2026-03-08 19:04:24 +00:00
- Fix hierarchical sorting in budgetService so depth-2 categories stay
  grouped under their intermediate depth-1 parent instead of appearing
  at the bottom of the section.
- Reduce pie chart from 1/2 to 1/3 of dashboard width to give more
  room to the budget vs actual table.
- Collapse pie chart legend by default; expand on click.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
maximus closed this pull request 2026-03-09 23:45:26 +00:00

Pull request closed

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#26
No description provided.