[PR #3669] [MERGED] Fix category is/is not (nothing) filters #4995

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/3669
Author: @qedi-r
Created: 10/14/2024
Status: Merged
Merged: 11/20/2024
Merged by: @matt-fidd

Base: masterHead: u/qedi-r/category-none


📝 Commits (10+)

  • 76cbcc0 filter out transfers when category is none
  • 67eea09 add filter for parent id
  • 02a0c67 fix Category is not (nothing) as well
  • f07a589 lint fixups
  • d4b787d add special case for 'category is not nothing'
  • 84b0ead add release notes
  • 8d82566 adding tests
  • 4b4d58e lint fix
  • 39ea5df use $and expression for complex condition special cases
  • 7a29cc6 add tests for condition special cases

📊 Changes

9 files changed (+124 additions, -13 deletions)

View changed files

📝 packages/desktop-client/src/components/filters/FiltersMenu.jsx (+1 -0)
📝 packages/loot-core/src/server/accounts/rules.ts (+2 -1)
📝 packages/loot-core/src/server/accounts/transaction-rules.test.ts (+31 -2)
📝 packages/loot-core/src/server/accounts/transaction-rules.ts (+55 -3)
📝 packages/loot-core/src/server/aql/compiler.test.ts (+12 -0)
📝 packages/loot-core/src/server/aql/compiler.ts (+1 -1)
📝 packages/loot-core/src/shared/rules.ts (+13 -6)
📝 packages/loot-core/src/types/models/rule.d.ts (+3 -0)
upcoming-release-notes/3669.md (+6 -0)

📄 Description

Fixes #901, Fixes #904

This fixes up the category filtering when no category is selected. Transfers and split parents both have no category, so when a filter of no category is selected, the other two filters will be added to make it complete. Since transfers have to be specified, this also add support for filtering by is it a transfer or not.

Lastly, it looked like, in the compiler.ts the case for '$ne' NULL seemed incorrect, making the SQL X IS NULL just like the '$eq' NULL path. I would have expected '$ne' NULL to create the X IS NOT NULL, which was required to fix in order to find transactions that are or are not transfers.


🔄 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/3669 **Author:** [@qedi-r](https://github.com/qedi-r) **Created:** 10/14/2024 **Status:** ✅ Merged **Merged:** 11/20/2024 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `u/qedi-r/category-none` --- ### 📝 Commits (10+) - [`76cbcc0`](https://github.com/actualbudget/actual/commit/76cbcc03e0b91b2e03492f721ef7d50f5c83136e) filter out transfers when category is none - [`67eea09`](https://github.com/actualbudget/actual/commit/67eea09d8c0c8f770e428b29445589dec48139c1) add filter for parent id - [`02a0c67`](https://github.com/actualbudget/actual/commit/02a0c67c7d8a1fc4904113e605a99e78dd0951ac) fix Category is not (nothing) as well - [`f07a589`](https://github.com/actualbudget/actual/commit/f07a58934ab7d5045da75ac484844a2384ad13b2) lint fixups - [`d4b787d`](https://github.com/actualbudget/actual/commit/d4b787dab38f7d5810a3b85b982d837f76038a21) add special case for 'category is not nothing' - [`84b0ead`](https://github.com/actualbudget/actual/commit/84b0ead1cf7a89f5953459b94c1d175d8388cf09) add release notes - [`8d82566`](https://github.com/actualbudget/actual/commit/8d8256689aa8fcd43049e5f2c31f9e87a2ac8317) adding tests - [`4b4d58e`](https://github.com/actualbudget/actual/commit/4b4d58e52f7531a30e173ea6b0482e51b10944a2) lint fix - [`39ea5df`](https://github.com/actualbudget/actual/commit/39ea5df5a1dcbad3058ae0a519ea6a82546ed093) use $and expression for complex condition special cases - [`7a29cc6`](https://github.com/actualbudget/actual/commit/7a29cc64b78d74759fe8b6182c40e1feb955c11c) add tests for condition special cases ### 📊 Changes **9 files changed** (+124 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/filters/FiltersMenu.jsx` (+1 -0) 📝 `packages/loot-core/src/server/accounts/rules.ts` (+2 -1) 📝 `packages/loot-core/src/server/accounts/transaction-rules.test.ts` (+31 -2) 📝 `packages/loot-core/src/server/accounts/transaction-rules.ts` (+55 -3) 📝 `packages/loot-core/src/server/aql/compiler.test.ts` (+12 -0) 📝 `packages/loot-core/src/server/aql/compiler.ts` (+1 -1) 📝 `packages/loot-core/src/shared/rules.ts` (+13 -6) 📝 `packages/loot-core/src/types/models/rule.d.ts` (+3 -0) ➕ `upcoming-release-notes/3669.md` (+6 -0) </details> ### 📄 Description Fixes #901, Fixes #904 This fixes up the category filtering when no category is selected. Transfers and split parents both have no category, so when a filter of no category is selected, the other two filters will be added to make it complete. Since transfers have to be specified, this also add support for filtering by is it a transfer or not. Lastly, it looked like, in the compiler.ts the case for `'$ne' NULL` seemed incorrect, making the SQL `X IS NULL` just like the `'$eq' NULL` path. I would have expected `'$ne' NULL` to create the `X IS NOT NULL`, which was required to fix in order to find transactions that are or are not transfers. --- <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-02-28 21:04:24 -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#4995