Skip to content

Budgets: Suggest offers changes when your budgets are off - #3

Merged
minimus7 merged 1 commit into
mainfrom
budget-suggest-retune
Nov 11, 2026
Merged

minimus7 merged 1 commit into
mainfrom
budget-suggest-retune

Conversation

@minimus7

@minimus7 minimus7 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #2 (budget-suggest-edit). It builds on that PR's editable suggestion list, so it targets that branch. Merge #2 first; GitHub then retargets this one to main.

The Suggest sheet on the Budgets tab said "Nothing to suggest right now." once every main category had a budget. Now:

  • Budgets that are well off from what you really spend show as current → suggested, for example "Auto & transport $650 → $350". Well off means $25 and a fifth or more away from the suggested amount, which comes from your full months of data. Biggest gap first.
  • Main categories with no budget follow, as before.
  • Apply all N saves them. The toast says "Updated N budgets" and its undo puts the old amounts back.
  • Each row can be edited or removed first (the same row editing Budgets: edit, remove and add on the first-time suggestion list #2 adds), and a category can be added.
  • Ask AI to tune my budget sits at the bottom of the sheet. It is the page's existing AskButton, passed in, not a new AI path. Pressing it closes the sheet and opens broke ai with the same question.
  • Nothing off: one line, "Your budgets are close to what you really spend.", then the AI button.

Code

  • src/lib/budget.ts: wellOff(budget, suggested) and retune(cats, budgets), tested in budget.test.ts.
  • src/components/BudgetEditor.tsx: the sheet uses retune. Suggest takes current (shows "$650 →", button reads "Apply all N") and empty (the no-changes line). Rows look up categories that already have a budget, not only open ones. The sheet's Suggest remounts on each open so it starts from the latest numbers.
  • The first-time view ("Set a budget from how you really spend") is unchanged from Budgets: edit, remove and add on the first-time suggestion list #2.

Tested

Local Supabase stack (not the real project), throwaway retune@broke.test user, broke-sample-statement.csv imported through Accounts → Add accounts → Import a statement. Suggested amounts: Auto & transport 350, Bills & utilities 1650, Dining & drinks 160, Entertainment 30, Groceries 675, Health 30, Shopping 130, Travel 50.

  • Set Auto & transport 650, Groceries 400, Dining & drinks 300, Shopping 60. Before: "Nothing to suggest right now." After: those 4 rows, current → suggested, "Apply all 4".
  • Removed Shopping, typed Groceries 500, Apply all 3: saved Auto 350, Groceries 500, Dining 160. Shopping stayed 60.
  • Reopened: Groceries $500 → $675 (still $175 off) and Shopping $60 → $130.
  • Deleted the Travel budget: it showed as a new row with $50. Apply all 3 saved Groceries 675, Shopping 130, Travel 50.
  • Reopened: "Your budgets are close to what you really spend." plus the AI button. Pressing it closed the sheet and sent the tune question to broke ai.
  • node src/lib/budget.test.ts, npx tsc --noEmit and eslint clean.
  • The console shows a React "unique key" warning from BudgetEditor on the Budgets page. It shows on Budgets: edit, remove and add on the first-time suggestion list #2's code too, so it is not from this change.

Screenshots

Taken at deviceScaleFactor 2, the sheet element only. Files are in .context/pr-3/ in the local checkout (/Users/maximussoares/Documents/broke/.context/pr-3/).

Before

After

🤖 Generated with Claude Code

…l spending

The Suggest sheet said "Nothing to suggest right now." once every main category had a budget.
It now lists budgets $25 and a fifth or more away from the suggested amount as current -> suggested,
then main categories with no budget. Apply all saves them, each row can be edited or removed first,
and the sheet carries the page's Ask AI to tune my budget button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@minimus7
minimus7 changed the base branch from budget-suggest-edit to main November 11, 2026 03:36
@minimus7
minimus7 force-pushed the budget-suggest-retune branch from b9a2f96 to 86228a0 Compare November 11, 2026 03:36
@minimus7
minimus7 merged commit b7dc3a6 into main Nov 11, 2026
3 checks passed
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