[PR #5438] [MERGED] fix filter transactions by closed account transfer payee #40364

Closed
opened 2026-04-23 13:14:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5438
Author: @Serializator
Created: 8/1/2025
Status: Merged
Merged: 8/19/2025
Merged by: @joel-jeremy

Base: masterHead: allow-filter-by-transfer-payee-from-closed-account-5370


📝 Commits (3)

  • 141ccb3 fix filter transactions by closed account transfer payee
  • 1e5ae2d apply equivalent ignore pattern to arguments as variables in eslint
  • f749a61 [autofix.ci] apply automated fixes

📊 Changes

6 files changed (+103 additions, -15 deletions)

View changed files

📝 eslint.config.mjs (+1 -0)
📝 packages/desktop-client/src/components/FixedSizeList.tsx (+0 -1)
📝 packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx (+24 -13)
📝 packages/desktop-client/src/components/filters/FiltersMenu.jsx (+10 -1)
packages/desktop-client/src/components/filters/PayeeFilter.tsx (+62 -0)
upcoming-release-notes/5438.md (+6 -0)

📄 Description

The GenericInput component automatically filters transfer payees from closed accounts.

This behavior is desirable when payees to be selected must exist (e.g. set the payee of a transaction) but less so when you want to filter on a transfer payee from a closed account.

I decided not to "hack" this into the existing GenericInput component but create a PayeeFilter component. Hacking it into the GenericInput component would've required prop drilling from FiltersMenu into the GenericInput to the PayeeAutocomplete component. Adding yet another property to the GenericInput which is only meant for one type, as already done with the multi property which is only relevant for autocomplete.

This PR also contains the slight refactoring of filterActivePayees to extract logic about transfer payees which now needs to be independent of whether the transfer payee is active or not.

I decided to keep filterActivePayees even though in reality it only wraps another function. The reason for this decision is to make the intent immediately obvious, to filter. This can of course be changed if preferred.

What about the TypeScript ignore? 💥

Yes... Hiding from your problems does not make them go away! This is different, as always... Typing is not playing nice with the union type of AutocompleteProps which is a union of SingleAutocompleteProps and MultiAutocompleteProps where the type and onSelect are problematic.

I wasn't able to get this to work nicely and I tried to do so for hours.

yarn packages/desktop-client/src/components/filters/PayeeFilter.tsx:39:11 - error TS2322: Type '{ type: "single" | "multi"; showInactivePayees: true; showMakeTransfer: false; openOnFocus: true; value: PayeeFilterValue; inputProps: { placeholder: string; }; onSelect: (payeeIdOrIds: string | string[], _: string) => void; }' is not assignable to type 'IntrinsicAttributes & PayeeAutocompleteProps'.
  Type '{ type: "single" | "multi"; showInactivePayees: true; showMakeTransfer: false; openOnFocus: true; value: PayeeFilterValue; inputProps: { placeholder: string; }; onSelect: (payeeIdOrIds: string | string[], _: string) => void; }' is not assignable to type '{ type: "multi"; onSelect: (ids: string[], id?: string) => void; value: string[] | PayeeEntity[]; }'.
    Types of property 'type' are incompatible.
      Type '"single" | "multi"' is not assignable to type '"multi"'.
        Type '"single"' is not assignable to type '"multi"'.

39   return <PayeeAutocomplete

Fixes #5370


🔄 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/5438 **Author:** [@Serializator](https://github.com/Serializator) **Created:** 8/1/2025 **Status:** ✅ Merged **Merged:** 8/19/2025 **Merged by:** [@joel-jeremy](https://github.com/joel-jeremy) **Base:** `master` ← **Head:** `allow-filter-by-transfer-payee-from-closed-account-5370` --- ### 📝 Commits (3) - [`141ccb3`](https://github.com/actualbudget/actual/commit/141ccb3e657192d0d348d2f646aa7d820e6de49e) fix filter transactions by closed account transfer payee - [`1e5ae2d`](https://github.com/actualbudget/actual/commit/1e5ae2d4eef24b9407797780e9c777a24bf876c5) apply equivalent ignore pattern to arguments as variables in eslint - [`f749a61`](https://github.com/actualbudget/actual/commit/f749a6139ee308021471d412724cc101af1d6e82) [autofix.ci] apply automated fixes ### 📊 Changes **6 files changed** (+103 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `eslint.config.mjs` (+1 -0) 📝 `packages/desktop-client/src/components/FixedSizeList.tsx` (+0 -1) 📝 `packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx` (+24 -13) 📝 `packages/desktop-client/src/components/filters/FiltersMenu.jsx` (+10 -1) ➕ `packages/desktop-client/src/components/filters/PayeeFilter.tsx` (+62 -0) ➕ `upcoming-release-notes/5438.md` (+6 -0) </details> ### 📄 Description The `GenericInput` component automatically filters transfer payees from closed accounts. This behavior is desirable when payees to be selected must exist (e.g. set the payee of a transaction) but less so when you want to filter on a transfer payee from a closed account. I decided not to "hack" this into the existing `GenericInput` component but create a `PayeeFilter` component. Hacking it into the `GenericInput` component would've required prop drilling from `FiltersMenu` into the `GenericInput` to the `PayeeAutocomplete` component. Adding yet another property to the `GenericInput` which is only meant for **one** type, as already done with the `multi` property which is only relevant for autocomplete. This PR also contains the slight refactoring of `filterActivePayees` to extract logic about transfer payees which now needs to be independent of whether the transfer payee is active or not. I decided to keep `filterActivePayees` even though in reality it only wraps another function. The reason for this decision is to make the intent immediately obvious, to filter. This can of course be changed if preferred. **What about the TypeScript ignore?** 💥 Yes... Hiding from your problems does not make them go away! This is different, as always... Typing is not playing nice with the union type of `AutocompleteProps` which is a union of `SingleAutocompleteProps` and `MultiAutocompleteProps` where the `type` and `onSelect` are problematic. I wasn't able to get this to work nicely and I tried to do so for hours. ``` yarn packages/desktop-client/src/components/filters/PayeeFilter.tsx:39:11 - error TS2322: Type '{ type: "single" | "multi"; showInactivePayees: true; showMakeTransfer: false; openOnFocus: true; value: PayeeFilterValue; inputProps: { placeholder: string; }; onSelect: (payeeIdOrIds: string | string[], _: string) => void; }' is not assignable to type 'IntrinsicAttributes & PayeeAutocompleteProps'. Type '{ type: "single" | "multi"; showInactivePayees: true; showMakeTransfer: false; openOnFocus: true; value: PayeeFilterValue; inputProps: { placeholder: string; }; onSelect: (payeeIdOrIds: string | string[], _: string) => void; }' is not assignable to type '{ type: "multi"; onSelect: (ids: string[], id?: string) => void; value: string[] | PayeeEntity[]; }'. Types of property 'type' are incompatible. Type '"single" | "multi"' is not assignable to type '"multi"'. Type '"single"' is not assignable to type '"multi"'. 39 return <PayeeAutocomplete ``` ---- Fixes #5370 --- <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-23 13:14:51 -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#40364