-
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
Add search input to mobile search page(with fixed performance) #56326
base: main
Are you sure you want to change the base?
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 |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
@@ -76,6 +76,7 @@ function BaseTextInput( | |||
contentWidth, | |||
loadingSpinnerStyle, | |||
uncontrolled = false, | |||
placeholderTextColor, |
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.
another prop 😭 😭 😭
src/libs/CardUtils.ts
Outdated
@@ -98,7 +98,7 @@ function isCardHiddenFromSearch(card: Card) { | |||
return !card?.nameValuePairs?.isVirtual && CONST.EXPENSIFY_CARD.HIDDEN_FROM_SEARCH_STATES.includes(card.state ?? 0); | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeMenuItems.push({ | |
typeMenuItems.push({ |
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.
add ENTER
return; | ||
} | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// eslint-disable-next-line react-hooks/exhaustive-deps | |
// eslint-disable-next-line react-compiler/react-compiler react-hooks/exhaustive-deps |
1 line less ;)
@@ -63,12 +61,12 @@ function TopBar({breadcrumbLabel, activeWorkspaceID, shouldDisplaySearch = true, | |||
</View> | |||
</View> | |||
{displaySignIn && <SignInButton />} | |||
{shouldDisplayCancelSearch && ( | |||
{shouldDisplayCancel && ( |
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.
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 |
😕 I'm kinda with you, it really doesn't feel great. |
What's our easing on this animation? I wonder if it's jank or just animation timing weirdness? |
🚀 LGTM - Completed PR Reviewer Checklist ✅ Beside the tests mentioned in OP, I tested the following issues from last (reverted) PR:
@luacmartins Let me know whether the above issue should be addressed and depending on your response I'll 🟢 Approve right away or await the fix and retest then Approve. |
I've used other approach to our TextInput animation, right now we let the animation go first and after it's complete we change the state, that should make it smoother. Can you guys check it out @shawnborton @dubielzyk-expensify @dannymcclain? |
I will run another test build for us. |
🚧 @shawnborton has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
Hmm no iOS... maybe we need to merge main? |
Merged main, can you try running build again? @shawnborton |
🚧 @dannymcclain has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
I think something is broken with adhoc build workflow, because all of adhoc builds are failing since Friday. I've written about this on open-source. |
Sounds good, keep us posted when you think we can run another test build so we can see how mobile feels. |
@SzymczakJ we're running into some failing tests, e.g.
Let's fix those too. I'll look into the failing iOS build |
Hmm the build is succeeding locally. I'll try to delete caches and run it again. |
🚧 @luacmartins has triggered a test build. You can view the workflow run here. |
That didn't work. Asked here since that PR is sus |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
I think the adhoc builds are working now, can you try to build and retest it? The mobile animation should be ready to test, I've just noticed a small bug on mWeb and I'm working on it. |
Started a new build |
🚧 @luacmartins has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
@SzymczakJ can you merge main? Maybe we need some changes from main to get adhoc builds working again |
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.tsx
so that it has one render for narrow screen and one render for full screen, for better readability.SearchTypeMenuNarrow.tsx
and decuple it's logic fromSearchTypeMenu.tsx
, now this logic lives inSearchTypeMenuPopover.tsx
with the common parts ofSearchTypeMenuPopover
andSearchTypeMenu
put intoSearchUIUtils
.SearchSelectionModeHeader.tsx
as 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 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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop