-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add recent serches and recent chats in Search router #49457
Add recent serches and recent chats in Search router #49457
Conversation
This is looking really good so far! |
Sorry for the slow pace, I was working shorter hours today 😅 I asked @Kicu for internal review but he will complete it next week, as he's already gone. |
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.
I tested and looks really good.
I found one small bug and a bunch of small improvements with naming and comments, so please check them and update.
Also question/possible bug:
Should recent reports also be filterable? because right now if I use chat finder, I can find different chats there, but in your PR they stay static.
We can of course add this in a separate PR, but I think if the plan is to completely remove Chat finder, then we should reimplement all its functionalities here.
Yes, we can add this in a follow up, but we should be able to filter reports while typing into the search router |
As it turns out that small refactor is needed I just need one day to make it C+ reviewable. |
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.
I dropped some extra 1-2 comments for you, since you have a lot of linting errors.
I have not yet checked the complicated type casts - will do that later today
} | ||
}, SEARCH_DEBOUNCE_DELAY); | ||
const onSearchChange = useCallback( | ||
debounce((userQuery: 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.
@SzymczakJ
this construct useCallback(debounce(...
will not pass our linting. I know because I faced this problem in the past.
Feel free to read more about this lint rule.
The solution will be either to drop useCallback
for now, and make sure the function inside is not too computation-heavy, or eslint-ignore this line.
Alternatively check this article: https://kyleshevlin.com/debounce-and-throttle-callbacks-with-react-hooks/
For the record I think this warning is more like:
eslint cannot figure out what this function argument are, so it shouts a warning
than
this is bad react code
if (!currentQuery?.inputQuery && recentSearchesData && recentSearchesData.length > 0) { | ||
sections.push({title: translate('search.recentSearches'), data: recentSearchesData}); | ||
} |
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.
We are currently excluding recent search options when a query is typed, but instead, we should retain them and filter them based on the typed query.
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.
@rayane-djouah we decided to just remove recent searches from the list as soon as the user starts typing. Reason is that the list only ever has 5 entries and filtering the list is a bit overkill.
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.
Nice!
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid_native.mp4Android: mWeb Chromeandroid_mweb_chrome.mp4iOS: NativeSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-10-02.at.20.27.58.mp4iOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-10-02.at.20.16.17.mp4MacOS: Chrome / SafariScreen.Recording.2024-10-02.at.8.07.14.PM.movMacOS: DesktopScreen.Recording.2024-10-02.at.8.10.18.PM.mov |
|
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. Let's address the above comments in follow-ups
✋ 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. |
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. |
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.44-0 🚀
|
Cc @SzymczakJ could you please take a look at the performance regression above? I'm not sure if it came from this PR, but we should investigate |
Investigating |
The reported performance regression can be ignored, see: |
@hannojg I've just made a PR with possible fix: #50143. Performance was probably worsened by putting |
Ah, i didn't realise that the component was rendered so high up in the tree. yes, agree, its probably likely due to that! |
This PR is failing because of issue #50220 |
Replied here: #50220 (comment) |
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.44-12 🚀
|
Details
This PR adds recent chats and recent searches to search router.
Fixed Issues
$ #49120
$ #49116
PROPOSAL:
Tests
Offline tests
QA Steps
same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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.mov
Android: mWeb Chrome
androidWeb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
iosWeb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov