[PR #7654] [MERGED] Tag autocomplete v2 #109578

Closed
opened 2026-06-02 18:25:18 -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: Merged
Merged: 5/17/2026
Merged by: @youngcw

Base: masterHead: tag-autocomplete-v2


📝 Commits (10+)

  • a0b483a [AI] Make TypeScript work in test files across packages
  • 909649f [AI] Address review feedback on test type fixes
  • c250762 [AI] Drop tsconfig.build.json for loot-core and api
  • a792bf4 first pass at implementation
  • 20f6134 finished implementing what I feel would be a good user experience
  • dff8874 padding update
  • c2a7838 added ability to use tab to select
  • c1cfc17 release notes
  • 3dab7fc updated release notes
  • 4c5c470 auto highlights first entry

📊 Changes

13 files changed (+638 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 (+21 -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 33 13.95 MB → 13.97 MB (+13.26 kB) +0.09%
loot-core 1 5.31 MB → 5.31 MB (+30 B) +0.00%
api 2 3.94 MB → 3.94 MB (+30 B) +0.00%
cli 1 7.97 MB 0%
crdt 1 11.12 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
33 13.95 MB → 13.97 MB (+13.26 kB) +0.09%
Changeset
File Δ Size
src/components/autocomplete/TagAutocomplete.tsx 🆕 +4.65 kB 0 B → 4.65 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 📈 +433 B (+408.49%) 106 B → 539 B
src/components/mobile/transactions/TransactionEdit.tsx 📈 +3.71 kB (+5.78%) 64.09 kB → 67.79 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.09%) 88.28 kB → 90.12 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.96 MB → 5.08 MB (+116.8 kB) +2.30%

Smaller

Asset File Size % Changed
static/js/TransactionEdit.js 190.43 kB → 86.89 kB (-103.54 kB) -54.37%

Unchanged

Asset File Size % Changed
static/js/index.js 2.01 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 146.45 kB 0%
static/js/TransactionList.js 85.81 kB 0%
static/js/bankSyncUtils.js 54.15 kB 0%
static/js/ca.js 187.72 kB 0%
static/js/chart-theme.js 800.08 kB 0%
static/js/client.js 451.37 kB 0%
static/js/da.js 101.28 kB 0%
static/js/de.js 170.38 kB 0%
static/js/en-GB.js 10.01 kB 0%
static/js/en.js 193.42 kB 0%
static/js/es.js 178.83 kB 0%
static/js/extends.js 519.29 kB 0%
static/js/fr.js 178.71 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 165.13 kB 0%
static/js/narrow.js 364.2 kB 0%
static/js/nb-NO.js 148.19 kB 0%
static/js/nl.js 106.34 kB 0%
static/js/pt-BR.js 189.39 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/th.js 174.62 kB 0%
static/js/theme.js 31.67 kB 0%
static/js/uk.js 207.56 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%
static/js/zh-Hans.js 117.75 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.31 MB → 5.31 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.39 kB → 20.42 kB
View detailed bundle breakdown

Added

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

Removed

Asset File Size % Changed
kcab.worker.CT6IRZbP.js 5.31 MB → 0 B (-5.31 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.94 MB → 3.94 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%) 19.93 kB → 19.96 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.94 MB → 3.94 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 11.12 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 11.12 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:** ✅ Merged **Merged:** 5/17/2026 **Merged by:** [@youngcw](https://github.com/youngcw) **Base:** `master` ← **Head:** `tag-autocomplete-v2` --- ### 📝 Commits (10+) - [`a0b483a`](https://github.com/actualbudget/actual/commit/a0b483a1d842f856e2e7acc3d1397b2c7059f18f) [AI] Make TypeScript work in test files across packages - [`909649f`](https://github.com/actualbudget/actual/commit/909649f05f7df48869e3daa0fee34df194543b60) [AI] Address review feedback on test type fixes - [`c250762`](https://github.com/actualbudget/actual/commit/c2507621dc1f9c4ba89865ca318fa1757c192791) [AI] Drop tsconfig.build.json for loot-core and api - [`a792bf4`](https://github.com/actualbudget/actual/commit/a792bf4ebe36699e78d8c1ce8acc54ef31bed22a) first pass at implementation - [`20f6134`](https://github.com/actualbudget/actual/commit/20f6134788dec9cea0eecdfc1ea87b73e0e9463e) finished implementing what I feel would be a good user experience - [`dff8874`](https://github.com/actualbudget/actual/commit/dff8874d99d78a2cfbd0fc1507824be599f7e251) padding update - [`c2a7838`](https://github.com/actualbudget/actual/commit/c2a7838418e9046f96d60a84f5848acb13fc2900) added ability to use tab to select - [`c1cfc17`](https://github.com/actualbudget/actual/commit/c1cfc174c098d2723adbbac76936e69a55ac1dfd) release notes - [`3dab7fc`](https://github.com/actualbudget/actual/commit/3dab7fc9450aa5e25ecf7f3e6d7040fa349a2e0e) updated release notes - [`4c5c470`](https://github.com/actualbudget/actual/commit/4c5c4703667d64ecf6c8ca2d388ae19c8649a0a9) auto highlights first entry ### 📊 Changes **13 files changed** (+638 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` (+21 -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 - [x] Release notes added (see link above) - [x] No obvious regressions in affected areas - [x] 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 | 33 | 13.95 MB → 13.97 MB (+13.26 kB) | +0.09% loot-core | 1 | 5.31 MB → 5.31 MB (+30 B) | +0.00% api | 2 | 3.94 MB → 3.94 MB (+30 B) | +0.00% cli | 1 | 7.97 MB | 0% crdt | 1 | 11.12 kB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 33 | 13.95 MB → 13.97 MB (+13.26 kB) | +0.09% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/components/autocomplete/TagAutocomplete.tsx` | 🆕 +4.65 kB | 0 B → 4.65 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` | 📈 +433 B (+408.49%) | 106 B → 539 B `src/components/mobile/transactions/TransactionEdit.tsx` | 📈 +3.71 kB (+5.78%) | 64.09 kB → 67.79 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.09%) | 88.28 kB → 90.12 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.96 MB → 5.08 MB (+116.8 kB) | +2.30% **Smaller** Asset | File Size | % Changed ----- | --------- | --------- static/js/TransactionEdit.js | 190.43 kB → 86.89 kB (-103.54 kB) | -54.37% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 2.01 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 | 146.45 kB | 0% static/js/TransactionList.js | 85.81 kB | 0% static/js/bankSyncUtils.js | 54.15 kB | 0% static/js/ca.js | 187.72 kB | 0% static/js/chart-theme.js | 800.08 kB | 0% static/js/client.js | 451.37 kB | 0% static/js/da.js | 101.28 kB | 0% static/js/de.js | 170.38 kB | 0% static/js/en-GB.js | 10.01 kB | 0% static/js/en.js | 193.42 kB | 0% static/js/es.js | 178.83 kB | 0% static/js/extends.js | 519.29 kB | 0% static/js/fr.js | 178.71 kB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 13.46 kB | 0% static/js/it.js | 165.13 kB | 0% static/js/narrow.js | 364.2 kB | 0% static/js/nb-NO.js | 148.19 kB | 0% static/js/nl.js | 106.34 kB | 0% static/js/pt-BR.js | 189.39 kB | 0% static/js/resize-observer.js | 18.06 kB | 0% static/js/th.js | 174.62 kB | 0% static/js/theme.js | 31.67 kB | 0% static/js/uk.js | 207.56 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% static/js/zh-Hans.js | 117.75 kB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.31 MB → 5.31 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.39 kB → 20.42 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.eGI4EEyK.js | 0 B → 5.31 MB (+5.31 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CT6IRZbP.js | 5.31 MB → 0 B (-5.31 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.94 MB → 3.94 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%) | 19.93 kB → 19.96 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.94 MB → 3.94 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 | 11.12 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 | 11.12 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-06-02 18:25:18 -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#109578