[CP Staging] Update default sort order for search display sorting#88140
[CP Staging] Update default sort order for search display sorting#88140
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4c9f12059
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| value={sortOrder} | ||
| closeOverlay={closeOverlay} | ||
| defaultValue={sortOrderOptions.at(0)?.value} | ||
| defaultValue={CONST.SEARCH.SORT_ORDER.DESC} |
There was a problem hiding this comment.
Derive reset sort order from query defaults
Using a hardcoded desc here makes Reset incorrect for searches whose default sort order is ascending (for example grouped searches like groupBy:category, from, card, or tag, which are defined as asc in src/libs/SearchParser/searchParser.peggy). In those contexts, pressing Reset in the sort-order popup now applies a non-default order and changes result ordering unexpectedly, so the reset value should be computed from the current query’s default rather than forced to descending.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This changes the production behavior. Did we land on desc order as default value for all popups throughout the app?
There was a problem hiding this comment.
Thanks for handling all the PR. I was planning to fix all 3 in 1 PR, but I guess that's too late.
I raised my concern about the default value here too.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Explanation of Change
When 'Reset'ting the sort order, it should be set to
Descendingas the defaultFixed Issues
$ #88052
Tests
Open the reports page on a new account
Open Display > Sort Order > Set it to Ascending
Save the changes
Open Display > Sort Order > Click Reset
The sort order should be set to Descending (The default)
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Screen.Recording.2026-04-16.at.1.21.03.PM.mov