Skip to content

Dashboard income mini: multi-currency + smart 2-col layout#176

Merged
fleveque merged 1 commit into
mainfrom
fix/dividend-income-mini-multi-currency
May 25, 2026
Merged

Dashboard income mini: multi-currency + smart 2-col layout#176
fleveque merged 1 commit into
mainfrom
fix/dividend-income-mini-multi-currency

Conversation

@fleveque

Copy link
Copy Markdown
Owner

Two follow-ups on the dashboard polish from #175 — reported during a live walkthrough with multi-currency data.

Multi-currency income mini

Bug. DividendIncomeMini picked a single currency (preferred, fallback to first) and ignored the rest. A user with EUR + USD dividends only saw one currency's data.

Fix. One row per currency the user has actual income in, sorted by 12-month total, capped at 3 with a "+N more currencies" overflow note. Each row shows currency code, both "This month" and "Last 12 months" totals on the header line, and a full-width 12-bar sparkline with the current month highlighted.

Smart 2-col upcoming + income layout

Bug. The dashboard had <UpcomingExDividends> and <DividendIncomeMini> stacked vertically (a defensive choice from the first review pass because a missing sibling in a 2-col grid was leaving a blank gap).

Fix. Lifted the empty-state checks into DashboardHome (mirrors the in-window filter inside UpcomingExDividends; counts any past-month actual > 0 across currencies for the mini), then toggles the grid class:

  • both have data → lg:grid-cols-2 (income left, upcoming ex-divs right)
  • only one has data → drops the grid-cols class, surviving block goes full-width
  • both empty → omits the whole row

Verified visually in both states (faked a near ex-div temporarily to evaluate the side-by-side, removed before commit).

Test plan

  • npx tsc --noEmit — clean
  • Manual: account with dividends in multiple currencies → mini shows one row per currency, sorted by 12m total
  • Manual: account with a near ex-div + dividend history → 2-col layout, income left + upcoming right
  • Manual: account with income but no near ex-div → income takes full width, no blank gap
  • Manual: account with neither → whole row is omitted

🤖 Generated with Claude Code

Two related fixes on the post-#175 dashboard:

**Multi-currency income mini.** The mini previously picked a single
currency (preferred, with a fallback to the first available) and
ignored the rest — so a user with EUR + USD dividends only saw one
of them. Rewrote to render one row per currency the user has actual
income in, sorted by 12-month total, capped at 3 rows with a
"+N more currencies" overflow hint. Each row shows the currency
code, "This month" + "Last 12 months" totals on the header line,
and a full-width 12-bar sparkline below with the current month
highlighted.

**Smart 2-col upcoming + income layout.** When both blocks have
data the row uses `lg:grid-cols-2` (income on the left, upcoming
ex-divs on the right). When only one has data the wrapper drops
the grid-cols class so the surviving block spans full width
instead of leaving a blank column. Empty-state checks are lifted
to the parent (mirrors UpcomingExDividends' in-window filter;
checks any past-month actual > 0 across currencies for the mini)
and the whole row is omitted when both are empty.

i18n: `incomeMini.thisMonth` kept, added pluralised
`incomeMini.moreCurrencies_one/_other` in en + es.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fleveque fleveque merged commit 33041db into main May 25, 2026
5 checks passed
@fleveque fleveque deleted the fix/dividend-income-mini-multi-currency branch May 25, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant