-
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
Minimal server search / enable improved focus mode #27819
Conversation
@roryabraham @aldo-expensify taking this out of draft to start some reviews... Still waiting on:
It's been testing well for me locally more or less. One thing that was missed is that when we switch the priority mode from "#focus" to "Most recent" we need to return all the chats so that view can be populated. This situation is possible:
The obvious solution seems to be to just get and send all the chats via Pusher when the priority mode changes, but I am not actually sure if it would be a problem to send these large payloads via Pusher... will think more about it. I think it's not much of a blocker to do some testing on an Ad Hoc build. But maybe we want to hold merging this until there's a solution for that. My plan after the review is done is to do an Ad Hoc build - but not merge this PR until:
|
@hoangzinh 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] |
as we go, I will also add some more manual test steps for checking to see that the correct focus mode chats will come back when signing in. |
Looks like https://github.com/Expensify/Web-Expensify/pull/38916 is now on staging 🎉 . Does that mean this PR is now off hold? |
@marcaaron no need to keep holding on https://github.com/Expensify/Web-Expensify/pull/38916, right? since it hit staging already |
🎯 @hoangzinh, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #29046. |
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.
Code looks good, but we're missing a few new proptypes, no?
@Beamanator thanks for the review ❤️ ! Made the changes 🙇 |
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.
Looks great and is working well here! But there's conflicts :'(
And I wonder if @roryabraham wants to review before I merge? Aldo is OOO i beleive
I think they are both OOO |
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.
Not officially requesting changes because I don't want to delay this while I'm OOO, but I had a few comments that maybe should be addressed. Don't think anything will blow up if they're not addressed
/** | ||
* @param {string} searchInput | ||
*/ | ||
function searchInServer(searchInput) { |
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
function searchInServer(searchInput) { | |
function searchForReportsInServer(searchInput) { |
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.
it's already Report.searchInServer()
so you would have Report.searchForReportInServer()
🤷
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.
true that reads a bit funky
src/pages/SearchPage.js
Outdated
initWithStoredValues: false, | ||
}, | ||
network: { | ||
key: ONYXKEYS.NETWORK, |
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 think we should use the withNetwork
HOC instead of withOnyx
. Also ONYXKEYS.NETWORK
should typically be initWithStoredValues: false
, because we don't have any reason to think that the persisted value for isOffline
should be accurate the next time the user opens the app.
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.
Updating to withNetwork since it will reduce a subscription.
But there are so many places where we do not consider this...
we don't have any reason to think that the persisted value for isOffline should be accurate the next time the user opens the app
nothing super bad happens AFAICT
Co-authored-by: Rory Abraham <[email protected]>
…y/App into marcaaron-minimalSearch
Updated! |
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!
✋ 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/Beamanator in version: 1.3.84-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.84-10 🚀
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 1.3.85-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.85-4 🚀
|
Details
Adds server assisted searching to the "Search" page.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/318005
$ https://github.com/Expensify/Expensify/issues/318006
Tests
The tests here are primarily designed to prove that we can return reports that hit on the following search queries from Auth...
SearchForReports
command returns the Concierge reportSearchForReports
firstName
field of the personal details to "Bob"Test that switching from "#focus" to "Most recent" will restore chats
Offline tests
QA Steps
(probably Internal so that we can help verify)
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android