whisper-money/resources/js/pages
Víctor Falcón 3d5823728a
feat(settings): centralize currency options and split profile/account support (#256)
## Summary

- **Bug fix:** Dashboard and accounts index cards displayed the
account's original currency code (e.g. `BTC`) even though balances were
already converted to the user's currency (e.g. `EUR`). Now passes
`displayCurrencyCode` to card components so the label matches the
converted amount.
- **Feature:** Added a currency toggle on the account detail chart to
switch between the account's native currency and the user's main
currency. Extends the balance evolution APIs with `display_*` fields
when conversion applies.
- **First-account restriction:** Restricts first-account creation to
primary (fiat) currencies only, ensuring the user's base currency is
always widely supported.

## Changes

### Bug fix — currency label on cards
- `AccountBalanceCard` / `AccountListCard`: Added `displayCurrencyCode`
prop; all amount renders now use it instead of `account.currency_code`
- `dashboard.tsx`: Passes `netWorthEvolution.currency_code` as
`displayCurrencyCode`
- `Accounts/Index.tsx`: Passes `auth.user.currency_code` as
`displayCurrencyCode`

### Backend — API extension
- `DashboardAnalyticsController`: Both `accountBalanceEvolution()` and
`accountDailyBalanceEvolution()` now return `display_value`,
`display_invested_amount`, `display_mortgage_balance` per data point and
a top-level `display_currency_code` when the account currency differs
from the user's

### Frontend — currency toggle
- New `ChartCurrencyToggle` component with `ToggleGroup` showing
currency code labels (e.g. `BTC` / `EUR`)
- `ChartSettingsPopover`: Extended with optional `currencyToggle` prop
for mobile
- `AccountBalanceChart`: Full integration — all amounts, trends,
tooltips, MoM chart, and equity swap to `display_*` values when toggle
is set to user currency

### First-account currency restriction
- `StoreAccountRequest`: First account limited to primary currency codes
- `AccountForm` / `CreateAccountDialog` / `StepCreateAccount`: Pass
`usePrimaryCurrenciesOnly` when applicable

### Tests
- 5 new Pest tests for `display_*` fields in balance evolution endpoints
- 3 new Vitest tests for `deriveAccountMetrics` (mixed-currency, empty
data, invested amounts)
- 1 new Pest test for first-account BTC rejection
2026-04-02 19:23:10 +02:00
..
Accounts feat(settings): centralize currency options and split profile/account support (#256) 2026-04-02 19:23:10 +02:00
auth feat: Spanish localization (#74) 2026-02-08 11:58:08 +01:00
budgets feat(mobile): add scroll-aware back button on detail pages (#194) 2026-03-03 19:21:49 +00:00
cashflow feat(cashflow): make income/expense category rows clickable to transactions (#234) 2026-03-17 10:57:40 +00:00
onboarding feat: (Onboarding) add categorization intro screen with benefit cards (#201) 2026-03-05 11:47:12 +01:00
open-banking feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00
settings feat(settings): centralize currency options and split profile/account support (#256) 2026-04-02 19:23:10 +02:00
subscription feat(pricing): update landing page pricing table (#207) 2026-03-05 13:39:52 +00:00
transactions fix(haptics): use a local WebHaptics wrapper (#225) 2026-03-16 11:26:04 +00:00
waitlist feat(waitlist): waiting list with referral system (#199) 2026-03-04 12:36:47 +01:00
dashboard.tsx feat(settings): centralize currency options and split profile/account support (#256) 2026-04-02 19:23:10 +02:00
privacy.tsx Remove plaintext-transactions feature flag & E2E references (#116) 2026-02-13 11:10:21 +01:00
terms.tsx Replace E2E encryption mentions with privacy-first messaging (#124) 2026-02-14 16:59:50 +01:00
welcome.tsx feat(landing): billing period toggle with yearly discount on pricing section (#215) 2026-03-08 18:33:40 +00:00