Chore: Migrate SearchAutocompleteList to the new SelectionListWithSections#81293
Conversation
…autocomplete-list
SearchAutocompleteList to the new SelectionListWithSections
|
@aimane-chnaif Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da20883a28
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dfba52e38
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Note: We can't easily subscribe to focus/blur events on the ref, so we update on query changes | ||
| // which happen when the user types (meaning input is focused) | ||
| }, [textInputRef, autocompleteQueryValue]); |
There was a problem hiding this comment.
Synchronize external input focus on blur/focus events
This effect only updates updateExternalTextInputFocus when autocompleteQueryValue changes, so focus transitions that do not change text are missed. In flows like opening search and navigating immediately with arrow keys (or refocusing without typing), isTextInputFocusedRef can become stale in BaseSelectionListWithSections, which allows shouldSyncFocus to move focus to list rows and unexpectedly blur the text input.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is a comment that have appeared twice already. After a lot of testing and playing with the arrows the text input stays focused correctly
| const debounceHandleSearch = useDebounce(() => { | ||
| const actionId = `debounce_search_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`; |
There was a problem hiding this comment.
Memoize the debounced search callback
useDebounce cancels and recreates its timer whenever the callback identity changes, and this inline function is recreated on every render. That means unrelated rerenders during the debounce window can drop a pending handleSearch call, causing intermittent missing autocomplete requests even when the query has not changed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This will be memoized by the React Compiler
|
I feel typing input is not quite smooth compared to staging. i.e. Try type Screen.Recording.2026-02-12.at.8.36.15.pm.mov |
|
Hey! I've noticed that you've been comparing |
aimane-chnaif
left a comment
There was a problem hiding this comment.
Let's give it a go but still be on a look out for any regressions QA team might catch.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dfba52e38
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@staszekscp conflicts and codex comment |
…autocomplete-list
…autocomplete-list
|
Just a moment and will be ready! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dfba52e38
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
If the tests pass, we're good to go! |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.19-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.19-5 🚀
|
|
No regressions found in staging QA. Good job 🎉 |
|
Nice one |
Explanation of Change
The PR migrates
SearchAutocompleteListto use the newly refactoredSelectionListWithSectionsin order to improve performance and finish the migration.Fixed Issues
$ #65658
$ #79353
PROPOSAL: N/A
Tests
SearchRouterby clicking on the magnifying glass icon or by pressing Cmd+KOffline tests
QA Steps
SearchRouterby clicking on the magnifying glass icon or by pressing Cmd+KPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-02-05.at.12.26.47.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-02-05.at.11.19.13.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-02-05.at.16.13.50.mov