[PR #7654] Tag autocomplete v2 #56617

Open
opened 2026-05-01 04:36:10 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7654
Author: @alecbakholdin
Created: 4/28/2026
Status: 🔄 Open

Base: masterHead: tag-autocomplete-v2


📝 Commits (10+)

  • 758e506 [AI] Make TypeScript work in test files across packages
  • a719a31 [AI] Address review feedback on test type fixes
  • a629634 [AI] Drop tsconfig.build.json for loot-core and api
  • d0c04e1 first pass at implementation
  • 6873203 finished implementing what I feel would be a good user experience
  • 173c98e padding update
  • fcc2117 added ability to use tab to select
  • 3bfbfd6 release notes
  • 689d88b updated release notes
  • 331a9e9 auto highlights first entry

📊 Changes

13 files changed (+644 additions, -24 deletions)

View changed files

📝 packages/desktop-client/e2e/page-models/account-page.ts (+1 -1)
packages/desktop-client/src/components/autocomplete/TagAutocomplete.tsx (+212 -0)
📝 packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx (+93 -0)
📝 packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx (+80 -0)
📝 packages/desktop-client/src/components/transactions/TransactionsTable.tsx (+80 -18)
packages/desktop-client/src/hooks/useCurrentWordRange.ts (+31 -0)
packages/desktop-client/src/hooks/useCursorPosition.ts (+37 -0)
packages/desktop-client/src/hooks/useInputRefValue.ts (+40 -0)
packages/desktop-client/src/hooks/useRefEventListener.ts (+27 -0)
📝 packages/desktop-client/src/hooks/useTags.ts (+27 -0)
📝 packages/desktop-client/src/style/styles.ts (+1 -0)
📝 packages/loot-core/src/server/db/index.ts (+9 -5)
upcoming-release-notes/7654.md (+6 -0)

📄 Description

Description

This PR is a rewrite of a PR I opened over a year ago now #4682 . Now that tags have a UI are configurable and all that good stuff, I'm reopening this as I saw some interest in the #project-tags discord channel. I will be posting this there so people can test this.

I spent an immense amount of time trying to use our existing Autocomplete implementation, but Downshift was determined not to let me use it the way I needed to. It was more effort to work around Downshift's limitations than it was to simply create a new one using react-aria-components.

Huge thanks to @Juulz , @youngcw , and PuddleOfFat from Discord for their testing and feedback.

Desktop Implementation

  1. Keyboard-first navigation (ArrowUp, ArrowDown, Home/End)
  2. Tab, Enter, or Mouse click to select
  3. Hidden and does not affect functionality until # is entered
📹Video

https://github.com/user-attachments/assets/d5723f3e-ef9e-453d-a3b1-8cd94c5d0f47

Mobile Implementation

  1. Small screen real estate
  2. Clickable mid-edit
  3. Hidden and does not affect functionality until # is entered
📹Video

https://github.com/user-attachments/assets/fc5d304a-a7b8-4b78-8861-95732bcf7786

Duplicates #4682

Testing

Test anywhere with autocompletes, e.g. category, payee, account dropdowns
Test editing the Transaction Table notes field.

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

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 34 13.93 MB → 13.95 MB (+15.46 kB) +0.11%
loot-core 1 5.27 MB → 5.27 MB (+30 B) +0.00%
api 2 3.89 MB → 3.89 MB (+30 B) +0.00%
cli 1 7.97 MB 0%
crdt 1 41.83 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
34 13.93 MB → 13.95 MB (+15.46 kB) +0.11%
Changeset
File Δ Size
src/components/autocomplete/TagAutocomplete.tsx 🆕 +4.65 kB 0 B → 4.65 kB
node_modules/@react-aria/i18n/dist/useFilter.mjs 🆕 +1.36 kB 0 B → 1.36 kB
src/hooks/useCursorPosition.ts 🆕 +971 B 0 B → 971 B
src/hooks/useCurrentWordRange.ts 🆕 +691 B 0 B → 691 B
src/hooks/useInputRefValue.ts 🆕 +626 B 0 B → 626 B
src/hooks/useRefEventListener.ts 🆕 +449 B 0 B → 449 B
src/hooks/useTags.ts 📈 +817 B (+770.75%) 106 B → 923 B
src/components/mobile/transactions/TransactionEdit.tsx 📈 +3.71 kB (+5.78%) 64.06 kB → 67.76 kB
src/components/mobile/MobileBackButton.tsx 📈 +61 B (+3.59%) 1.66 kB → 1.72 kB
src/style/styles.ts 📈 +41 B (+2.39%) 1.68 kB → 1.72 kB
src/components/transactions/TransactionsTable.tsx 📈 +1.84 kB (+2.08%) 88.46 kB → 90.31 kB
locale/zh-Hans.json 📈 +476 B (+0.40%) 117.58 kB → 118.05 kB
node_modules/@react-aria/utils/dist/useUpdateLayoutEffect.mjs 📉 -64 B (-8.44%) 758 B → 694 B
node_modules/@react-aria/listbox/dist/utils.mjs 📉 -72 B (-11.63%) 619 B → 547 B
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/Value.js 4.94 MB → 5.06 MB (+118.53 kB) +2.34%
static/js/zh-Hans.js 117.58 kB → 118.05 kB (+476 B) +0.40%

Smaller

Asset File Size % Changed
static/js/TransactionEdit.js 189.54 kB → 86 kB (-103.54 kB) -54.63%

Unchanged

Asset File Size % Changed
static/js/index.js 1.93 MB 0%
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 145.68 kB 0%
static/js/TransactionList.js 85.81 kB 0%
static/js/alerts.js 800.08 kB 0%
static/js/bankSyncUtils.js 54.11 kB 0%
static/js/ca.js 188.08 kB 0%
static/js/client.js 451.37 kB 0%
static/js/da.js 101.57 kB 0%
static/js/de.js 170.73 kB 0%
static/js/en-GB.js 8.2 kB 0%
static/js/en.js 185.36 kB 0%
static/js/es.js 179.16 kB 0%
static/js/extends.js 518.66 kB 0%
static/js/fr.js 179.07 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 165.19 kB 0%
static/js/narrow.js 364.02 kB 0%
static/js/nb-NO.js 148.48 kB 0%
static/js/nl.js 106.65 kB 0%
static/js/pl.js 86.67 kB 0%
static/js/pt-BR.js 190.09 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/th.js 175.02 kB 0%
static/js/theme.js 31.67 kB 0%
static/js/uk.js 207.95 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%

loot-core

Total

Files count Total bundle size % Changed
1 5.27 MB → 5.27 MB (+30 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/db/index.ts 📈 +30 B (+0.14%) 20.56 kB → 20.59 kB
View detailed bundle breakdown

Added

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

Removed

Asset File Size % Changed
kcab.worker.DPChB-0o.js 5.27 MB → 0 B (-5.27 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.89 MB → 3.89 MB (+30 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/db/index.ts 📈 +30 B (+0.15%) 20.11 kB → 20.14 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.89 MB → 3.89 MB (+30 B) +0.00%

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 41.83 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 41.83 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/7654 **Author:** [@alecbakholdin](https://github.com/alecbakholdin) **Created:** 4/28/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `tag-autocomplete-v2` --- ### 📝 Commits (10+) - [`758e506`](https://github.com/actualbudget/actual/commit/758e506784b4805d38828ed26506068d9355abfb) [AI] Make TypeScript work in test files across packages - [`a719a31`](https://github.com/actualbudget/actual/commit/a719a310d6dbbcc96af48bae55a4559285ba206a) [AI] Address review feedback on test type fixes - [`a629634`](https://github.com/actualbudget/actual/commit/a62963463a71a8a765c5749762823e63e2eca988) [AI] Drop tsconfig.build.json for loot-core and api - [`d0c04e1`](https://github.com/actualbudget/actual/commit/d0c04e17f64198d7d61be4ee6ae0535e28b7e854) first pass at implementation - [`6873203`](https://github.com/actualbudget/actual/commit/687320316eee454ebd8e0c2468a00e55025c446e) finished implementing what I feel would be a good user experience - [`173c98e`](https://github.com/actualbudget/actual/commit/173c98e47593707a9a4906f066b21b4d4ae97bb6) padding update - [`fcc2117`](https://github.com/actualbudget/actual/commit/fcc2117bf14663e48ef0aae7994ac1df463bec14) added ability to use tab to select - [`3bfbfd6`](https://github.com/actualbudget/actual/commit/3bfbfd6926881ebaa903da048d4ba50b069b5b70) release notes - [`689d88b`](https://github.com/actualbudget/actual/commit/689d88b97bc2609c741c85a9422f8865af5a2dfe) updated release notes - [`331a9e9`](https://github.com/actualbudget/actual/commit/331a9e9432e84c346d796fe5979dd8db9a895ded) auto highlights first entry ### 📊 Changes **13 files changed** (+644 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/e2e/page-models/account-page.ts` (+1 -1) ➕ `packages/desktop-client/src/components/autocomplete/TagAutocomplete.tsx` (+212 -0) 📝 `packages/desktop-client/src/components/mobile/transactions/TransactionEdit.tsx` (+93 -0) 📝 `packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx` (+80 -0) 📝 `packages/desktop-client/src/components/transactions/TransactionsTable.tsx` (+80 -18) ➕ `packages/desktop-client/src/hooks/useCurrentWordRange.ts` (+31 -0) ➕ `packages/desktop-client/src/hooks/useCursorPosition.ts` (+37 -0) ➕ `packages/desktop-client/src/hooks/useInputRefValue.ts` (+40 -0) ➕ `packages/desktop-client/src/hooks/useRefEventListener.ts` (+27 -0) 📝 `packages/desktop-client/src/hooks/useTags.ts` (+27 -0) 📝 `packages/desktop-client/src/style/styles.ts` (+1 -0) 📝 `packages/loot-core/src/server/db/index.ts` (+9 -5) ➕ `upcoming-release-notes/7654.md` (+6 -0) </details> ### 📄 Description <!-- 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. --> ## Description This PR is a rewrite of a PR I opened over a year ago now #4682 . Now that tags have a UI are configurable and all that good stuff, I'm reopening this as I saw some interest in the #project-tags discord channel. I will be posting this there so people can test this. I spent an immense amount of time trying to use our existing Autocomplete implementation, but Downshift was determined not to let me use it the way I needed to. It was more effort to work around Downshift's limitations than it was to simply create a new one using react-aria-components. Huge thanks to @Juulz , @youngcw , and PuddleOfFat from Discord for their testing and feedback. ### Desktop Implementation 1. Keyboard-first navigation (ArrowUp, ArrowDown, Home/End) 2. Tab, Enter, or Mouse click to select 3. Hidden and does not affect functionality until `#` is entered <details> <summary>📹Video</summary> https://github.com/user-attachments/assets/d5723f3e-ef9e-453d-a3b1-8cd94c5d0f47 </details> ### Mobile Implementation 1. Small screen real estate 2. Clickable mid-edit 3. Hidden and does not affect functionality until `#` is entered <details> <summary>📹Video</summary> https://github.com/user-attachments/assets/fc5d304a-a7b8-4b78-8861-95732bcf7786 </details> ## Related issue(s) Duplicates #4682 ## Testing Test anywhere with autocompletes, e.g. category, payee, account dropdowns Test editing the Transaction Table notes field. ## 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 <!--- actual-bot-sections ---> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 34 | 13.93 MB → 13.95 MB (+15.46 kB) | +0.11% loot-core | 1 | 5.27 MB → 5.27 MB (+30 B) | +0.00% api | 2 | 3.89 MB → 3.89 MB (+30 B) | +0.00% cli | 1 | 7.97 MB | 0% crdt | 1 | 41.83 kB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 34 | 13.93 MB → 13.95 MB (+15.46 kB) | +0.11% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/components/autocomplete/TagAutocomplete.tsx` | 🆕 +4.65 kB | 0 B → 4.65 kB `node_modules/@react-aria/i18n/dist/useFilter.mjs` | 🆕 +1.36 kB | 0 B → 1.36 kB `src/hooks/useCursorPosition.ts` | 🆕 +971 B | 0 B → 971 B `src/hooks/useCurrentWordRange.ts` | 🆕 +691 B | 0 B → 691 B `src/hooks/useInputRefValue.ts` | 🆕 +626 B | 0 B → 626 B `src/hooks/useRefEventListener.ts` | 🆕 +449 B | 0 B → 449 B `src/hooks/useTags.ts` | 📈 +817 B (+770.75%) | 106 B → 923 B `src/components/mobile/transactions/TransactionEdit.tsx` | 📈 +3.71 kB (+5.78%) | 64.06 kB → 67.76 kB `src/components/mobile/MobileBackButton.tsx` | 📈 +61 B (+3.59%) | 1.66 kB → 1.72 kB `src/style/styles.ts` | 📈 +41 B (+2.39%) | 1.68 kB → 1.72 kB `src/components/transactions/TransactionsTable.tsx` | 📈 +1.84 kB (+2.08%) | 88.46 kB → 90.31 kB `locale/zh-Hans.json` | 📈 +476 B (+0.40%) | 117.58 kB → 118.05 kB `node_modules/@react-aria/utils/dist/useUpdateLayoutEffect.mjs` | 📉 -64 B (-8.44%) | 758 B → 694 B `node_modules/@react-aria/listbox/dist/utils.mjs` | 📉 -72 B (-11.63%) | 619 B → 547 B </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/Value.js | 4.94 MB → 5.06 MB (+118.53 kB) | +2.34% static/js/zh-Hans.js | 117.58 kB → 118.05 kB (+476 B) | +0.40% **Smaller** Asset | File Size | % Changed ----- | --------- | --------- static/js/TransactionEdit.js | 189.54 kB → 86 kB (-103.54 kB) | -54.63% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 1.93 MB | 0% 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 | 145.68 kB | 0% static/js/TransactionList.js | 85.81 kB | 0% static/js/alerts.js | 800.08 kB | 0% static/js/bankSyncUtils.js | 54.11 kB | 0% static/js/ca.js | 188.08 kB | 0% static/js/client.js | 451.37 kB | 0% static/js/da.js | 101.57 kB | 0% static/js/de.js | 170.73 kB | 0% static/js/en-GB.js | 8.2 kB | 0% static/js/en.js | 185.36 kB | 0% static/js/es.js | 179.16 kB | 0% static/js/extends.js | 518.66 kB | 0% static/js/fr.js | 179.07 kB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 13.46 kB | 0% static/js/it.js | 165.19 kB | 0% static/js/narrow.js | 364.02 kB | 0% static/js/nb-NO.js | 148.48 kB | 0% static/js/nl.js | 106.65 kB | 0% static/js/pl.js | 86.67 kB | 0% static/js/pt-BR.js | 190.09 kB | 0% static/js/resize-observer.js | 18.06 kB | 0% static/js/th.js | 175.02 kB | 0% static/js/theme.js | 31.67 kB | 0% static/js/uk.js | 207.95 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% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.27 MB → 5.27 MB (+30 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/db/index.ts` | 📈 +30 B (+0.14%) | 20.56 kB → 20.59 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.DuUX__Mq.js | 0 B → 5.27 MB (+5.27 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.DPChB-0o.js | 5.27 MB → 0 B (-5.27 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.89 MB → 3.89 MB (+30 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/db/index.ts` | 📈 +30 B (+0.15%) | 20.11 kB → 20.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.89 MB → 3.89 MB (+30 B) | +0.00% **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 | 41.83 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 | 41.83 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-01 04:36:10 -05:00
GiteaMirror changed title from [PR #7654] [WIP] Tag autocomplete v2 to [PR #7654] Tag autocomplete v2 2026-05-07 03:19:27 -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#56617