Commit Graph

16 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 82b94eafe1 Add recharts dependency for dashboard visualizations 2025-12-01 10:30:26 +01:00
Víctor Falcón 5cfe3c81a1 Better input field UX 2025-11-26 11:24:37 +01:00
Víctor Falcón bec18b925b Add account balances 2025-11-15 20:27:18 +01:00
Víctor Falcón 32c3b32804 Context menu to tables 2025-11-15 13:57:10 +01:00
Víctor Falcón e13a19bdde Add some toast notifications 2025-11-11 11:39:28 +00:00
Víctor Falcón 71b8d69020 Migrate IndexDB integration to use Dexie 2025-11-11 08:25:50 +00:00
Víctor Falcón d5ce7a24b4 Automation rules 2025-11-10 12:08:58 +00:00
Víctor Falcón ea9cec184f Bulk actions on transactions 2025-11-10 10:02:28 +00:00
Víctor Falcón faf6d9146e Sync transactions 2025-11-08 14:17:16 +00:00
Víctor Falcón dd0f1380d4 Import CSV 2025-11-08 14:17:11 +00:00
Víctor Falcón 9d95f884a0 Offline First: sync bank, accounts, and categories 2025-11-08 11:29:21 +00:00
Víctor Falcón b9679b9328 Settings: add account view 2025-11-07 21:38:23 +00:00
Víctor Falcón 689666e0f5 Categories 2025-11-07 17:38:57 +00:00
Víctor Falcón 2c0a5bd9a7 Add encryption key management features 2025-11-07 16:10:56 +00:00
Víctor Falcón fb140bbece Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00