Skip to content

Design refinement: align budget app with v3 Pencil mocks#2

Merged
raycashmore merged 23 commits into
mainfrom
design-refinement
May 17, 2026
Merged

Design refinement: align budget app with v3 Pencil mocks#2
raycashmore merged 23 commits into
mainfrom
design-refinement

Conversation

@raycashmore
Copy link
Copy Markdown
Owner

@raycashmore raycashmore commented May 17, 2026

Summary

Closes the visual gap between the budget app and the v3 Pencil designs (design/v2.pen frames a6m9ik desktop / A7fHNX mobile / QPjOt overlay) and lands several functional fixes along the way.

Chart

  • Adds a third bar series (Mortgage) so each month shows Income (wide sage) + Mortgage (dark) + Discretionary (peach stacked on mortgage), matching the design.
  • Mortgage value comes from |budget.variable| + |budget.fixed| per month — the prior mortgage.contrib1+2+3 carry-forward was an order of magnitude larger and swamped the y-axis. With real data this lands around $4.8k/month.
  • Tooltip shows Income / Mortgage / Discretionary / Total spend, color-coded.
  • Switched to ParentSize measurement so axis labels render at real 11px DM Sans (previously a fixed 1200×600 viewBox was stretched with preserveAspectRatio="none", squashing labels to ~5px and garbling month names).
  • X-axis is month-name only (Jun, Jul, …); labels every month when range ≤ 12, sampled otherwise.
  • New legend, tighter group gap, wider left margin for currency labels.

Layout

  • KPI cards: 2×2 grid on mobile, 4-across on desktop, bordered, 26px serif values.
  • Income vs Spending and Monthly breakdown share the left column with flex-1 min-h-0; bottom aligns with Insights panel on desktop.
  • Insights panel: adds the sage "You're in good shape" summary card and the placeholder card fills remaining height.
  • Overlay (MonthlyDetailOverlay) now occupies 85vh with a sticky header and a scrollable body.
  • Sidebar padding/gap tightened; mainArea left padding reduced to match the design's 8px gap.
  • Header title bumped to 36px serif (28px on mobile).

Mobile

  • Page scrolls naturally on mobile instead of being viewport-locked.
  • min-w-0 added to flex children that needed it; chart header wraps; the breakdown table scrolls horizontally inside its card.

Backend

  • listBudgetChart returns a fourth field, mortgage, derived from budgetMortgagePortion(row) = |variable| + |fixed|.
  • joinBudgetWithMortgage renamed to buildMonthlyBreakdown; no longer joins the mortgage table since the value comes from the budget row directly. mortgage is now number instead of number | null.

Test Plan

  • pnpm --filter @repo/convex test — 33 tests pass (includes the new buildMonthlyBreakdown tests covering negative-magnitude and zero cases).
  • pnpm --filter budget test — 23 tests pass.
  • pnpm check-types — clean across all packages.
  • pnpm lint — clean.
  • Browser verification at 1440×900: layout matches design (a6m9ik), columns aligned bottom-to-bottom, axis labels legible, all 8 months labelled.
  • Browser verification at 390×844: KPIs in 2×2 grid, page scrolls, no horizontal overflow, chart card has sensible mobile min-height.
  • Browser verification of overlay: ~85vh, sticky header, scrollable body.

Notes

  • DM Serif Display only ships in one weight; the design's fontWeight: 700 on serif text is ornamental. Heading weight in the implementation comes from the larger sizes.
  • The chart's y-axis is now naturally proportional because mortgage is no longer a debt-balance figure. With real seeded data the dark mortgage bars sit at the base of each stack at ~$4.8k.

🤖 Generated with Claude Code

@raycashmore raycashmore force-pushed the design-refinement branch 2 times, most recently from 68bc998 to bcd70b2 Compare May 17, 2026 06:21
raycashmore and others added 23 commits May 17, 2026 16:26
Move mortgageContrib to helpers.ts so it can be shared, update monthlyBreakdown.ts to import it from there, and extend listBudgetChart to join mortgage rows via carry-forward so each chart point includes a mortgage field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previously the chart used a fixed 1200x600 viewBox stretched with
preserveAspectRatio=none, which squashed axis text horizontally and
garbled month names ("Juno", "Aept"). Wrap the SVG in ParentSize
so it draws at the real container dimensions, bump axis text to 11px
DM Sans, widen the left margin for currency labels, and split the
component so the header stays outside the measurement target.
Sampling 6 evenly-spaced indices through 8 months landed on
0,1,3,4,6,7 — dropping Aug and Nov. For periods of 12 months or
fewer, show a label for every bar; only sample when the chart spans
more than a year.
Previously the chart and breakdown carried the mortgage value forward
from the mortgage table (contrib1+contrib2+contrib3), which is a much
larger debt-repayment figure that swamped income/spend on the chart.
The mortgage value shown in the chart and the breakdown is now the
positive sum of the budget row's variable and fixed line items, so it
sits naturally on the same scale as discretionary spend.

- Add budgetMortgagePortion helper (clamps variable+fixed at zero)
- listBudgetChart drops the mortgage carry-forward join
- joinBudgetWithMortgage -> buildMonthlyBreakdown; mortgage is now
  always a number, not number | null
- Update BudgetBreakdownTable + tests accordingly
These fields are stored as negative numbers (expenses), so summing
them gave a negative which the previous clamp turned into zero. Use
|variable| + |fixed| so a typical month registers as ~$4,800 of
mortgage spend rather than $0.
@raycashmore raycashmore changed the title Align budget dashboard desktop layout Design refinement: align budget app with v3 Pencil mocks May 17, 2026
@raycashmore raycashmore merged commit c7e5d7f into main May 17, 2026
1 check passed
@raycashmore raycashmore deleted the design-refinement branch May 17, 2026 12:51
raycashmore added a commit that referenced this pull request May 19, 2026
Design refinement: align budget app with v3 Pencil mocks
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