whisper-money/app/Http/Controllers
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
..
Api Accounts: new pages to list, and see account details (#13) 2025-12-05 14:33:18 +01:00
Settings Update automated rule timestamp when adding/removing a category or label 2025-12-15 14:30:35 +01:00
Sync feat: add multiple chart view modes for net worth evolution (#37) 2025-12-30 07:22:19 +01:00
AccountBalanceController.php Accounts: new pages to list, and see account details (#13) 2025-12-05 14:33:18 +01:00
AccountController.php Accounts: new pages to list, and see account details (#13) 2025-12-05 14:33:18 +01:00
Controller.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
DashboardController.php Add dashboard analytics backend 2025-12-01 10:30:35 +01:00
EncryptionController.php Remove unused controllers and routes (#11) 2025-12-04 08:48:17 +01:00
OnboardingController.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
RobotsController.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
SitemapController.php SEO landing page 2025-11-25 11:33:11 +01:00
SubscriptionController.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
TransactionController.php Bulk actions/select all (#33) 2025-12-15 17:59:58 +01:00
UserLeadController.php Add lead tracking webhook implementation 2025-11-25 12:13:29 +01:00