Skip to content

[AI] Add option to 'Copy [budget] to future months'#7420

Open
nikhilweee wants to merge 18 commits intoactualbudget:masterfrom
nikhilweee:copy-to-future-months
Open

[AI] Add option to 'Copy [budget] to future months'#7420
nikhilweee wants to merge 18 commits intoactualbudget:masterfrom
nikhilweee:copy-to-future-months

Conversation

@nikhilweee
Copy link
Copy Markdown

@nikhilweee nikhilweee commented Apr 8, 2026

Adds a new per-category budget menu option that copies the current month's budgeted amount to all future months that already exist in the budget. Only months with a non-zero budget value for the selected category are updated, months with no budget set are skipped. Works for both envelope and tracking budget types, and on both desktop (inline popover) and mobile (modal) views.

Description

I often find myself looking for a way to adjust the budget for multiple months at a time, and today there is no way to do so. The only option is to manually click on each month and copy paste values which is unsustainable. This PR adds an option to copy the current month's budget to future months.

Related issue(s)

None that I could find. Although similar issues discuss copying last month's budget to the current month.

Testing

In the budget view, after entering a value in the 'budget' column, click the dropdown and select 'copy to future months'. This should copy the value to all future months that already exist in the budget.

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I understand what each change in the code does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 34 13.96 MB → 13.93 MB (-25.97 kB) -0.18%
loot-core 1 5.27 MB → 5.27 MB (+673 B) +0.01%
api 2 3.89 MB → 3.89 MB (+653 B) +0.02%
cli 1 7.97 MB 0%
crdt 1 41.83 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
34 13.96 MB → 13.93 MB (-25.97 kB) -0.18%
Changeset
File Δ Size
src/components/budget/tracking/BudgetMenu.tsx 📈 +540 B (+16.45%) 3.21 kB → 3.73 kB
src/components/mobile/budget/BudgetCell.tsx 📈 +398 B (+7.57%) 5.14 kB → 5.53 kB
src/components/modals/TrackingBudgetMenuModal.tsx 📈 +108 B (+1.65%) 6.39 kB → 6.5 kB
src/budget/mutations.ts 📈 +150 B (+1.18%) 12.37 kB → 12.52 kB
src/components/budget/tracking/TrackingBudgetComponents.tsx 📈 +195 B (+1.00%) 18.98 kB → 19.17 kB
locale/en.json 📉 -457 B (-0.24%) 185.81 kB → 185.36 kB
locale/pt-BR.json 📉 -1.98 kB (-1.03%) 192.06 kB → 190.09 kB
locale/ca.json 📉 -2.14 kB (-1.13%) 190.22 kB → 188.08 kB
locale/es.json 📉 -2.1 kB (-1.16%) 181.26 kB → 179.16 kB
locale/fr.json 📉 -2.2 kB (-1.21%) 181.27 kB → 179.07 kB
locale/de.json 📉 -2.1 kB (-1.22%) 172.83 kB → 170.73 kB
locale/it.json 📉 -2.09 kB (-1.25%) 167.28 kB → 165.19 kB
locale/uk.json 📉 -2.8 kB (-1.33%) 210.75 kB → 207.95 kB
locale/nb-NO.json 📉 -2 kB (-1.33%) 150.48 kB → 148.48 kB
locale/zh-Hans.json 📉 -1.62 kB (-1.36%) 119.2 kB → 117.58 kB
locale/nl.json 📉 -1.58 kB (-1.46%) 108.23 kB → 106.65 kB
locale/pl.json 📉 -1.34 kB (-1.52%) 88.01 kB → 86.67 kB
locale/da.json 📉 -1.75 kB (-1.70%) 103.32 kB → 101.57 kB
locale/th.json 📉 -3.17 kB (-1.78%) 178.2 kB → 175.02 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 1.93 MB → 1.93 MB (+843 B) +0.04%
static/js/narrow.js 364.02 kB → 364.41 kB (+398 B) +0.11%
static/js/Value.js 4.94 MB → 4.94 MB (+150 B) +0.00%

Smaller

Asset File Size % Changed
static/js/th.js 178.2 kB → 175.02 kB (-3.17 kB) -1.78%
static/js/uk.js 210.75 kB → 207.95 kB (-2.8 kB) -1.33%
static/js/fr.js 181.27 kB → 179.07 kB (-2.2 kB) -1.21%
static/js/ca.js 190.22 kB → 188.08 kB (-2.14 kB) -1.13%
static/js/es.js 181.26 kB → 179.16 kB (-2.1 kB) -1.16%
static/js/de.js 172.83 kB → 170.73 kB (-2.1 kB) -1.22%
static/js/it.js 167.28 kB → 165.19 kB (-2.09 kB) -1.25%
static/js/nb-NO.js 150.48 kB → 148.48 kB (-2 kB) -1.33%
static/js/pt-BR.js 192.06 kB → 190.09 kB (-1.98 kB) -1.03%
static/js/da.js 103.32 kB → 101.57 kB (-1.75 kB) -1.70%
static/js/zh-Hans.js 119.2 kB → 117.58 kB (-1.62 kB) -1.36%
static/js/nl.js 108.23 kB → 106.65 kB (-1.58 kB) -1.46%
static/js/pl.js 88.01 kB → 86.67 kB (-1.34 kB) -1.52%
static/js/en.js 185.81 kB → 185.36 kB (-457 B) -0.24%

Unchanged

Asset File Size % Changed
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 962.55 kB 0%
static/js/ReportRouter.js 1.22 MB 0%
static/js/ScheduleEditForm.js 145.68 kB 0%
static/js/TransactionEdit.js 189.54 kB 0%
static/js/TransactionList.js 85.81 kB 0%
static/js/alerts.js 800.08 kB 0%
static/js/bankSyncUtils.js 53.96 kB 0%
static/js/client.js 451.37 kB 0%
static/js/en-GB.js 8.2 kB 0%
static/js/extends.js 518.66 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/theme.js 31.67 kB 0%
static/js/useFormatList.js 4.96 kB 0%
static/js/wide.js 453 B 0%
static/js/workbox-window.prod.es5.js 7.33 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.27 MB → 5.27 MB (+673 B) +0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/budget/actions.ts 📈 +466 B (+4.01%) 11.36 kB → 11.82 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/months.ts 📈 +124 B (+2.53%) 4.78 kB → 4.91 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/app.ts 📈 +83 B (+0.94%) 8.58 kB → 8.66 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.nnurm20D.js 0 B → 5.27 MB (+5.27 MB) -

Removed

Asset File Size % Changed
kcab.worker.DiBErB6z.js 5.27 MB → 0 B (-5.27 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
2 3.89 MB → 3.89 MB (+653 B) +0.02%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/budget/actions.ts 📈 +453 B (+4.00%) 11.05 kB → 11.49 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/months.ts 📈 +118 B (+2.48%) 4.64 kB → 4.75 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/app.ts 📈 +82 B (+0.95%) 8.42 kB → 8.5 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.89 MB → 3.89 MB (+653 B) +0.02%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
models.js 0 B 0%

cli

Total

Files count Total bundle size % Changed
1 7.97 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
cli.js 7.97 MB 0%

crdt

Total

Files count Total bundle size % Changed
1 41.83 kB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
index.js 41.83 kB 0%

Adds a new per-category budget menu option that copies the current
month's budgeted amount to all future months that already exist in
the budget. Works for both envelope and tracking budget types, and
on both desktop (inline popover) and mobile (modal) views.
@actual-github-bot actual-github-bot Bot changed the title [AI] Add option to 'Copy [budget] to future months' [WIP] [AI] Add option to 'Copy [budget] to future months' Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

👋 Hello contributor!

We would love to review your PR! Before we can do that, please make sure:

  • ✅ All CI checks pass
  • ✅ The PR is moved from draft to open (if applicable)
  • ✅ The "[WIP]" prefix is removed from the PR title
  • ✅ All CodeRabbit code review comments are resolved (if you disagree with anything - reply to the bot with your reasoning so we can read through it). The bot will eventually approve the PR.

We do this to reduce the TOIL the core contributor team has to go through for each PR and to allow for speedy reviews and merges.

For more information, please see our Contributing Guide.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 8, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces a "Copy until year end" feature for per-category budgets. Users can now copy the current month's budgeted amount to all remaining months within the same calendar year. Changes span frontend components, backend action logic, server endpoint registration, tests, and documentation.

Changes

Copy Until Year End Feature

Layer / File(s) Summary
Backend Action & Logic
packages/loot-core/src/server/budget/actions.ts, packages/loot-core/src/server/budget/actions.test.ts
New copyUntilYearEnd action reads the source month's budget amount, computes year boundaries, filters and sorts eligible future months, then batch-writes the amount via setBudget. Comprehensive test suite validates copying behavior across months, handling of zero budgets, year-end boundaries, and "tracking" mode.
Server Endpoint Registration
packages/loot-core/src/server/budget/app.ts
New endpoint 'budget/copy-until-year-end' is registered and wrapped with undoable and mutator middleware for undo/redo support.
Frontend Mutation & Wiring
packages/desktop-client/src/budget/mutations.ts
ApplyBudgetActionPayload union gains a new 'copy-until-year-end' variant with month and args.category. The useBudgetActions hook's switch case routes this type to the backend endpoint.
UI Component Integration
packages/desktop-client/src/components/budget/tracking/BudgetMenu.tsx, packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx, packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx, packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx, packages/desktop-client/src/modals/modalsSlice.ts
Menu components and modals are updated to accept and wire onCopyUntilYearEnd callbacks; menu items expose the new action for both desktop and mobile tracking budget views.
Documentation & Release Notes
upcoming-release-notes/7420.md, packages/docs/docs/getting-started/tracking-budget.md
Release notes announce the feature; documentation explains the per-category menu option with usage steps and example scenarios.

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as BudgetMenu<br/>(Desktop/Mobile)
    participant Mutation as useBudgetActions<br/>Mutation
    participant Server as Backend<br/>budget/copy-until-year-end
    participant DB as Budget<br/>Database

    User->>UI: Select "Copy until year end"
    UI->>Mutation: onCopyUntilYearEnd() or<br/>onMenuAction('copy-until-year-end')
    Mutation->>Mutation: Dispatch mutation with<br/>type & category/month
    Mutation->>Server: send('budget/copy-until-year-end',<br/>{ month, category })
    Server->>Server: Read current month<br/>budget amount
    Server->>Server: Compute future months<br/>within year boundary
    Server->>DB: setBudget() for each<br/>future month
    DB-->>Server: Budgets updated
    Server-->>UI: Success (undoable)
    UI->>User: Show undo notification<br/>"Budget copied until year end"
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

documentation

Poem

🐰 With whiskers twitched and spreadsheets spread,
A copy-spell from month ahead,
Through budgets bouncing, year so bright,
Till winter's edge and year's last light,
One action bound them, left and right! 📋✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title mentions 'Copy to future months' but the actual implementation is 'Copy until year end' with year-end capping, representing a partial mismatch with the final feature. Consider updating the title to 'Add option to Copy budget until year end' to accurately reflect the final implementation and year-end capping behavior.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description is directly related to the changeset, explaining the feature addition with context, testing approach, and rationale.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/loot-core/src/server/budget/actions.test.ts (1)

15-77: Add one tracking-budget test for this new action.

Current coverage validates envelope behavior, but the feature target includes tracking budgets too. Please add a case that sets budget type to tracking and verifies copyToFutureMonths still copies the selected category budget into later created months.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/loot-core/src/server/budget/actions.test.ts` around lines 15 - 77,
Add a new test case in the same describe block that mirrors the "copies the
current month budget to all future created months" test but uses a tracking
budget: after setupDatabase(), call setBudget with category 'cat1', month
'2024-01', amount (e.g. 5000) and include the tracking type flag (e.g. type:
'tracking' or tracking: true depending on setBudget signature), keep later
months set to other values, call copyToFutureMonths({ month: '2024-01',
category: 'cat1' }) and assert via
getSheetValue('budget202401'/'budget202402'/'budget202403', 'budget-cat1') that
the tracking budget from 2024-01 was copied into the later months. Ensure you
await sheet.waitOnSpreadsheet() where other tests do.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/loot-core/src/server/budget/actions.test.ts`:
- Around line 15-77: Add a new test case in the same describe block that mirrors
the "copies the current month budget to all future created months" test but uses
a tracking budget: after setupDatabase(), call setBudget with category 'cat1',
month '2024-01', amount (e.g. 5000) and include the tracking type flag (e.g.
type: 'tracking' or tracking: true depending on setBudget signature), keep later
months set to other values, call copyToFutureMonths({ month: '2024-01',
category: 'cat1' }) and assert via
getSheetValue('budget202401'/'budget202402'/'budget202403', 'budget-cat1') that
the tracking budget from 2024-01 was copied into the later months. Ensure you
await sheet.waitOnSpreadsheet() where other tests do.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 762f4e6e-2b58-4cfc-bf12-dc5d71dfe1e0

📥 Commits

Reviewing files that changed from the base of the PR and between 3d5881e and 1a8e865.

📒 Files selected for processing (13)
  • packages/desktop-client/src/budget/mutations.ts
  • packages/desktop-client/src/components/budget/envelope/BudgetMenu.tsx
  • packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx
  • packages/desktop-client/src/components/budget/tracking/BudgetMenu.tsx
  • packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx
  • packages/desktop-client/src/components/modals/EnvelopeBudgetMenuModal.tsx
  • packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx
  • packages/desktop-client/src/modals/modalsSlice.ts
  • packages/loot-core/src/server/budget/actions.test.ts
  • packages/loot-core/src/server/budget/actions.ts
  • packages/loot-core/src/server/budget/app.ts
  • upcoming-release-notes/7420.md

coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 8, 2026
@nikhilweee nikhilweee changed the title [WIP] [AI] Add option to 'Copy [budget] to future months' [AI] Add option to 'Copy [budget] to future months' Apr 8, 2026
@nikhilweee
Copy link
Copy Markdown
Author

This is ready for review from my end. The failing CI seems to be an infrastructure issue. Happy to work with you to resolve it.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 4f0437f
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/69d5d3ac86baea0008a82fbb
😎 Deploy Preview https://deploy-preview-7420.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for actualbudget-storybook ready!

Name Link
🔨 Latest commit 4f0437f
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget-storybook/deploys/69d5d3ac189d8b0008269916
😎 Deploy Preview https://deploy-preview-7420--actualbudget-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for actualbudget-website ready!

Name Link
🔨 Latest commit 4f0437f
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget-website/deploys/69d5d3ac92b0a500074eabfa
😎 Deploy Preview https://deploy-preview-7420.www.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 14be73f
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/69d5d43786baea0008a8608a
😎 Deploy Preview https://deploy-preview-7420.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 9f223dc
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/69f9844f7cc5f800082a1757
😎 Deploy Preview https://deploy-preview-7420.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for actualbudget-storybook ready!

Name Link
🔨 Latest commit 60bef0d
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget-storybook/deploys/69e9c321849b1200087be994
😎 Deploy Preview https://deploy-preview-7420--actualbudget-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for actualbudget-website ready!

Name Link
🔨 Latest commit efd96b6
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget-website/deploys/69f982780a7ee200087167be
😎 Deploy Preview https://deploy-preview-7420.www.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@nikhilweee
Copy link
Copy Markdown
Author

Hi folks, now that CI is fixed I'd really appreciate some feedback!

@youngcw
Copy link
Copy Markdown
Member

youngcw commented Apr 12, 2026

Why would you want to push out a budget amount for a whole year? That seems like it would make more extra work not less

@nikhilweee
Copy link
Copy Markdown
Author

@youngcw it is very useful in yearly budget planning where you set future months budgets in advance. Right now the app only allows you to "look back" at the past 1, 3, 6, 12 month averages however I like to plan future month's budgets too. Let's say I allocate budgets from Jan to Dec but in March I realise I need to allocate 500 cocos every month because I added a monthly expense. Instead of clicking "copy last month's budget" 9 times, I'd rather just have a way to "carry over" the current budget amount to future months. If it helps I am happy to limit this feature to 12 months.

@nikhilweee
Copy link
Copy Markdown
Author

nikhilweee commented Apr 16, 2026

@StephenBrown2 ah yes sorry forgot to mention that I'm currently already using tracking budget where I don't need to have the funds for before I set up the budget for future months. I'm sure everybody uses actualbudget differently and in my case I also like to go back and re-evaluate previous months budgets. With rollover spending turned on, this PR allows me to easily set the budget for all future months. I'm coming from Monarch Money and there if you set a budget for a month, it's automatically set to all future months by default. Another reason why I really miss this feature.

I did take a look at templates, and forgive me if I'm mistaken but it looks like I will still need to apply the 'template' to all months individually. The goal of this PR is to have a one-click solution instead. In a case where I observe that I spend 300 cocos on groceries in Jan, Feb and March, I can simplty click this button to set the grocery budget for all future months to 300 with one click.

Even if there was a keyboard shortcut to go to the same category in the next month (like a tab key) that would have given me a lot of mileage but unfortuntaely we don't have that option either.

@youngcw
Copy link
Copy Markdown
Member

youngcw commented Apr 16, 2026

Would it make sense to only enable this on the tracking budget then?

@nikhilweee
Copy link
Copy Markdown
Author

@youngcw That's a fair question. My primary use case is tracking budget, so limiting it there would still work for me personally.

That said, I'd argue there's value in keeping it for envelope budgeting too. A few reasons:

  • Rollover overspending — this feature (copy to future months) pairs really well with rollover overspending enabled, and that setting is available in envelope budgeting too. So the two features naturally complement each other regardless of budget type.
  • Fixed expenses — things like rent, subscriptions, or loan payments don't depend on available funds. Envelope users planning those categories ahead of time would benefit just as much.
  • Multi-month view — Actual already lets you see multiple months simultaneously, which suggests it's designed for a birds-eye view, not just a "next month only" perspective. This feature fits that mental model — tweaking a category across many months at once, past or future.
  • Consistency — "Copy last month's budget" already works across both modes. This feels like a natural extension of that.

I'm happy to limit it to tracking budget if that's the direction you prefer, but wanted to make the case that envelope users have legitimate reasons to want this too.

nikhilweee and others added 2 commits April 16, 2026 23:32
Only copy the budget value to future months that already have a
non-zero budget set for the category. Months with no budget (zero)
are left untouched.
@nikhilweee
Copy link
Copy Markdown
Author

Also just pushed an update: the action now skips future months where the budget is zero/unset for that category. So it only updates months that already have a value. It won't fill in months you haven't planned yet. @StephenBrown2 hopefully this should address the over-budgeting concern for envelope users as well.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 17, 2026
@nikhilweee
Copy link
Copy Markdown
Author

Hey @youngcw, @joel-jeremy with the latest update I think the over-budgeting concern for envelope users is addressed. What do you think? Any other blockers before this can move forward?

@nikhilweee
Copy link
Copy Markdown
Author

Hey @youngcw @joel-jeremy let me know what you think. This has been up for a while, would love to move it forward.

@nikhilweee
Copy link
Copy Markdown
Author

Hey @youngcw @joel-jeremy just checking in again. I think the previous concerns have been addressed. Is there anything else blocking this from moving forward?

@youngcw
Copy link
Copy Markdown
Member

youngcw commented Apr 30, 2026

Im still not seeing how this is useful at all with the envelope budget style, especially with the change to not budget in months with not budget at apply time. I can see this being useful with the tracking budget. I would be fine adding this to the tracking budget, maybe with the check to only extend out to the end of the current year. It could be added to the tracking budget and then see if anyone wants it in the envelope budget.

There should be some documentation about this especially if you leave in the only apply to existing budgets check.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx`:
- Around line 138-140: The undo notification message passed to
showUndoNotification is not translated; update the call in BudgetCell
(function/component BudgetCell, where showUndoNotification is used) to wrap the
user-facing string with t(...) and interpolate category.name via i18n (e.g., use
a placeholder like "{{name}} budget copied until year end." and pass { name:
category.name } to t) so the displayed message is localized; the t function is
already imported/destructured in scope.

In `@packages/docs/docs/getting-started/tracking-budget.md`:
- Around line 71-75: Update the "Copy until year end" paragraph so it
consistently states that the action copies the current month's budget only to
remaining months in the same calendar year that already have a non‑zero or
explicitly set budget for that category (i.e., it will skip future months where
that category's budget is zero or unset); revise the first sentence and the
example to reflect this precise behavior and replace the ambiguous phrase "has
already been created in the budget" with "already have a non‑zero or explicitly
set budget for that category" and note that months with zero/unset category
budgets are skipped.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0f8f2a33-e2c0-4d1d-8bbc-d543e06653a3

📥 Commits

Reviewing files that changed from the base of the PR and between 736fac7 and d88e283.

📒 Files selected for processing (11)
  • packages/desktop-client/src/budget/mutations.ts
  • packages/desktop-client/src/components/budget/tracking/BudgetMenu.tsx
  • packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx
  • packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx
  • packages/desktop-client/src/modals/modalsSlice.ts
  • packages/docs/docs/getting-started/tracking-budget.md
  • packages/loot-core/src/server/budget/actions.test.ts
  • packages/loot-core/src/server/budget/actions.ts
  • packages/loot-core/src/server/budget/app.ts
  • upcoming-release-notes/7420.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/loot-core/src/server/budget/actions.test.ts

Comment thread packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx
Comment on lines +71 to +75
The **Copy until year end** option in the per-category budget menu copies the current month's budgeted amount to all remaining months of the same calendar year at once.

To use it, click the budget amount for a category to open the budget menu, then select **Copy until year end**. The current month's amount will be written to every future month in the same year that has already been created in the budget.

This is useful when you add or change a recurring expense and want to update all future planned months without clicking through each one individually. For example, if you realise in March that your grocery budget should be $300 for the rest of the year, you can set it once and copy it to April through December in one click.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Documentation inconsistency: first sentence contradicts the qualification in the second.

Line 71 says the amount is copied to "all remaining months" (unconditionally), while line 73 scopes that to "every future month … that has already been created in the budget." A user reading the first sentence will expect a write to every month through December; the qualifier on line 73 then surprises them.

Additionally, from the PR discussion, the action skips future months where that category's budget is zero or unset. The phrase "has already been created in the budget" is ambiguous — it could mean the month period exists, or that the category row is non-zero. If the intent is the latter, that distinction is worth spelling out (as youngcw specifically requested docs for this behaviour).

Suggested fix to make the section self-consistent and accurate:

📝 Proposed documentation fix
-The **Copy until year end** option in the per-category budget menu copies the current month's budgeted amount to all remaining months of the same calendar year at once.
+The **Copy until year end** option in the per-category budget menu copies the current month's budgeted amount to every later month in the same calendar year that already has a non-zero budget set for that category.
 
-To use it, click the budget amount for a category to open the budget menu, then select **Copy until year end**. The current month's amount will be written to every future month in the same year that has already been created in the budget.
+To use it, click the budget amount for a category to open the budget menu, then select **Copy until year end**. The current month's amount will be written to every future month in the same year where that category already has a budgeted amount set; months where the category budget is zero or unset are left unchanged.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The **Copy until year end** option in the per-category budget menu copies the current month's budgeted amount to all remaining months of the same calendar year at once.
To use it, click the budget amount for a category to open the budget menu, then select **Copy until year end**. The current month's amount will be written to every future month in the same year that has already been created in the budget.
This is useful when you add or change a recurring expense and want to update all future planned months without clicking through each one individually. For example, if you realise in March that your grocery budget should be $300 for the rest of the year, you can set it once and copy it to April through December in one click.
The **Copy until year end** option in the per-category budget menu copies the current month's budgeted amount to every later month in the same calendar year that already has a non-zero budget set for that category.
To use it, click the budget amount for a category to open the budget menu, then select **Copy until year end**. The current month's amount will be written to every future month in the same year where that category already has a budgeted amount set; months where the category budget is zero or unset are left unchanged.
This is useful when you add or change a recurring expense and want to update all future planned months without clicking through each one individually. For example, if you realise in March that your grocery budget should be $300 for the rest of the year, you can set it once and copy it to April through December in one click.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/docs/docs/getting-started/tracking-budget.md` around lines 71 - 75,
Update the "Copy until year end" paragraph so it consistently states that the
action copies the current month's budget only to remaining months in the same
calendar year that already have a non‑zero or explicitly set budget for that
category (i.e., it will skip future months where that category's budget is zero
or unset); revise the first sentence and the example to reflect this precise
behavior and replace the ambiguous phrase "has already been created in the
budget" with "already have a non‑zero or explicitly set budget for that
category" and note that months with zero/unset category budgets are skipped.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching the inconsistency. I addressed it in efd96b6, but I diverged from the suggested wording: the skip-zero behavior was deliberately removed in f39a312 (based on reviewer feedback to keep this simple and tracking-only). The action now copies the current month's amount to every future month in the same calendar year, regardless of whether the existing budget is zero or non-zero. The updated docs reflect that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikhilweee, thanks for the clarification! That makes perfect sense — since the skip-zero logic was removed, the docs correctly describing an unconditional copy to all future months is the right approach. The updated wording ("overwriting any existing value for that category in those months") is clear and accurate. Appreciate you explaining the context behind the divergence from the suggestion.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants