[PR #7191] [MERGED] [AI] Fix Spending Analysis budget table for tracking budgeting #25606

Closed
opened 2026-04-16 18:43:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7191
Author: @pranayseela
Created: 3/13/2026
Status: Merged
Merged: 3/15/2026
Merged by: @matt-fidd

Base: masterHead: fix/reports-tracking-budget-4517


📝 Commits (7)

  • c8d74b6 [AI] Fix Spending Analysis budget table for tracking budgeting
  • a55ed2a [autofix.ci] apply automated fixes
  • 320eeba [AI] Add release note for Spending Analysis tracking budgeting fix
  • 3ba05d0 [autofix.ci] apply automated fixes
  • 15edc48 Merge branch 'master' into fix/reports-tracking-budget-4517
  • 2d7338f [AI] Address CodeRabbit nitpicks: use typed narrowing instead of assertion for budgetType
  • 7ed9f95 Merge branch 'master' into fix/reports-tracking-budget-4517

📊 Changes

4 files changed (+23 additions, -3 deletions)

View changed files

📝 packages/desktop-client/src/components/reports/reports/Spending.tsx (+6 -1)
📝 packages/desktop-client/src/components/reports/reports/SpendingCard.tsx (+6 -1)
📝 packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts (+5 -1)
upcoming-release-notes/7191.md (+6 -0)

📄 Description

Summary

  • Ensure Spending Analysis uses the correct budget table for the active budgeting mode.
  • In envelope budgeting, the report continues to use zero_budgets.
  • In tracking budgeting, the report now uses reflect_budgets instead of always reading from zero_budgets.

Technical details

  • Extended createSpendingSpreadsheet to accept a budgetType parameter and select zero_budgets vs reflect_budgets accordingly.
  • Updated Spending and SpendingCard to read the budgetType synced preference and pass it through to the spreadsheet factory.
  • Kept the default behavior as envelope when the pref is missing or invalid.

Testing

  • yarn typecheck
  • yarn lint:fix
  • yarn build:browser
  • yarn test (currently reports existing failures in core server/node tests; these are pre-existing and not introduced by this change.)

Fixes #4517.

Description

Testing

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 27 14.92 MB → 14.92 MB (+514 B) +0.00%
loot-core 1 5.75 MB 0%
api 3 4.69 MB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.92 MB → 14.92 MB (+514 B) +0.00%
Changeset
File Δ Size
src/components/reports/reports/SpendingCard.tsx 📈 +200 B (+2.42%) 8.08 kB → 8.27 kB
src/components/reports/spreadsheets/spending-spreadsheet.ts 📈 +112 B (+1.79%) 6.1 kB → 6.21 kB
src/components/reports/reports/Spending.tsx 📈 +202 B (+0.83%) 23.89 kB → 24.08 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/ReportRouter.js 1.16 MB → 1.16 MB (+514 B) +0.04%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/index.js 9.57 MB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/ca.js 187.85 kB 0%
static/js/da.js 106.13 kB 0%
static/js/de.js 179.82 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 171.21 kB 0%
static/js/es.js 174.29 kB 0%
static/js/fr.js 179.34 kB 0%
static/js/it.js 170.91 kB 0%
static/js/nb-NO.js 156.74 kB 0%
static/js/nl.js 113.03 kB 0%
static/js/pl.js 89.61 kB 0%
static/js/pt-BR.js 182.82 kB 0%
static/js/th.js 181.54 kB 0%
static/js/uk.js 215.25 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/narrow.js 638.11 kB 0%
static/js/TransactionList.js 106.52 kB 0%
static/js/wide.js 164.16 kB 0%
static/js/AppliedFilters.js 9.99 kB 0%
static/js/usePayeeRuleCounts.js 11.57 kB 0%
static/js/useTransactionBatchActions.js 13.24 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.75 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
kcab.worker.Bm3zKqpv.js 5.75 MB 0%

api

Total

Files count Total bundle size % Changed
3 4.69 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
index.js 4.4 MB 0%
index-BKGP2w5F.js 285.56 kB 0%
multipart-parser-DwddZ4BH.js 9.33 kB 0%

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/7191 **Author:** [@pranayseela](https://github.com/pranayseela) **Created:** 3/13/2026 **Status:** ✅ Merged **Merged:** 3/15/2026 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `fix/reports-tracking-budget-4517` --- ### 📝 Commits (7) - [`c8d74b6`](https://github.com/actualbudget/actual/commit/c8d74b69c982944c2a9e501a0735552534a06cc9) [AI] Fix Spending Analysis budget table for tracking budgeting - [`a55ed2a`](https://github.com/actualbudget/actual/commit/a55ed2ade89744f11d15c5a7385249195ca22ee8) [autofix.ci] apply automated fixes - [`320eeba`](https://github.com/actualbudget/actual/commit/320eebade042647383a8736447ed4067f61e23ab) [AI] Add release note for Spending Analysis tracking budgeting fix - [`3ba05d0`](https://github.com/actualbudget/actual/commit/3ba05d009e681ac622a904200a205bf65150966e) [autofix.ci] apply automated fixes - [`15edc48`](https://github.com/actualbudget/actual/commit/15edc483ad7e9cc0a68a351d6dab47dc8a09b819) Merge branch 'master' into fix/reports-tracking-budget-4517 - [`2d7338f`](https://github.com/actualbudget/actual/commit/2d7338f8fa1c332e846bf3c0e37a3f1431d58934) [AI] Address CodeRabbit nitpicks: use typed narrowing instead of assertion for budgetType - [`7ed9f95`](https://github.com/actualbudget/actual/commit/7ed9f9513eecc525e8dc39a65dee8e8b90458424) Merge branch 'master' into fix/reports-tracking-budget-4517 ### 📊 Changes **4 files changed** (+23 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/reports/reports/Spending.tsx` (+6 -1) 📝 `packages/desktop-client/src/components/reports/reports/SpendingCard.tsx` (+6 -1) 📝 `packages/desktop-client/src/components/reports/spreadsheets/spending-spreadsheet.ts` (+5 -1) ➕ `upcoming-release-notes/7191.md` (+6 -0) </details> ### 📄 Description ## Summary - Ensure Spending Analysis uses the correct budget table for the active budgeting mode. - In envelope budgeting, the report continues to use `zero_budgets`. - In tracking budgeting, the report now uses `reflect_budgets` instead of always reading from `zero_budgets`. ## Technical details - Extended `createSpendingSpreadsheet` to accept a `budgetType` parameter and select `zero_budgets` vs `reflect_budgets` accordingly. - Updated `Spending` and `SpendingCard` to read the `budgetType` synced preference and pass it through to the spreadsheet factory. - Kept the default behavior as `envelope` when the pref is missing or invalid. ## Testing - `yarn typecheck` - `yarn lint:fix` - `yarn build:browser` - `yarn test` (currently reports existing failures in core server/node tests; these are pre-existing and not introduced by this change.) Fixes #4517. <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> ## Description <!-- What does this PR do? Why is it needed? Please give context on the "why?": why do we need this change? What problem is it solving for you?--> ## Related issue(s) <!-- e.g. Fixes #123, Relates to #456 --> ## Testing <!-- What did you test? How can we reproduce the issue you are fixing or how can we test the feature you built? --> ## 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 <!--- actual-bot-sections ---> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.92 MB → 14.92 MB (+514 B) | +0.00% loot-core | 1 | 5.75 MB | 0% api | 3 | 4.69 MB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.92 MB → 14.92 MB (+514 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/components/reports/reports/SpendingCard.tsx` | 📈 +200 B (+2.42%) | 8.08 kB → 8.27 kB `src/components/reports/spreadsheets/spending-spreadsheet.ts` | 📈 +112 B (+1.79%) | 6.1 kB → 6.21 kB `src/components/reports/reports/Spending.tsx` | 📈 +202 B (+0.83%) | 23.89 kB → 24.08 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/ReportRouter.js | 1.16 MB → 1.16 MB (+514 B) | +0.04% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.57 MB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/ca.js | 187.85 kB | 0% static/js/da.js | 106.13 kB | 0% static/js/de.js | 179.82 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 171.21 kB | 0% static/js/es.js | 174.29 kB | 0% static/js/fr.js | 179.34 kB | 0% static/js/it.js | 170.91 kB | 0% static/js/nb-NO.js | 156.74 kB | 0% static/js/nl.js | 113.03 kB | 0% static/js/pl.js | 89.61 kB | 0% static/js/pt-BR.js | 182.82 kB | 0% static/js/th.js | 181.54 kB | 0% static/js/uk.js | 215.25 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/narrow.js | 638.11 kB | 0% static/js/TransactionList.js | 106.52 kB | 0% static/js/wide.js | 164.16 kB | 0% static/js/AppliedFilters.js | 9.99 kB | 0% static/js/usePayeeRuleCounts.js | 11.57 kB | 0% static/js/useTransactionBatchActions.js | 13.24 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.75 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **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 ----- | --------- | --------- kcab.worker.Bm3zKqpv.js | 5.75 MB | 0% </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 3 | 4.69 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **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 | 4.4 MB | 0% index-BKGP2w5F.js | 285.56 kB | 0% multipart-parser-DwddZ4BH.js | 9.33 kB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 18:43:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#25606