Avoid mounting MoneyRequestReportNavigation when unnecessary#88714
Conversation
|
@thesahindia 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
|
@MelvinBot review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
NAB: Could we add a unit test covering the three gate branches?
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-04-24.at.17.15.35.movAndroid: mWeb ChromeScreen.Recording.2026-04-24.at.17.20.28.moviOS: HybridAppScreen.Recording.2026-04-24.at.17.13.45.moviOS: mWeb SafariScreen.Recording.2026-04-24.at.17.20.28.movMacOS: Chrome / SafariScreen.Recording.2026-04-24.at.16.51.46.movScreen.Recording.2026-04-24.at.16.47.47.mov |
mountiny
left a comment
There was a problem hiding this comment.
Lets add the NABs in a follow up
| hasMultiple: boolean; | ||
| includesReport: boolean; |
There was a problem hiding this comment.
there should be docs here
| reportID?: string; | ||
| shouldDisplayNarrowVersion: boolean; | ||
| }; |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/mountiny in version: 9.3.62-5 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required. This PR is a pure performance optimization — it adds a lightweight wrapper around |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.64-0 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
MoneyRequestReportNavigationpreviously always mounted and subscribed to Onyx data (viauseSearchSections) regardless of whether navigation arrows would ever be shown. This adds an outer wrapper component that reads two lightweight Onyx selectors — whether the current search is an expense-report search, and whether the snapshot contains the current report — and skips mounting the inner component entirely when the navigation arrows cannot possibly be displayed. This eliminates unnecessary re-renders on every report view that isn't part of an expense-report search.Results on iOS, heavy account:
Cold open: 1393ms -> 1186ms (14.9% improvement)
Warm open: 631ms -> 471ms (25% improvement)
Fixed Issues
$ #88717
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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