[PR #7628] Fix Category Group filtering in Custom Report budgeted type #49118

Open
opened 2026-04-26 10:57:25 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7628
Author: @vedparkasharya
Created: 4/26/2026
Status: 🔄 Open

Base: masterHead: fix/category-group-filter-custom-report


📝 Commits (4)

  • a0d67a6 fix: support category_group filtering in budget data query
  • 467b53e fix: allow category_group conditions in budgeted custom reports
  • 541e8f4 docs: add release notes for category group custom report fix
  • 3c0fd27 fix: guard against null category.group in category_group text filter

📊 Changes

3 files changed (+83 additions, -15 deletions)

View changed files

📝 packages/desktop-client/src/components/reports/reports/CustomReport.tsx (+1 -1)
📝 packages/desktop-client/src/components/reports/spreadsheets/budgetDataQuery.ts (+76 -14)
upcoming-release-notes/7550.md (+6 -0)

📄 Description

Summary

Adds Category Group filtering support to the Custom Report when using the Budgeted type, mirroring the fix previously applied to the Budget Analysis Report in #7116.

Problem

When creating a Custom Report with Type set to Budgeted, users could not filter by Category Group. The filter either had no effect or was silently stripped out because:

  1. CustomReport.tsx only allowed category conditions in BUDGETED_SUPPORTED_CONDITION_FIELDS, causing category_group filters to be removed when switching to Budgeted.
  2. budgetDataQuery.ts only looked at cond.field === 'category' when evaluating conditions, completely ignoring category_group filters.

Solution

  1. CustomReport.tsx: Add 'category_group' to BUDGETED_SUPPORTED_CONDITION_FIELDS so Category Group conditions are preserved when Budgeted type is selected.
  2. budgetDataQuery.ts: Update filterCategoriesByConditions to:
    • Accept both category and category_group conditions
    • Build a group name map for text-based operators
    • Evaluate category_group conditions against cat.group (group ID) and group name
    • Support all operators (is, isNot, oneOf, notOneOf, contains, doesNotContain, matches)

Changes

  • packages/desktop-client/src/components/reports/spreadsheets/budgetDataQuery.ts
  • packages/desktop-client/src/components/reports/reports/CustomReport.tsx
  • upcoming-release-notes/7550.md

Testing

  • Verified that category_group conditions are no longer stripped when balanceTypeOp === 'totalBudgeted'.
  • Mentally validated the condition evaluation logic against all supported operators for both category and category_group fields.
  • Confirmed the fix pattern matches the previously merged Budget Analysis Report fix (#7116).

Fixes #7550


🔄 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/7628 **Author:** [@vedparkasharya](https://github.com/vedparkasharya) **Created:** 4/26/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/category-group-filter-custom-report` --- ### 📝 Commits (4) - [`a0d67a6`](https://github.com/actualbudget/actual/commit/a0d67a61f422a9e3a394c5cf95002b20c5e27709) fix: support category_group filtering in budget data query - [`467b53e`](https://github.com/actualbudget/actual/commit/467b53eacb40a8c52a5024c38957331c4400a490) fix: allow category_group conditions in budgeted custom reports - [`541e8f4`](https://github.com/actualbudget/actual/commit/541e8f4d36b8a14c0e833618fbda51fe7f940430) docs: add release notes for category group custom report fix - [`3c0fd27`](https://github.com/actualbudget/actual/commit/3c0fd27161f2642d64fc5c2a33697b74f8ed2a1d) fix: guard against null category.group in category_group text filter ### 📊 Changes **3 files changed** (+83 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/reports/reports/CustomReport.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/reports/spreadsheets/budgetDataQuery.ts` (+76 -14) ➕ `upcoming-release-notes/7550.md` (+6 -0) </details> ### 📄 Description ## Summary Adds Category Group filtering support to the Custom Report when using the Budgeted type, mirroring the fix previously applied to the Budget Analysis Report in #7116. ## Problem When creating a Custom Report with Type set to Budgeted, users could not filter by Category Group. The filter either had no effect or was silently stripped out because: 1. `CustomReport.tsx` only allowed `category` conditions in `BUDGETED_SUPPORTED_CONDITION_FIELDS`, causing `category_group` filters to be removed when switching to Budgeted. 2. `budgetDataQuery.ts` only looked at `cond.field === 'category'` when evaluating conditions, completely ignoring `category_group` filters. ## Solution 1. **CustomReport.tsx**: Add `'category_group'` to `BUDGETED_SUPPORTED_CONDITION_FIELDS` so Category Group conditions are preserved when Budgeted type is selected. 2. **budgetDataQuery.ts**: Update `filterCategoriesByConditions` to: - Accept both `category` and `category_group` conditions - Build a group name map for text-based operators - Evaluate `category_group` conditions against `cat.group` (group ID) and group name - Support all operators (`is`, `isNot`, `oneOf`, `notOneOf`, `contains`, `doesNotContain`, `matches`) ## Changes - `packages/desktop-client/src/components/reports/spreadsheets/budgetDataQuery.ts` - `packages/desktop-client/src/components/reports/reports/CustomReport.tsx` - `upcoming-release-notes/7550.md` ## Testing - Verified that `category_group` conditions are no longer stripped when `balanceTypeOp === 'totalBudgeted'`. - Mentally validated the condition evaluation logic against all supported operators for both `category` and `category_group` fields. - Confirmed the fix pattern matches the previously merged Budget Analysis Report fix (#7116). Fixes #7550 --- <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-26 10:57:25 -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#49118