Repository navigation
Replace getValidReports by enrichReports and introduce optionsOrderAnddGroupBy - #73416
Conversation
|
@linhvovan29546 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-10-25.at.18.09.56.movAndroid: mWeb ChromeScreen.Recording.2025-10-25.at.18.13.23.moviOS: HybridAppScreen.Recording.2025-10-25.at.17.49.54.moviOS: mWeb SafariScreen.Recording.2025-10-25.at.17.56.55.movMacOS: Chrome / SafariScreen.Recording.2025-10-25.at.17.43.54.movMacOS: DesktopScreen.Recording.2025-10-25.at.18.00.31.mov |
There was a problem hiding this comment.
I tried applying the change in PR #71450 and it worked well.
@AndrewGable This PR fixes the bug related to maxRecentReportElements that I found here: #71450 (comment). We should merge this first to unblock PR #71450
| } | ||
|
|
||
| function getValidReports(reports: OptionList['reports'], config: GetValidReportsConfig): GetValidReportsReturnTypeCombined { | ||
| function enrichOptions(options: Array<SearchOption<Report>>, config: GetValidReportsConfig): Array<SearchOption<Report>> { |
There was a problem hiding this comment.
Can you add a comment to this function explaining what it is doing and why? enrichOptions is a bit of a generic name, so a comment will help anyone reading this code.
There was a problem hiding this comment.
@pecanoro Sorry for the late response.
I've pushed an updated function name prepareReportOptionsForDisplay and comment on why this is computed.
Codecov Report❌ Patch coverage is
... and 1538 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
🚀 Deployed to staging by https://github.com/pecanoro in version: 9.2.42-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.2.42-11 🚀
|
Explanation of Change
This PR resolves problem of
maxRecentReportElementsinfluencing count of returned workspaces.Only
recentReportare trimmed to the length ofmaxRecentReportElementsIntroduce new method
optionsOrderAndGroupBywhich behaves the same asoptionsOrderBybut has additional parameterseparatorswhich split input options into separate buckets (eg. worskpaces, self dms, recent reports).Replace
getValidReportsbyenrichReports.getValidReportshad multiple concerns such as split reports into categories (concern moeved tooptionsOrderAndGroupByand enrich options by additional info (moved toenrichReports).enrichReportsis simpler.Fixed Issues
$ #71062
PROPOSAL:
https://expensify.slack.com/archives/C01GTK53T8Q/p1761011522350099
Tests
Toto select target report for expensTo validate
Offline tests
N/D
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
See 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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop