Skip to content

UI revamp Phase 5d: Budget page, budgets saved per month - #100

Merged
coderconnoisseur merged 4 commits into
ui-revamp/phase5c-billsfrom
ui-revamp/phase5d-budget
Oct 22, 2026
Merged

coderconnoisseur merged 4 commits into
ui-revamp/phase5c-billsfrom
ui-revamp/phase5d-budget

Conversation

@coderconnoisseur

Copy link
Copy Markdown
Owner

Phase 5d of the UI revamp (spec docs/superpowers/specs/2026-10-22-ui-revamp-phase5-design.md §4.4, mockup budget.html). Stacked on #99; retarget to refactor once it lands.

Backend

  • Budgets are versioned by month: budgets.effective_from ("YYYY-MM"), unique per (user, category, month). A month's limit = each category's latest row from that month or before, so edits never rewrite past months. Removing a category writes a 0 limit from this month on.
  • Migration _migrate_budget_versions: dates old rows by updated_at, swaps the unique constraint (SQLite rebuilds the table). Idempotent; tested on SQLite and smoke-tested on Postgres 16.
  • GET /api/budget?month=YYYY-MM, GET /api/budget/history?months=6 (budget vs spent; budget null for past months with no limits).
  • Draft proposals carry payload.month; approval writes from that month. basis.months lists only months with spend (§12).

Frontend

  • /budget page + Plan sidebar group: month switcher (past months read-only), Edit budget (overall total in place), Let Lumen draft.
  • Hero: spent of total, even-pace tick, left / days left / safe per day, pace chart vs a straight line to the budget.
  • Last 6 months: budget outline vs actual, this month with a run-rate projection, track record.
  • By category: inline edit (Enter saves, Esc cancels, same row height), Add category, unassigned footer.
  • Draft panel on the page (replaces Home's dialog): Skip / Approve named for the category, "was X" / "new", Approve remaining N, 409 message. Home's promo links to /budget?draft=1.

Checks

  • Backend 993 passed, eval 1, lint clean, build ok, e2e 184 passed (17 new Budget checks + 4 maths).

Manual checks

  1. Restart the backend once (adds the column and migrates). Open /budget: numbers match Home's budget card.
  2. Click a category's amount, type, Enter: saves, row doesn't jump. Esc cancels.
  3. ‹ to last month: read-only, last month's limits.
  4. Let Lumen draft: lines appear on the page; Skip one, Approve remaining.
  5. Phone width: nothing cut off at the right edge.

Calls made

  • Last 6 months sits above By category (mockup has it below) so variable-height cards come last (no layout shift).
  • Safe per day = left ÷ days left (bills not subtracted yet; in §12).
  • A draft is for the current month (basis = the 3 months before).
  • No month-bars glyph on draft lines: the basis has no per-month amounts to draw.

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lumen Ready Ready Preview Oct 22, 2026 4:48pm UTC

This branch was successfully deployed

1 active deployment
Preview — 990f969b Deployed Oct 22, 2026 by vercel[bot]
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