Add search input to mobile search page(with fixed performance)#56326
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
@sobitneupane 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] |
|
🚧 @luacmartins has triggered a test build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@IuliiaHerets could you please run the test steps from this issue using the builds here. Hopefully that issue is fixed in this build |
|
@ikevin127 All yours as you were reviewer in the previous reverted PR. Please let me know if you won't be available to review the PR. |
|
@sobitneupane Thanks, I'll start working on the checklist, making sure to test all issues encountered last time which led to the revert 👍 |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.webmAndroid: mWeb Chromeandroid-mweb.webmiOS: Nativeios.mp4iOS: mWeb Safariios-mweb.mp4MacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
Kicu
left a comment
There was a problem hiding this comment.
Went over the PR, it gets quite complicated with all the changes of components :/ but in general great work on this
src/styles/index.ts
Outdated
| flex: 1, | ||
| }, | ||
|
|
||
| typePopoverButtonStyle: { |
There was a problem hiding this comment.
I know that we have a preference to use style props/consts but I think if it's just a class for 1 line of styles, then maybe it's better to just inline theme.sidebarHover in the component that it's used?
| contentWidth, | ||
| loadingSpinnerStyle, | ||
| uncontrolled = false, | ||
| placeholderTextColor, |
src/libs/CardUtils.ts
Outdated
| } | ||
|
|
||
| function mergeCardListWithWorkspaceFeeds(workspaceFeeds: Record<string, WorkspaceCardsList | undefined>, cardList = allCards, shouldExcludeCardHiddenFromSearch = false) { | ||
| function mergeCardListWithWorkspaceFeeds(workspaceFeeds: Record<string, WorkspaceCardsList | undefined> | undefined, cardList = allCards, shouldExcludeCardHiddenFromSearch = false) { |
There was a problem hiding this comment.
IMO it looks bad when the first argument can be undefined but there are other arguments after it. It is technically "correct" from the perspective of JS/TS but bad function design.
Can we revert the change? did you do it just to avoid creating empty objects in other places in Search code?
| }, | ||
| }); | ||
| } | ||
| typeMenuItems.push({ |
There was a problem hiding this comment.
| typeMenuItems.push({ | |
| typeMenuItems.push({ |
| } | ||
| textInputRef.current.blur(); | ||
| // eslint-disable-next-line react-compiler/react-compiler | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps |
There was a problem hiding this comment.
| // eslint-disable-next-line react-hooks/exhaustive-deps | |
| // eslint-disable-next-line react-compiler/react-compiler react-hooks/exhaustive-deps |
1 line less ;)
| </View> | ||
| {displaySignIn && <SignInButton />} | ||
| {shouldDisplayCancelSearch && ( | ||
| {shouldDisplayCancel && ( |
There was a problem hiding this comment.
NAB - reminder for me to discuss 1 thing about using shouldDisplayCancel + callback
|
@luacmartins Tester cannot repro the issue using mentioned builds Screen_Recording_20250206_214923_New.Expensify.AdHoc.mp4 |
|
I've improved performance of the TextInput animation, tell me what do you think @shawnborton. |
|
🚧 @luacmartins has triggered a test build. You can view the workflow run here. |
|
I've kicked off an adhoc build |
Thanks @IuliiaHerets |
|
Any idea why the bookmark button bounces so weirdly when navigating? Seems like it only happens sometimes but it's enough to notice. (This video is from the iOS ad hoc build) ScreenRecording_02-18-2025.14-12-21_1.MP4 |
|
@SzymczakJ let's try to address the comments above. @ikevin127 could you review this PR once again once you're online please? |
ikevin127
left a comment
There was a problem hiding this comment.
🟢 Issues mentioned in #56326 (comment) were adddressed / fixed, this looks good and I think it's ready to merge with the mention that the 2 non-blocker issues from above could be addressed in a follow-up if not before this merges 👍
luacmartins
left a comment
There was a problem hiding this comment.
LGTM. We have two design issues, but let's address them in a follow up. Failing test is also unrelated to this PR.
|
@luacmartins looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
See comment above |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.1.1-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.1.1-6 🚀
|
| {showPopupButton && ( | ||
| <Animated.View | ||
| entering={FadeInRight} | ||
| exiting={FadeOutRight} |
There was a problem hiding this comment.
we should have only put the exit animation if isFocused was true, this caused #57151
| ...baseMenuItem, | ||
| onSelected: baseMenuItem.onPress, | ||
| rightComponent: ( |
There was a problem hiding this comment.
{BZ CHECKLIST} there was regression resulting in double navigation resulting from the presence of onPress and onSelect at the same time
| import type {SaveSearchItem} from '@src/types/onyx/SaveSearch'; | ||
|
|
||
| type SavedSearchMenuItem = MenuItemWithLink & { | ||
| key: string; |
There was a problem hiding this comment.
@SzymczakJ Hi, can I ask for the use of key prop here? Currently I don't see any place that requires key, and it caused #58261.
There was a problem hiding this comment.
The key prop here is accidentally spread into another component causing a dev warning #58261
|
Coming from issue #57493, a bug was found on mWeb Safari with existing popover modal logic but only reproducible with this feature |
| <View style={[styles.appBG, styles.flex1]}> | ||
| <View style={[styles.flexRow, styles.mh5, styles.mb3, styles.alignItemsCenter, styles.justifyContentCenter, {height: variables.searchTopBarHeight}]}> | ||
| <Animated.View style={[styles.flex1, styles.zIndex10]}> | ||
| <SearchInputSelectionWrapper |

Explanation of Change
This PR is mainly about redesigning Search Page but I also made a pretty big refactor and improved performance of Search Page mobile header animation.
These are the design changes:
These are refactor changes:
SearchPageBottomTab.tsxso that it has one render for narrow screen and one render for full screen, for better readability.SearchTypeMenuNarrow.tsxand decuple it's logic fromSearchTypeMenu.tsx, now this logic lives inSearchTypeMenuPopover.tsxwith the common parts ofSearchTypeMenuPopoverandSearchTypeMenuput intoSearchUIUtils.SearchSelectionModeHeader.tsxas it added unnecessary layer that was confusing.Fixed Issues
$ #52317
$ #55828
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Android: mWeb Chrome
iOS: Native
Screen.Recording.2025-02-18.at.16.17.38.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop