Skip to content

Budget v3 page + cents migration + warm shell#3

Merged
raycashmore merged 35 commits into
mainfrom
budget-data
May 17, 2026
Merged

Budget v3 page + cents migration + warm shell#3
raycashmore merged 35 commits into
mainfrom
budget-data

Conversation

@raycashmore
Copy link
Copy Markdown
Owner

Summary

Implements the v3 Budget app page (KPIs, restyled chart, monthly breakdown, click-through monthly detail overlay) inside a restyled warm-bordered shared shell, with money stored as integer minor units and the seed pipeline fixed.

Three phases, 32 commits. See docs/superpowers/plans/2026-05-16-budget-page.md for the implementation plan.

Phase 0 — Foundation

  • Warm token palette + DM Sans / DM Serif Display fonts in @repo/tokens.
  • Restyled shared AppFrame / Sidebar / Header (cream outer page, dark #2D2D2D rounded inner shell, 96px sidebar with square tiles). Home app inherits the new look.
  • Money fields migrated to integer minor units (cents/pence). Added toCents / fromCents helpers. Three rate-boundary derivations (superPensionAud, ukTotalAud, tradingInt2 * usdAud) now round to integers. Client formatCurrency takes cents.
  • Seed script re-homed in packages/convex/scripts/, env-aware via .env.local, exposed as pnpm seed / pnpm seed:clear. Database reseeded from CREAM.xlsx (xlsx is gitignored).

Phase 1 — Convex queries

  • getBudgetPageSummary({ period }) — four KPI values (Avg spend, Avg income, Savings rate in basis points, Net gain) with deltas vs prior period of equal length.
  • getMonthlyBreakdown({ limit? }) — budget rows joined with mortgage via match-or-carry-forward.
  • getMonthlyDetail({ date }) — single month's income / spend / mortgage detail for the overlay.
  • Each query factored over a pure helper (summarizeBudgetForPeriod, joinBudgetWithMortgage, shapeMonthDetail) with Vitest red-green-commit. 25 unit tests in @repo/convex.

Phase 2 — Page composition

  • New components: KpiCard, BudgetKpiCards, BudgetBreakdownTable, InsightsPanel (placeholder reserving the right column), MonthlyDetailOverlay (portal + scrim + Escape + focus), MonthIncomeSection, MonthSpendSection (credit-card categories stubbed; real lumped totals), MonthMortgageSection.
  • Existing visx chart restyled to warm palette (peach spend bars + sage sink-or-swim bars, restyled tooltip). Period state lifted to page.
  • TimePeriod widened from 1Y/3Y/5Y/ALL to 3M/6M/12M/ALL to match design.
  • BudgetPage orchestrates four queries + overlay state in a two-column layout with mobile reflow.
  • Browser-verified at 1440×1024, 1024×768, 390×844 against Pencil frames a6m9ik and QPjOt via Playwright MCP. Three small fixes shipped during verification (breakdown row limit honors period, overlay typography aligned to design, mobile breakdown table now horizontally scrollable).

Out of scope (explicit)

  • Insights generation — right column shows placeholder.
  • Mobile-specific chrome — bottom tab bar / bottom-sheet overlay deferred; mobile is responsive-only.
  • Credit-card transaction categories in the overlay — stubbed with ; real lumped totals shown.
  • Month-over-month trend rows on overlay mini-cards — landed separately on claude/xenodochial-curie-8a0898, not merged here. Optional follow-up.

Test Plan

  • pnpm check-types — clean across all packages.
  • pnpm lint — 0 errors (pre-existing any warnings in @repo/convex unchanged).
  • pnpm test — 40 tests pass (25 in @repo/convex, 15 in budget).
  • pnpm convex + pnpm --filter budget dev, then load http://localhost:3001/:
    • Warm shell renders (cream margin, dark rounded inner, 96px sidebar).
    • Four KPI cards show real numbers with directional delta arrows.
    • "Income vs Spending" chart renders with sage/peach bars + sage/orange MA lines + warm tooltip on hover.
    • Period filter pills (3 mo / 6 mo / 12 mo / All) change the KPI values and the breakdown row count.
    • Monthly breakdown table rows hover; clicking a row opens the overlay.
    • Overlay shows month label, three colored summary mini-cards, and three section panels (income/spend/mortgage). Escape and scrim-click close it.
    • Resize to 1024×768 — two-column layout still works.
    • Resize to 390×844 — sidebar hides, content stacks, breakdown table scrolls horizontally.

🤖 Generated with Claude Code

raycashmore and others added 30 commits May 16, 2026 16:38
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cripts

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>
With "type": "module", `import * as XLSX from 'xlsx'` puts readFile on
XLSX.default rather than XLSX directly. Switching to a default import
restores XLSX.readFile and allows the seed to run successfully.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Thin wrapper around joinBudgetWithMortgage that joins budget rows with
mortgage contrib data, returning descending monthly breakdown rows with
{date, income, spend, mortgage, net} in integer cents.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace 1Y/3Y/5Y/ALL with 3M/6M/12M/ALL in TimePeriod, update
filterByTimePeriod to use 30-day month math, and update BudgetChartFilters
to render the new pill values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getMonthlyBreakdown was called with no limit, returning all 138 rows
and inflating the content card to 6000px. Now derives a limit (3/6/12)
from the selected period so the table matches the active filter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Month label: text-2xl (24px) → text-[26px] to match design spec
- Mini-card values: text-xl (20px) → text-2xl (24px) to match design spec
- Section panel h3s (Income/Spend/Mortgage): sm semibold DM Sans → 22px DM Serif Display
- Sub-card h4s (Income contributors, Payment split, Debt and equity context): 11px uppercase → 13px bold non-uppercase DM Sans
- Credit card categories row header: same uppercase-to-bold treatment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
raycashmore and others added 5 commits May 17, 2026 08:19
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Income / Spend / Mortgage mini-cards in MonthlyDetailOverlay now show a
trend row (lucide icon + signed percentage vs prior month). Backend
returns prior-month totals via getMonthlyDetail; trend computation is in
shapeMonthDetail with rounded-zero treated as flat. Trend row is
omitted when no prior-month row exists (oldest month in dataset) or
when the prior mortgage row is missing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@raycashmore raycashmore merged commit 4269290 into main May 17, 2026
1 check passed
@raycashmore raycashmore deleted the budget-data branch May 17, 2026 06:17
raycashmore added a commit that referenced this pull request May 19, 2026
Budget v3 page + cents migration + warm shell
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