[PR #6834] Add filter option for category groups #6766

Closed
opened 2026-02-28 21:32:25 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6834

State: closed
Merged: Yes


Resolves https://github.com/actualbudget/actual/issues/3791 and resolves https://github.com/actualbudget/actual/issues/4031

With this PR, I hope to add filtering support for category groups in reports. The reasoning for this is to create graphs or statistics that include everything in a certain group without having to adjust the filters whenever a category gets added or moved to another group.

I only noticed @ericparton's closed PR (#6471) after I had made all the necessary UI changes and kept running into query issues (see below). Since his PR is pretty much the same, with minor differences in naming and the selector, I also credited him in the release notes. His solution (removing noMapping) helped me overcome the query issues, everything seems to work fine and all tests still pass. I don't know if there are any other side effects that I didn't see, or if there is another better solution, so if there is, I'm all ears.

Screenshots:

image image image

The query errors I ran into when noMapping was set to true:

image

I also tried using cat_group instead of group, since that's the column name in categories, but it just resulted in a different error. I considered looking into how to change the column name from cat_group to group, but at the moment I can't see what implications that would have, and where I would have even begun.

image

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 28 14.75 MB → 14.78 MB (+30.66 kB) +0.20%
loot-core 1 5.86 MB → 5.86 MB (+1.17 kB) +0.02%
api 1 4.4 MB → 4.4 MB (+1.06 kB) +0.02%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
28 14.75 MB → 14.78 MB (+30.66 kB) +0.20%
Changeset
File Δ Size
src/accounts/mutations.ts 🆕 +21.82 kB 0 B → 21.82 kB
src/components/autocomplete/CategoryGroupAutocomplete.tsx 🆕 +7.85 kB 0 B → 7.85 kB
src/components/modals/CategoryGroupAutocompleteModal.tsx 🆕 +3.24 kB 0 B → 3.24 kB
src/accounts/queries.ts 🆕 +1.02 kB 0 B → 1.02 kB
src/hooks/useClosedAccounts.ts 📈 +100 B (+31.35%) 319 B → 419 B
src/hooks/useOffBudgetAccounts.ts 📈 +76 B (+21.78%) 349 B → 425 B
src/hooks/useOnBudgetAccounts.ts 📈 +75 B (+21.55%) 348 B → 423 B
src/components/util/GenericInput.tsx 📈 +2.23 kB (+11.46%) 19.46 kB → 21.69 kB
src/hooks/useAccount.ts 📈 +46 B (+11.17%) 412 B → 458 B
src/components/rules/Value.tsx 📈 +374 B (+7.88%) 4.64 kB → 5 kB
src/components/filters/FiltersMenu.tsx 📈 +816 B (+4.56%) 17.49 kB → 18.29 kB
src/modals/modalsSlice.ts 📈 +96 B (+4.49%) 2.09 kB → 2.18 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/rules.ts 📈 +225 B (+2.77%) 7.93 kB → 8.15 kB
src/components/accounts/Account.tsx 📈 +1.2 kB (+2.47%) 48.75 kB → 49.96 kB
src/components/modals/CreateLocalAccountModal.tsx 📈 +141 B (+2.15%) 6.4 kB → 6.54 kB
src/components/banksync/EditSyncAccount.tsx 📈 +133 B (+1.80%) 7.23 kB → 7.36 kB
src/components/mobile/banksync/MobileBankSyncAccountEditPage.tsx 📈 +142 B (+1.41%) 9.83 kB → 9.97 kB
src/components/mobile/accounts/AccountPage.tsx 📈 +140 B (+1.38%) 9.93 kB → 10.07 kB
src/global-events.ts 📈 +49 B (+1.26%) 3.79 kB → 3.83 kB
src/components/Modals.tsx 📈 +177 B (+1.24%) 13.96 kB → 14.13 kB
src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx 📈 +355 B (+1.23%) 28.1 kB → 28.45 kB
src/components/sidebar/Account.tsx 📈 +164 B (+1.21%) 13.21 kB → 13.37 kB
src/components/modals/SelectLinkedAccountsModal.tsx 📈 +456 B (+1.05%) 42.6 kB → 43.05 kB
src/components/modals/CloseAccountModal.tsx 📈 +104 B (+0.87%) 11.68 kB → 11.79 kB
src/components/accounts/AccountSyncCheck.tsx 📈 +59 B (+0.63%) 9.2 kB → 9.26 kB
src/components/mobile/accounts/AccountTransactions.tsx 📈 +60 B (+0.62%) 9.51 kB → 9.57 kB
src/sync-events.ts 📈 +53 B (+0.52%) 9.86 kB → 9.92 kB
src/components/FinancesApp.tsx 📈 +94 B (+0.50%) 18.5 kB → 18.59 kB
src/budget/mutations.ts 📈 +92 B (+0.42%) 21.48 kB → 21.57 kB
src/components/reports/reports/CustomReport.tsx 📈 +93 B (+0.35%) 25.65 kB → 25.74 kB
src/components/mobile/accounts/AccountsPage.tsx 📈 +58 B (+0.26%) 21.43 kB → 21.49 kB
src/components/sidebar/Accounts.tsx 📈 +17 B (+0.20%) 8.46 kB → 8.48 kB
src/components/rules/RuleEditor.tsx 📈 +18 B (+0.04%) 49.43 kB → 49.45 kB
src/components/autocomplete/CategoryAutocomplete.tsx 📈 +4 B (+0.02%) 17.34 kB → 17.34 kB
src/components/rules/RuleRow.tsx 📉 -2 B (-0.02%) 10.83 kB → 10.83 kB
src/hooks/useFailedAccounts.ts 📉 -2 B (-0.54%) 367 B → 365 B
src/app/appSlice.ts 📉 -605 B (-18.19%) 3.25 kB → 2.66 kB
src/hooks/useAccounts.ts 📉 -407 B (-50.00%) 814 B → 407 B
src/accounts/accountsSlice.ts 📉 -9.83 kB (-88.27%) 11.13 kB → 1.31 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 9.49 MB → 9.51 MB (+29.11 kB) +0.30%
static/js/wide.js 164.05 kB → 165.25 kB (+1.2 kB) +0.73%
static/js/narrow.js 638.5 kB → 638.75 kB (+258 B) +0.04%
static/js/ReportRouter.js 1.13 MB → 1.13 MB (+93 B) +0.01%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
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 96.92 kB 0%
static/js/da.js 106.62 kB 0%
static/js/de.js 180.44 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 165.58 kB 0%
static/js/es.js 173.83 kB 0%
static/js/fr.js 179.97 kB 0%
static/js/it.js 171.44 kB 0%
static/js/nb-NO.js 157.23 kB 0%
static/js/nl.js 106.65 kB 0%
static/js/pl.js 88.64 kB 0%
static/js/pt-BR.js 154.57 kB 0%
static/js/sv.js 78.2 kB 0%
static/js/th.js 182.35 kB 0%
static/js/uk.js 215.11 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/TransactionList.js 106.13 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 10.05 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.86 MB → 5.86 MB (+1.17 kB) +0.02%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/shared/rules.ts 📈 +182 B (+7.57%) 2.35 kB → 2.53 kB
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts 📈 +966 B (+3.58%) 26.34 kB → 27.28 kB
home/runner/work/actual/actual/packages/loot-core/src/server/transactions/transaction-rules.ts 📈 +85 B (+0.33%) 25.17 kB → 25.25 kB
home/runner/work/actual/actual/packages/loot-core/src/server/api.ts 📈 +11 B (+0.04%) 25.94 kB → 25.95 kB
home/runner/work/actual/actual/packages/loot-core/src/server/aql/compiler.ts 📉 -51 B (-0.16%) 30.92 kB → 30.87 kB
View detailed bundle breakdown

Added

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

Removed

Asset File Size % Changed
kcab.worker.hYlRL2CV.js 5.86 MB → 0 B (-5.86 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
1 4.4 MB → 4.4 MB (+1.06 kB) +0.02%
Changeset
File Δ Size
src/shared/rules.ts 📈 +162 B (+7.91%) 2 kB → 2.16 kB
src/server/accounts/app.ts 📈 +878 B (+3.82%) 22.47 kB → 23.33 kB
src/server/transactions/transaction-rules.ts 📈 +77 B (+0.34%) 22.35 kB → 22.43 kB
src/server/api.ts 📈 +11 B (+0.05%) 22.7 kB → 22.71 kB
src/server/aql/compiler.ts 📉 -47 B (-0.17%) 27.38 kB → 27.33 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
bundle.api.js 4.4 MB → 4.4 MB (+1.06 kB) +0.02%

Smaller
No assets were smaller

Unchanged
No assets were unchanged

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6834 **State:** closed **Merged:** Yes --- <!-- 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. --> Resolves https://github.com/actualbudget/actual/issues/3791 and resolves https://github.com/actualbudget/actual/issues/4031 With this PR, I hope to add filtering support for category groups in reports. The reasoning for this is to create graphs or statistics that include everything in a certain group without having to adjust the filters whenever a category gets added or moved to another group. I only noticed @ericparton's closed PR (#6471) after I had made all the necessary UI changes and kept running into query issues (see below). Since his PR is pretty much the same, with minor differences in naming and the selector, I also credited him in the release notes. His solution (removing `noMapping`) helped me overcome the query issues, everything seems to work fine and all tests still pass. I don't know if there are any other side effects that I didn't see, or if there is another better solution, so if there is, I'm all ears. Screenshots: <img width="412" height="373" alt="image" src="https://github.com/user-attachments/assets/75f74fe7-cb40-48ae-bdd5-f92727527ae2" /> <img width="1552" height="939" alt="image" src="https://github.com/user-attachments/assets/f4593a0c-08a2-401e-b73e-6e3c749cab73" /> <img width="1319" height="431" alt="image" src="https://github.com/user-attachments/assets/cfb372c8-5132-46df-ac28-39927158e332" /> --- The query errors I ran into when `noMapping` was set to true: <img width="558" height="222" alt="image" src="https://github.com/user-attachments/assets/b09e6095-c64c-48e4-9ada-74623c7adb03" /> I also tried using `cat_group` instead of `group`, since that's the column name in `categories`, but it just resulted in a different error. I considered looking into how to change the column name from `cat_group` to `group`, but at the moment I can't see what implications that would have, and where I would have even begun. <img width="562" height="438" alt="image" src="https://github.com/user-attachments/assets/61684464-d484-4882-8998-b984f48f6ff8" /> <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 28 | 14.75 MB → 14.78 MB (+30.66 kB) | +0.20% loot-core | 1 | 5.86 MB → 5.86 MB (+1.17 kB) | +0.02% api | 1 | 4.4 MB → 4.4 MB (+1.06 kB) | +0.02% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 28 | 14.75 MB → 14.78 MB (+30.66 kB) | +0.20% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/accounts/mutations.ts` | 🆕 +21.82 kB | 0 B → 21.82 kB `src/components/autocomplete/CategoryGroupAutocomplete.tsx` | 🆕 +7.85 kB | 0 B → 7.85 kB `src/components/modals/CategoryGroupAutocompleteModal.tsx` | 🆕 +3.24 kB | 0 B → 3.24 kB `src/accounts/queries.ts` | 🆕 +1.02 kB | 0 B → 1.02 kB `src/hooks/useClosedAccounts.ts` | 📈 +100 B (+31.35%) | 319 B → 419 B `src/hooks/useOffBudgetAccounts.ts` | 📈 +76 B (+21.78%) | 349 B → 425 B `src/hooks/useOnBudgetAccounts.ts` | 📈 +75 B (+21.55%) | 348 B → 423 B `src/components/util/GenericInput.tsx` | 📈 +2.23 kB (+11.46%) | 19.46 kB → 21.69 kB `src/hooks/useAccount.ts` | 📈 +46 B (+11.17%) | 412 B → 458 B `src/components/rules/Value.tsx` | 📈 +374 B (+7.88%) | 4.64 kB → 5 kB `src/components/filters/FiltersMenu.tsx` | 📈 +816 B (+4.56%) | 17.49 kB → 18.29 kB `src/modals/modalsSlice.ts` | 📈 +96 B (+4.49%) | 2.09 kB → 2.18 kB `home/runner/work/actual/actual/packages/loot-core/src/shared/rules.ts` | 📈 +225 B (+2.77%) | 7.93 kB → 8.15 kB `src/components/accounts/Account.tsx` | 📈 +1.2 kB (+2.47%) | 48.75 kB → 49.96 kB `src/components/modals/CreateLocalAccountModal.tsx` | 📈 +141 B (+2.15%) | 6.4 kB → 6.54 kB `src/components/banksync/EditSyncAccount.tsx` | 📈 +133 B (+1.80%) | 7.23 kB → 7.36 kB `src/components/mobile/banksync/MobileBankSyncAccountEditPage.tsx` | 📈 +142 B (+1.41%) | 9.83 kB → 9.97 kB `src/components/mobile/accounts/AccountPage.tsx` | 📈 +140 B (+1.38%) | 9.93 kB → 10.07 kB `src/global-events.ts` | 📈 +49 B (+1.26%) | 3.79 kB → 3.83 kB `src/components/Modals.tsx` | 📈 +177 B (+1.24%) | 13.96 kB → 14.13 kB `src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx` | 📈 +355 B (+1.23%) | 28.1 kB → 28.45 kB `src/components/sidebar/Account.tsx` | 📈 +164 B (+1.21%) | 13.21 kB → 13.37 kB `src/components/modals/SelectLinkedAccountsModal.tsx` | 📈 +456 B (+1.05%) | 42.6 kB → 43.05 kB `src/components/modals/CloseAccountModal.tsx` | 📈 +104 B (+0.87%) | 11.68 kB → 11.79 kB `src/components/accounts/AccountSyncCheck.tsx` | 📈 +59 B (+0.63%) | 9.2 kB → 9.26 kB `src/components/mobile/accounts/AccountTransactions.tsx` | 📈 +60 B (+0.62%) | 9.51 kB → 9.57 kB `src/sync-events.ts` | 📈 +53 B (+0.52%) | 9.86 kB → 9.92 kB `src/components/FinancesApp.tsx` | 📈 +94 B (+0.50%) | 18.5 kB → 18.59 kB `src/budget/mutations.ts` | 📈 +92 B (+0.42%) | 21.48 kB → 21.57 kB `src/components/reports/reports/CustomReport.tsx` | 📈 +93 B (+0.35%) | 25.65 kB → 25.74 kB `src/components/mobile/accounts/AccountsPage.tsx` | 📈 +58 B (+0.26%) | 21.43 kB → 21.49 kB `src/components/sidebar/Accounts.tsx` | 📈 +17 B (+0.20%) | 8.46 kB → 8.48 kB `src/components/rules/RuleEditor.tsx` | 📈 +18 B (+0.04%) | 49.43 kB → 49.45 kB `src/components/autocomplete/CategoryAutocomplete.tsx` | 📈 +4 B (+0.02%) | 17.34 kB → 17.34 kB `src/components/rules/RuleRow.tsx` | 📉 -2 B (-0.02%) | 10.83 kB → 10.83 kB `src/hooks/useFailedAccounts.ts` | 📉 -2 B (-0.54%) | 367 B → 365 B `src/app/appSlice.ts` | 📉 -605 B (-18.19%) | 3.25 kB → 2.66 kB `src/hooks/useAccounts.ts` | 📉 -407 B (-50.00%) | 814 B → 407 B `src/accounts/accountsSlice.ts` | 📉 -9.83 kB (-88.27%) | 11.13 kB → 1.31 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 | 9.49 MB → 9.51 MB (+29.11 kB) | +0.30% static/js/wide.js | 164.05 kB → 165.25 kB (+1.2 kB) | +0.73% static/js/narrow.js | 638.5 kB → 638.75 kB (+258 B) | +0.04% static/js/ReportRouter.js | 1.13 MB → 1.13 MB (+93 B) | +0.01% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- 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 | 96.92 kB | 0% static/js/da.js | 106.62 kB | 0% static/js/de.js | 180.44 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 165.58 kB | 0% static/js/es.js | 173.83 kB | 0% static/js/fr.js | 179.97 kB | 0% static/js/it.js | 171.44 kB | 0% static/js/nb-NO.js | 157.23 kB | 0% static/js/nl.js | 106.65 kB | 0% static/js/pl.js | 88.64 kB | 0% static/js/pt-BR.js | 154.57 kB | 0% static/js/sv.js | 78.2 kB | 0% static/js/th.js | 182.35 kB | 0% static/js/uk.js | 215.11 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/TransactionList.js | 106.13 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 10.05 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.86 MB → 5.86 MB (+1.17 kB) | +0.02% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/shared/rules.ts` | 📈 +182 B (+7.57%) | 2.35 kB → 2.53 kB `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts` | 📈 +966 B (+3.58%) | 26.34 kB → 27.28 kB `home/runner/work/actual/actual/packages/loot-core/src/server/transactions/transaction-rules.ts` | 📈 +85 B (+0.33%) | 25.17 kB → 25.25 kB `home/runner/work/actual/actual/packages/loot-core/src/server/api.ts` | 📈 +11 B (+0.04%) | 25.94 kB → 25.95 kB `home/runner/work/actual/actual/packages/loot-core/src/server/aql/compiler.ts` | 📉 -51 B (-0.16%) | 30.92 kB → 30.87 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.J5RBxcAi.js | 0 B → 5.86 MB (+5.86 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.hYlRL2CV.js | 5.86 MB → 0 B (-5.86 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 ----------- | ----------------- | --------- 1 | 4.4 MB → 4.4 MB (+1.06 kB) | +0.02% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/shared/rules.ts` | 📈 +162 B (+7.91%) | 2 kB → 2.16 kB `src/server/accounts/app.ts` | 📈 +878 B (+3.82%) | 22.47 kB → 23.33 kB `src/server/transactions/transaction-rules.ts` | 📈 +77 B (+0.34%) | 22.35 kB → 22.43 kB `src/server/api.ts` | 📈 +11 B (+0.05%) | 22.7 kB → 22.71 kB `src/server/aql/compiler.ts` | 📉 -47 B (-0.17%) | 27.38 kB → 27.33 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 ----- | --------- | --------- bundle.api.js | 4.4 MB → 4.4 MB (+1.06 kB) | +0.02% **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> </details> <!--- bundlestats-action-comment key:combined end --->
GiteaMirror added the pull-request label 2026-02-28 21:32:25 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6766