Perf: Defer Search/Reports list mount via NavigationDeferredMount#91848
Conversation
Introduce SearchWithNavigationDeferredMount that wraps Search in NavigationDeferredMount with a SearchRowSkeleton placeholder. The placeholder ends the ManualNavigateToReports span with is_warm=true at first layout, so warm first mount measures to skeleton visible while the heavy list hydrates after the navigation transition completes. Refocus through react-freeze still ends the span via Search's existing useFocusEffect, so cached navigations keep measuring to list visible without showing a skeleton. Used by SearchPageWide and SearchPageNarrow (non-static branch) in place of the previous inline render so the spread-props wrapper handles narrow vs wide container styling internally via useResponsiveLayout.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@marufsharifi 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] |
|
@mananjadhav @luacmartins One of you needs to 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] |
|
Unassigning @mananjadhav since melvin double assigned C+. @marufsharifi can you please prioritize this review? |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.1405-03-07.at.5.08.09.PM.mp4Android: mWeb ChromeScreen.Recording.1405-03-07.at.4.22.35.PM.mp4iOS: HybridAppiOS: mWeb SafariScreen.Recording.1405-03-07.at.4.54.33.PM.movMacOS: Chrome / SafariScreen.Recording.1405-03-07.at.3.13.59.PM.mov |
JakubKorytko
left a comment
There was a problem hiding this comment.
Two points, overall lookin good.
| placeholder={ | ||
| <SearchRowSkeleton | ||
| shouldAnimate | ||
| onLayout={() => endSpanWithAttributes(CONST.TELEMETRY.SPAN_NAVIGATE_TO_REPORTS, {[CONST.TELEMETRY.ATTRIBUTE_IS_WARM]: true})} |
There was a problem hiding this comment.
- Would this not end the span prematurely, without the need for focus, when pre-inserted under RHP without need for the screen to be visible? It may already not require already focus, but it's worth checking.
- Should we not also end ManualSubmitToDestinationVisible in this component? The destination (the search page) is undoubtedly visible, so I think the answer is yes.
There was a problem hiding this comment.
Would this not end the span prematurely, without the need for focus, when pre-inserted under RHP without need for the screen to be visible? It may already not require already focus, but it's worth checking.
SPAN_NAVIGATE_TO_REPORTS only starts on tab press in SearchTabButton, so it will not be measured while RHP is open, since you cannot click the button in the navigation menu at that time.
There was a problem hiding this comment.
Should we not also end ManualSubmitToDestinationVisible in this component? The destination (the search page) is undoubtedly visible, so I think the answer is yes.
I added this in the commit: b1afdea
|
I’ve tried several times, but I’m currently unable to run the Hybrid app on iOS native. I’ve tested it on all other platforms, and everything is working perfectly there. I’ll re-test the iOS native setup tomorrow and share an update. Screen.Recording.1405-03-07.at.11.15.48.PM.mov |
|
🚧 @luacmartins 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/luacmartins in version: 9.3.89-1 🚀
Bundle Size Analysis (Sentry): |
Help site reviewNo help site changes are required for this PR. This change is a purely internal performance optimization — it wraps the Search/Reports list in
The skeleton/loading state is an implementation detail of how the page renders and isn't documented in any current help articles under @dariusz-biela, please confirm — if you believe this still warrants a docs update, let me know what behavior should be documented and I'll open a draft PR. |
Explanation of Change
Warm start of the Reports/Search page (first render in a session, data already cached) takes ~550ms (Mac M4 Pro) because we wait for the full list to render before showing anything to the user. This PR applies
NavigationDeferredMountto that path so the warm start behaves like a cold start visually:SearchPage, aSearchRowSkeletonplaceholder paints immediately and endsManualNavigateToReportswithis_warm: true.Searchsubtree mounts insidestartTransitionafter the navigation transition completes, so the list does not compete with the navigation animation frame budget.Search, do not show the skeleton, and end the span via the existinguseFocusEffect— that path still measures to list visible.Implementation:
src/components/Search/SearchWithNavigationDeferredMount.tsx. AcceptsComponentProps<typeof Search>, picks the placeholder container style fromuseResponsiveLayout()+props.hasFilterBars, and spreads props toSearch.SearchPageWideandSearchPageNarrow(non-static branch) renderSearchWithNavigationDeferredMountinstead ofSearchdirectly. The static-rendering branch inSearchPageNarrow(post-submit overlay path) is left untouched.Results:
Warm full - this is the time it takes for the first warm render to display the full list, rather than just the skeleton.
Fixed Issues
$ #91731
PROPOSAL:
Tests
Offline tests
Same as Tests.
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
Screen.Recording.2026-05-27.at.16.46.29.mp4
iOS: Native
Screen.Recording.2026-05-27.at.16.42.14.mp4
MacOS: Chrome / Safari
Screen.Recording.2026-05-27.at.16.36.52.mp4