-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use autocomplete on Search Results Header #52568
Use autocomplete on Search Results Header #52568
Conversation
5693688
to
19058b3
Compare
@Kicu how's this PR coming along? |
@luacmartins I expect that I will open it for review today :) most of the heavy work is done and I have autocomplete components working on the Results page |
19058b3
to
4a7922e
Compare
4a7922e
to
b7883d4
Compare
* Given a filter name and its value, this function returns the corresponding ID found in Onyx data. | ||
* Returns a function that can be used as a computeNodeValue callback for traversing the filters tree | ||
*/ | ||
function getFindIDFromDisplayValue(cardList: OnyxTypes.CardList, taxRates: Record<string, string[]>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is no longer needed because now substitutionsMap
always keeps the connection between id
and name
Nice! Looking forward to this one |
b7883d4
to
29ee84f
Compare
@rayane-djouah 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] |
For the reviewer: However I didn't do these yet, since I thought they might make the review tricker in case git treats them as completely new files 😛 |
@rayane-djouah let's prioritize reviewing this one |
Also I would like to get some feedback from the UX team about how this list should look. VS CC @shawnborton |
This is what we want the styles to look like: CleanShot.2024-11-20.at.14.05.00.mp4On mobile, we basically just use the whole view and add a close button to the top right: 384986249-40070501-1cec-4b7e-afef-fc242a389859.mp4Note that we have some overlap here with this upcoming issue too: #52317 |
I Will review it this afternoon 👍 |
@shawnborton @luacmartins whoops... sorry we never discussed this on mobile 😅 In this PR code is not ready to work on mobile, as the input was never there from the beginning. I think the best course of action is to leave the mobile implementation for #52317 - it will fit nicely there. Either me or someone else from SWM will pick this one up shortly. On the other hand this PR adds a lot of logic and improves autocomplete behavior so I think it's best to not add any more scope to it. I will try to make the list look good enough for this PR. |
That works for me, just want you to be aware of the upcoming changes so we aren't duplicating the work. And ideally you can at least get web/desktop looking like my video above. Thanks! |
Alright 👍 Then I suggest we lock the scope of this PR to what we have here, and please @rayane-djouah can you come back to review. If I remove cmd+k now, then you cannot move out of this page. But I can start work on another PR that would make Input behave almost the same as the router, so perhaps doing the cmd+k there would make more sense? Just to confirm, the search input here will have:
Anything else? |
Issue here: #53126 |
Agreed on slack discussion that new behavior of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and tests well
BUG: The suggestion box container height briefly exceeds the height of the suggestions Screen.Recording.2024-11-26.at.7.58.22.PM.mov |
BUG: Clicking on an autocomplete suggestion does not automatically re-focus the input. android_mweb_chrome.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and tests well 👍
I think that #52568 (comment) and #52568 (comment) are not blockers |
Checklist completed: #52568 (comment) |
Agree that those are not blockers. Thanks for catching them though. @Kicu let's address them in the follow up |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
Hmm maybe this PR introduced a performance regression @Kicu |
@luacmartins I will look into that possible regression. I think for the code it is great that this one is merged. |
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.68-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.68-7 🚀
|
Explanation of Change
This PR is a followup to #51633 which added better handling of autocomplete ids. However we were missing this in the input on SearchResults page - this PR implements that.
A lot of refactors were needed so that we can reuse the code and ensure the same behavior of autocomplete lists both in SearchRouter and on the results page.
Here's how it looks
Note: this Input exists only on wide/desktop version.
main changes
SearchRouterList
, which is now used in two places;SearchRouter
because we don't want it in the results page;SearchPageHeaderInput
: it basically does the same things asSearchRouter
but without the "routing" part 😅 for the Results Page;SearchRouterList
because they became too complexSubstitutionsMap
, so now there is no need for function likefindIDFromDisplayValue
old bugs fixed
OptionsUtils.getFilteredOptions
so sorting is better and same as in the Advanced Filters selectorscardID
seem to display last 4 digits (it's hard for me to test every edge case as I only have fake card data)currentUser
option now included infrom
/to
Fixed Issues
$ #50976
PROPOSAL:
Tests
from:
,to:
,in:
, 'cardID:,
taxRate:`Offline tests
QA Steps
from:
,to:
,in:
, 'cardID:,
taxRate:`PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
rec-andr-autocomplete.mp4
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
rec-web-autocomplete.mp4
MacOS: Desktop