Simpl-Resultat/src/components
le king fu 76ddad66c9 feat(balance): per-security drill-down + latent gain in accounts table (#216)
Surface unrealized (latent) gain on the existing balance surfaces, no new
visualization (decision 2026-06-04).

Service:
- AccountLatestSnapshot gains account `kind` + `latest_snapshot_line_id`, so
  the table knows which rows are detailed and where their holdings live.
- getAccountLatentGainByLine(lineId) folds a line's holdings through the
  existing computeUnrealizedGain (shares the book_cost=0 / NULL -> N/A guard).
- rollupLatentGain(accounts): pure aggregation by asset class, by envelope
  (vehicle_type, 'none' bucket), and grand total; per-bucket % denominator is
  the known book_cost only (null when none), mirroring the aggregate guard.

Hook (useBalanceOverview):
- Prefetches per-detailed-account latent gain in parallel (failures isolated),
  exposes latentGainByAccount + latentGainRollup. Simple accounts skipped.

UI:
- BalanceAccountsTable: expandable detailed rows -> per-security value + latent
  gain %; a latent-gain column (shown only when a detailed account has one);
  a summary block aggregating latent gain by asset class / envelope.
- BalanceOverviewCard: total latent gain line (hidden without detailed accounts).
- N/A rendered (never divide-by-zero) when book_cost is NULL or 0; partial-%
  flag when some positions lack a cost basis.

Native non-CAD currency display de-scoped this round (untestable while all
securities are CAD). Modified Dietz return columns (#204) unchanged.

i18n: balance.latentGain.* in FR + EN. Focused unit tests for
getAccountLatentGainByLine and rollupLatentGain (grouping, 'none' envelope,
null-% / unknown book_cost, empty).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 13:49:57 -04:00
..
adjustments fix(ui): apply WebKitGTK date picker workaround to remaining 7 inputs (#188) 2026-05-03 16:19:20 -04:00
balance feat(balance): per-security drill-down + latent gain in accounts table (#216) 2026-06-06 13:49:57 -04:00
budget fix: remove double sign negation for previous year actuals (#34) 2026-03-11 12:02:58 -04:00
categories feat(categories): add categories standard guide page (#117) 2026-04-20 21:02:38 -04:00
categories-migration feat(categories): add 3-step migration page + categoryMigrationService (#121) 2026-04-20 21:31:21 -04:00
dashboard fix(ui): apply WebKitGTK date picker workaround to remaining 7 inputs (#188) 2026-05-03 16:19:20 -04:00
import fix: replace refresh icon with save icon on update template button 2026-02-16 12:01:14 +00:00
layout feat(balance): add sidebar Bilan entry 2026-04-25 16:07:13 -04:00
profile fix: wrap rehash updateProfile in try/catch for best-effort (#54) 2026-04-09 15:46:27 -04:00
reports feat(reports/cartes): Mensuel/YTD toggle on KPI cards + user guide section (#102) 2026-04-19 09:49:21 -04:00
settings refactor(settings): split monolithic Settings page into 3 sub-pages (#190) 2026-05-03 09:50:02 -04:00
shared fix(reports): render category combobox in hierarchical DFS order (#126) 2026-04-21 20:58:53 -04:00
transactions fix(ui): apply WebKitGTK date picker workaround to remaining 7 inputs (#188) 2026-05-03 16:19:20 -04:00