Commit Graph

10 Commits

Author SHA1 Message Date
Víctor Falcón c5df59c285 feat: add multiple chart view modes for net worth evolution (#37)
## Summary

- Add four view modes for net worth and account balance charts:
- **Stacked Accounts**: existing stacked bar chart showing balances by
account
  - **Line**: net worth line chart with linear/log scale toggle
  - **Change**: bar chart showing MoM%, YoY%, Rolling 12M changes
- **Waterfall**: bridge chart showing Start -> Change -> End transition

- Add Vitest for frontend unit testing with 52 tests covering all
calculation functions
- Proper sign handling for liabilities (credit cards and loans subtract
from net worth)
- Log scale disabled with warning when net worth includes zero or
negative values
- Shared components and logic between dashboard and account detail
charts

## New Files

- `vitest.config.ts` - Vitest configuration
- `resources/js/lib/chart-calculations.ts` - Pure computation functions
- `resources/js/lib/chart-calculations.test.ts` - 52 unit tests
- `resources/js/hooks/use-chart-views.ts` - Shared chart view state hook
- `resources/js/components/charts/` - Reusable chart components

## Test plan

- [x] Dashboard net worth chart shows view toggle and all four views
work
- [ ] Account detail page chart shows view toggle and three views work
(no stacked)
- [x] Line chart scale toggle works (log disabled with warning when
applicable)
- [x] Change chart series toggle (MoM, YoY, 12M EUR, 12M %) works
- [x] Waterfall chart month selector works
- [x] All 52 unit tests pass (`bun run test`)
- [x] Build succeeds (`bun run build`)
- [x] Dark mode styling correct
2025-12-30 07:22:19 +01:00
Víctor Falcón 44860941ee undo deploy ci check 2025-12-08 18:31:03 +01:00
Víctor Falcón d4410a67fe fix: deploy ci 2025-12-08 18:27:39 +01:00
Víctor Falcón 4ad965b44e Fix ci deploy 2025-12-08 18:20:22 +01:00
Víctor Falcón aaaba66684 ci: skip deployment if there is another HEAD deploy in queue 2025-12-08 18:14:19 +01:00
Víctor Falcón a13253d32b ci.yml: Remove browser-tests dependency 2025-12-04 10:11:34 +01:00
Víctor Falcón ce3527a2f9 Add GitHub Actions workflow for pull request testing 2025-12-04 10:04:45 +01:00
Víctor Falcón 8a0d27a9df
Execute browser tests on CI (#10) 2025-12-03 16:26:30 +01:00
Víctor Falcón 7773c97b0a Add retry mechanism to GitHub Actions workflow 2025-11-26 13:05:50 +01:00
Víctor Falcón e39336bf76 Add GitHub Actions CI/CD pipeline for Laravel project 2025-11-26 12:35:23 +01:00