whisper-money/resources/js/components
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
..
accounts feat: add multiple chart view modes for net worth evolution (#37) 2025-12-30 07:22:19 +01:00
automation-rules fix: Automated rules with labels (#32) 2025-12-15 13:42:12 +01:00
categories ui: add hasKeyboard prop to modals 2025-12-30 07:22:19 +01:00
charts feat: add multiple chart view modes for net worth evolution (#37) 2025-12-30 07:22:19 +01:00
dashboard feat: add multiple chart view modes for net worth evolution (#37) 2025-12-30 07:22:19 +01:00
icons Subscriptions (#15) 2025-12-06 19:09:56 +01:00
labels ui: add hasKeyboard prop to modals 2025-12-30 07:22:19 +01:00
onboarding Bulk actions/select all (#33) 2025-12-15 17:59:58 +01:00
partials Improve header responsive behavior and refactor class names with cn utility 2025-12-06 20:44:37 +01:00
shared Bulk actions/select all (#33) 2025-12-15 17:59:58 +01:00
transactions ui(fix): transaction filters on small screens 2025-12-30 07:22:19 +01:00
ui ui(fix): add hasKeyboard prop to dialogs 2025-12-30 07:22:19 +01:00
alert-error.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
app-content.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
app-logo-icon.tsx Automated rules labels (#30) 2025-12-15 12:11:55 +01:00
app-logo.tsx Add animated logo icon that transitions based on encryption key state 2025-12-12 11:24:42 +01:00
app-mobile-nav.tsx Mobile design (#17) 2025-12-08 15:43:09 +01:00
app-shell.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
app-sidebar-header.tsx Format + Open transactions on row click 2025-12-08 15:58:50 +01:00
app-sidebar.tsx Format + Open transactions on row click 2025-12-08 15:58:50 +01:00
appearance-dropdown.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
appearance-tabs.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
breadcrumbs.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
delete-user.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
encrypted-text.tsx fix: make encryption key storage SSR-safe to prevent 502 errors 2025-12-08 17:13:45 +01:00
encryption-key-button.tsx feat: Update encryption key button icon based on state 2025-11-07 20:20:09 +00:00
heading-small.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
heading.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
icon.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
input-error.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
nav-footer.tsx Subscriptions (#15) 2025-12-06 19:09:56 +01:00
nav-main.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
nav-user.tsx Format + Open transactions on row click 2025-12-08 15:58:50 +01:00
pending-operations-dialog.tsx Add sync now button to pending operations dialog (#27) 2025-12-14 12:50:00 +01:00
sync-status-button.tsx Add sync now button to pending operations dialog (#27) 2025-12-14 12:50:00 +01:00
text-link.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
two-factor-recovery-codes.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
two-factor-setup-modal.tsx Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
unlock-message-dialog.tsx ui(fix): add hasKeyboard prop to dialogs 2025-12-30 07:22:19 +01:00
user-info.tsx Format + Open transactions on row click 2025-12-08 15:58:50 +01:00
user-menu-content.tsx feat: Add privacy mode to hide monetary amounts (#28) 2025-12-14 16:03:02 +01:00