[PR #7831] [AI] Add Sort A to Z / Sort Z to A options to budget category groups #89604

Open
opened 2026-05-22 14:07:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7831
Author: @davidbettis
Created: 5/13/2026
Status: 🔄 Open

Base: masterHead: add-budget-group-category-sort


📝 Commits (2)

  • e1e4953 [AI] Add Sort A to Z / Sort Z to A options to budget category groups (#7831)
  • 2fc2b2a Simplify release notes and apply coderabbitai suggestions

📊 Changes

14 files changed (+225 additions, -1 deletions)

View changed files

📝 packages/desktop-client/src/budget/mutations.ts (+26 -0)
📝 packages/desktop-client/src/components/budget/BudgetCategories.tsx (+7 -0)
📝 packages/desktop-client/src/components/budget/BudgetTable.tsx (+6 -0)
📝 packages/desktop-client/src/components/budget/ExpenseGroup.tsx (+3 -0)
📝 packages/desktop-client/src/components/budget/IncomeGroup.tsx (+6 -0)
📝 packages/desktop-client/src/components/budget/SidebarGroup.tsx (+20 -0)
📝 packages/desktop-client/src/components/budget/index.tsx (+8 -0)
📝 packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx (+6 -0)
📝 packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx (+30 -1)
📝 packages/desktop-client/src/modals/modalsSlice.ts (+4 -0)
📝 packages/loot-core/src/server/budget/app.ts (+3 -0)
packages/loot-core/src/server/budget/sort-categories.test.ts (+69 -0)
packages/loot-core/src/server/budget/sort-categories.ts (+31 -0)
upcoming-release-notes/7831.md (+6 -0)

📄 Description

…(#7831)

Description

This PR allows users to alphabetically sort the categories within a budget group.

In my personal use of Actual, I have two large budget groups: "Mandatory" and "Discretionary". After a group has more than 5 categories, it becomes tedious to manually reorder them. I wrote this so it can automatically keep things alphabetized with low effort, even if the group is large.

When writing this change, I originally considered keeping it entirely within the client. However, I realized that if it's a single server action, "undo" becomes really easy. Without it, the client would need to keep track of snapshots of the ordering.

Related issue(s)

None

Testing

  • yarn lint
  • yarn test
  • yarn start &&
    • Verified sort asc as expected for Usual Expenses in desktop mode
    • Verified sort desc as expected for Usual Expenses in desktop mode
    • Verified sort asc as expected for Usual Expenses in mobile mode
    • Verified sort desc as expected for Usual Expenses in mobile mode
    • Verified undo works after sorting

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

Viz

Screenshot 2026-05-13 at 11 03 18 AM Screenshot 2026-05-13 at 11 03 33 AM

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 33 13.95 MB → 13.95 MB (+3.84 kB) +0.03%
loot-core 1 5.31 MB → 5.31 MB (+647 B) +0.01%
api 2 3.94 MB → 3.94 MB (+638 B) +0.02%
cli 1 7.97 MB 0%
crdt 1 11.12 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
33 13.95 MB → 13.95 MB (+3.84 kB) +0.03%
Changeset
File Δ Size
src/components/modals/CategoryGroupMenuModal.tsx 📈 +1.42 kB (+13.46%) 10.55 kB → 11.98 kB
src/components/budget/SidebarGroup.tsx 📈 +606 B (+6.49%) 9.11 kB → 9.71 kB
src/components/budget/IncomeGroup.tsx 📈 +97 B (+5.66%) 1.67 kB → 1.77 kB
src/components/budget/index.tsx 📈 +603 B (+5.10%) 11.54 kB → 12.13 kB
src/budget/mutations.ts 📈 +544 B (+4.25%) 12.5 kB → 13.03 kB
src/components/budget/ExpenseGroup.tsx 📈 +97 B (+1.87%) 5.05 kB → 5.15 kB
src/components/budget/BudgetCategories.tsx 📈 +185 B (+1.50%) 12.01 kB → 12.2 kB
src/components/budget/BudgetTable.tsx 📈 +98 B (+0.97%) 9.9 kB → 9.99 kB
src/components/mobile/budget/BudgetPage.tsx 📈 +252 B (+0.69%) 35.87 kB → 36.12 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 2.01 MB → 2.01 MB (+3.07 kB) +0.15%
static/js/Value.js 4.96 MB → 4.96 MB (+544 B) +0.01%
static/js/narrow.js 364.2 kB → 364.44 kB (+252 B) +0.07%

Smaller
No assets were smaller

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 146.45 kB 0%
static/js/TransactionEdit.js 190.43 kB 0%
static/js/TransactionList.js 85.81 kB 0%
static/js/bankSyncUtils.js 54.15 kB 0%
static/js/ca.js 187.72 kB 0%
static/js/chart-theme.js 800.08 kB 0%
static/js/client.js 451.37 kB 0%
static/js/da.js 101.28 kB 0%
static/js/de.js 170.38 kB 0%
static/js/en-GB.js 10.01 kB 0%
static/js/en.js 189.97 kB 0%
static/js/es.js 178.83 kB 0%
static/js/extends.js 519.29 kB 0%
static/js/fr.js 178.71 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 165.13 kB 0%
static/js/nb-NO.js 148.19 kB 0%
static/js/nl.js 106.34 kB 0%
static/js/pt-BR.js 189.39 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/th.js 174.62 kB 0%
static/js/theme.js 31.67 kB 0%
static/js/uk.js 207.56 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%
static/js/zh-Hans.js 117.75 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.31 MB → 5.31 MB (+647 B) +0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/budget/sort-categories.ts 🆕 +577 B 0 B → 577 B
home/runner/work/actual/actual/packages/loot-core/src/server/budget/app.ts 📈 +70 B (+0.74%) 9.24 kB → 9.31 kB
View detailed bundle breakdown

Added

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

Removed

Asset File Size % Changed
kcab.worker.jUVFVkaN.js 5.31 MB → 0 B (-5.31 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.94 MB → 3.94 MB (+638 B) +0.02%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/budget/sort-categories.ts 🆕 +569 B 0 B → 569 B
home/runner/work/actual/actual/packages/loot-core/src/server/budget/app.ts 📈 +69 B (+0.74%) 9.07 kB → 9.14 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.94 MB → 3.94 MB (+638 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 11.12 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 11.12 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/7831 **Author:** [@davidbettis](https://github.com/davidbettis) **Created:** 5/13/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `add-budget-group-category-sort` --- ### 📝 Commits (2) - [`e1e4953`](https://github.com/actualbudget/actual/commit/e1e4953ab6690e42d8a795b39825ea8b79c30181) [AI] Add Sort A to Z / Sort Z to A options to budget category groups (#7831) - [`2fc2b2a`](https://github.com/actualbudget/actual/commit/2fc2b2a6ffd815ebfe840805af9e2378792158bd) Simplify release notes and apply coderabbitai suggestions ### 📊 Changes **14 files changed** (+225 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/budget/mutations.ts` (+26 -0) 📝 `packages/desktop-client/src/components/budget/BudgetCategories.tsx` (+7 -0) 📝 `packages/desktop-client/src/components/budget/BudgetTable.tsx` (+6 -0) 📝 `packages/desktop-client/src/components/budget/ExpenseGroup.tsx` (+3 -0) 📝 `packages/desktop-client/src/components/budget/IncomeGroup.tsx` (+6 -0) 📝 `packages/desktop-client/src/components/budget/SidebarGroup.tsx` (+20 -0) 📝 `packages/desktop-client/src/components/budget/index.tsx` (+8 -0) 📝 `packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx` (+6 -0) 📝 `packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx` (+30 -1) 📝 `packages/desktop-client/src/modals/modalsSlice.ts` (+4 -0) 📝 `packages/loot-core/src/server/budget/app.ts` (+3 -0) ➕ `packages/loot-core/src/server/budget/sort-categories.test.ts` (+69 -0) ➕ `packages/loot-core/src/server/budget/sort-categories.ts` (+31 -0) ➕ `upcoming-release-notes/7831.md` (+6 -0) </details> ### 📄 Description …(#7831) ## Description This PR allows users to alphabetically sort the categories within a budget group. In my personal use of Actual, I have two large budget groups: "Mandatory" and "Discretionary". After a group has more than 5 categories, it becomes tedious to manually reorder them. I wrote this so it can automatically keep things alphabetized with low effort, even if the group is large. When writing this change, I originally considered keeping it entirely within the client. However, I realized that if it's a single server action, "undo" becomes really easy. Without it, the client would need to keep track of snapshots of the ordering. ## Related issue(s) None ## Testing * yarn lint * yarn test * yarn start && * Verified sort asc as expected for Usual Expenses in desktop mode * Verified sort desc as expected for Usual Expenses in desktop mode * Verified sort asc as expected for Usual Expenses in mobile mode * Verified sort desc as expected for Usual Expenses in mobile mode * Verified undo works after sorting ## Checklist - [X] Release notes added (see link above) - [X] No obvious regressions in affected areas - [X] Self-review has been performed - I understand what each change in the code does and why it is needed ## Viz <img width="375" height="789" alt="Screenshot 2026-05-13 at 11 03 18 AM" src="https://github.com/user-attachments/assets/f848ac88-649e-4a7b-b9ec-0377a9e9226a" /> <img width="1286" height="859" alt="Screenshot 2026-05-13 at 11 03 33 AM" src="https://github.com/user-attachments/assets/4f15c46d-aff0-4c40-af28-4387a3d76dc5" /> <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 33 | 13.95 MB → 13.95 MB (+3.84 kB) | +0.03% loot-core | 1 | 5.31 MB → 5.31 MB (+647 B) | +0.01% api | 2 | 3.94 MB → 3.94 MB (+638 B) | +0.02% cli | 1 | 7.97 MB | 0% crdt | 1 | 11.12 kB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 33 | 13.95 MB → 13.95 MB (+3.84 kB) | +0.03% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/components/modals/CategoryGroupMenuModal.tsx` | 📈 +1.42 kB (+13.46%) | 10.55 kB → 11.98 kB `src/components/budget/SidebarGroup.tsx` | 📈 +606 B (+6.49%) | 9.11 kB → 9.71 kB `src/components/budget/IncomeGroup.tsx` | 📈 +97 B (+5.66%) | 1.67 kB → 1.77 kB `src/components/budget/index.tsx` | 📈 +603 B (+5.10%) | 11.54 kB → 12.13 kB `src/budget/mutations.ts` | 📈 +544 B (+4.25%) | 12.5 kB → 13.03 kB `src/components/budget/ExpenseGroup.tsx` | 📈 +97 B (+1.87%) | 5.05 kB → 5.15 kB `src/components/budget/BudgetCategories.tsx` | 📈 +185 B (+1.50%) | 12.01 kB → 12.2 kB `src/components/budget/BudgetTable.tsx` | 📈 +98 B (+0.97%) | 9.9 kB → 9.99 kB `src/components/mobile/budget/BudgetPage.tsx` | 📈 +252 B (+0.69%) | 35.87 kB → 36.12 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/index.js | 2.01 MB → 2.01 MB (+3.07 kB) | +0.15% static/js/Value.js | 4.96 MB → 4.96 MB (+544 B) | +0.01% static/js/narrow.js | 364.2 kB → 364.44 kB (+252 B) | +0.07% **Smaller** No assets were smaller **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 | 146.45 kB | 0% static/js/TransactionEdit.js | 190.43 kB | 0% static/js/TransactionList.js | 85.81 kB | 0% static/js/bankSyncUtils.js | 54.15 kB | 0% static/js/ca.js | 187.72 kB | 0% static/js/chart-theme.js | 800.08 kB | 0% static/js/client.js | 451.37 kB | 0% static/js/da.js | 101.28 kB | 0% static/js/de.js | 170.38 kB | 0% static/js/en-GB.js | 10.01 kB | 0% static/js/en.js | 189.97 kB | 0% static/js/es.js | 178.83 kB | 0% static/js/extends.js | 519.29 kB | 0% static/js/fr.js | 178.71 kB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 13.46 kB | 0% static/js/it.js | 165.13 kB | 0% static/js/nb-NO.js | 148.19 kB | 0% static/js/nl.js | 106.34 kB | 0% static/js/pt-BR.js | 189.39 kB | 0% static/js/resize-observer.js | 18.06 kB | 0% static/js/th.js | 174.62 kB | 0% static/js/theme.js | 31.67 kB | 0% static/js/uk.js | 207.56 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% static/js/zh-Hans.js | 117.75 kB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.31 MB → 5.31 MB (+647 B) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/budget/sort-categories.ts` | 🆕 +577 B | 0 B → 577 B `home/runner/work/actual/actual/packages/loot-core/src/server/budget/app.ts` | 📈 +70 B (+0.74%) | 9.24 kB → 9.31 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.DrJPZIo8.js | 0 B → 5.31 MB (+5.31 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.jUVFVkaN.js | 5.31 MB → 0 B (-5.31 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 2 | 3.94 MB → 3.94 MB (+638 B) | +0.02% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/budget/sort-categories.ts` | 🆕 +569 B | 0 B → 569 B `home/runner/work/actual/actual/packages/loot-core/src/server/budget/app.ts` | 📈 +69 B (+0.74%) | 9.07 kB → 9.14 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 ----- | --------- | --------- index.js | 3.94 MB → 3.94 MB (+638 B) | +0.02% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- models.js | 0 B | 0% </div> </details> --- #### cli **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 7.97 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 ----- | --------- | --------- cli.js | 7.97 MB | 0% </div> </details> --- #### crdt **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 11.12 kB | 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 | 11.12 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-05-22 14:07:30 -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#89604