-
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
[Search v1] Add sorting #42248
[Search v1] Add sorting #42248
Conversation
b07ba13
to
0dea1c3
Compare
8c435c6
to
fe5cd89
Compare
fe5cd89
to
62dc109
Compare
@luacmartins This is my first approach to this: https://github.com/Expensify/App/pull/42248/files#diff-4e6d1f540181229a6bc7bd2f96266c9b76bc05cf86150ea1e225c657d358aafbR54 However there are 2 problems with this approach:
Examples:
Currently I see no other reasonable solution than a chain of Do you see any other solution and what way do you want me to move forward? Feel free to check the draft PR - everything else should be working |
@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] |
8750a91
to
6e379da
Compare
@shawnborton in here is the fix for #42269 I added this to "test steps" for the reviewer. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
I don't have any more visual bugs to report (cc @Expensify/design in case you run into anything though), but one thing I did notice was that it doesn't feel like the sorting behavior is actually correct. For instance, if I sort by amount - descending, it seems to be okay but then as I scroll down the list, I see some larger amounts start to appear and it feels like the sorting almost starts over again. Any ideas what's going on there? |
Agree!
I actually think you should be able to sort by action and type. For example, I might want to sort by action so that all the expenses with a "Pay" button show in a group. Same with type. I don't see why we wouldn't let you sort by those two.
Same here. I'm noticing this with most of the sortable fields, not just Total. |
Yeah actually that's a totally valid point, I agree with you! |
6f5946b
to
2fd1c57
Compare
@luacmartins @c3024 The biggest changes are:
@luacmartins for now the
Please review :) |
Thanks @Kicu! Not sure if we wanna sort by receipts or not, but we can definitely go ahead without sorting that for now. As for reports, we landed on no sorting for now, so all good there. |
LGTM this is still a thing that we should address in a follow up |
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
@c3024 can you review again please? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariaddSort.mp4MacOS: DesktopaddSortDesktop.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!
There are cases of |
✋ 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: 1.4.77-11 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.4.77-11 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.78-5 🚀
|
{ | ||
columnName: CONST.SEARCH_TABLE_COLUMNS.MERCHANT, | ||
translationKey: 'common.merchant', | ||
shouldShow: (data: OnyxTypes.SearchResults['data']) => SearchUtils.getShouldShowMerchant(data), |
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 might have caused this issue #43205 fixed here https://github.com/Expensify/App/pull/43206/files
[CONST.SEARCH_TABLE_COLUMNS.CATEGORY]: 'category' as const, | ||
[CONST.SEARCH_TABLE_COLUMNS.TYPE]: 'type' as const, | ||
[CONST.SEARCH_TABLE_COLUMNS.ACTION]: 'action' as const, | ||
[CONST.SEARCH_TABLE_COLUMNS.DESCRIPTION]: null, |
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.
The description can be used as sort column (#44431)
Details
formatted**
fields are so that we are guaranteed that the values we sort by are the same as values that are actually displayed for the user, so I compute them in thegetSections
function; date needs a bit of special handling because we need different date representation for sorting and different for displayFixed Issues
$ #39892
$ #42269
PROPOSAL:
Tests
Settings > Troubleshoot > New Search Page
(NOTE: right now search works only on staging api) or go to[...]/search/all
URLOffline tests
QA Steps
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
rec-web-sorting-v2.mp4
MacOS: Desktop