Repository navigation
[Flat Nav R5.1c] Keep Search mounted when switching between Expenses and Reports - #107108
Conversation
|
|
ad74cb8 to
43f46f9
Compare
3783762 to
4893572
Compare
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
…ses and Reports, by trading the places of the native tab items
…d Search view in the selected one, so the tab bar lens animates as before
… expiry and the 0.6 s content snapshot
…nd Reports, and keep the tab patches inert without flat nav
…bar, as its type tabs do, instead of pushing a new page
…nging the mounted page
…n iOS, date presets and tests for the mounted Search page path
4893572 to
153fb55
Compare
…tch the Search skeleton offset, share the section resolver
…e updated patch 007 from main
…so the list is not empty while it hydrates
…kup, simpler tab patches, corrected patch notes and tests
# Conflicts: # patches/react-native-screens/details.md # src/libs/Navigation/AppNavigator/Navigators/TabNavigator.native.tsx
…, and pass the safe area reach in TabSelectorContextTest
Krishna2323
left a comment
There was a problem hiding this comment.
NAB: @sumo-slonik Could you please update the description? The patch numbers changed: iOS hosted content is 014, the lens taps are 013 and the Android order is 012.
Also, patch 012 is not a no-op without the beta: the icon bitmap cache and the menu settle after a rebuild apply to every Android tab bar. And SearchResultsSwap now wraps Search on wide and narrow pages for all users, which is worth a line too.
|
@sumo-slonik On iOS, Expenses still shows the blank header and list skeleton in this flow:
Monosnap.screencast.2026-11-27.20-17-35.mp4 |
I'm on it |
I'm on it |
…rts no longer show a blank header and skeleton
|
@Krishna2323 Both should be fixed, can you retest it? |
|
@sumo-slonik On Android, after a fast More > saved search > Reports, the tab row in the header stays scrolled where the saved search was, so the selected Reports tab is off screen. It happens sometimes, not every time. Monosnap.screencast.2026-11-28.01-52-13.mp4 |
…ll event no longer leaves the selected Search tab off screen
|
@Krishna2323 Fixed, could you retest? |
|
@sumo-slonik I can still repro empty header on android: Monosnap.screencast.2026-11-30.23-54-45.mp4 |
…re after a saved search no longer shows a blank header
|
@Krishna2323 Fixed, Search now shows with its header right away. The previous search can still flash briefly before the new list, but that is outside the scope of this PR. Could you retest? |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_native.mp4Android: mWeb Chromeandroid_mWeb.mp4iOS: HybridAppios_native.mp4iOS: mWeb Safariios_mWeb.mp4MacOS: Chrome / Safariweb_chrome.mp4 |
Krishna2323
left a comment
There was a problem hiding this comment.
LGTM!
@sumo-slonik, there are some conflicts to resolve, but approving anyway.
# Conflicts: # src/libs/Navigation/AppNavigator/Navigators/TabNavigator.native.tsx # src/libs/SearchNavigationUtils.ts # src/pages/Search/SearchPageNarrow/index.tsx # src/pages/Search/SearchPageWide.tsx
mountiny
left a comment
There was a problem hiding this comment.
Thanks for the changes and testing @Krishna2323
I would really want to make sure we follow up on all the patches so we can eventually remove them, I dont want to keep this around forever
| - On Android the two tabs trade their places in the bar (the `tabBarItemOrder` prop of react-native-screens patch 012) and each draws the item of the other, so the bar highlights the named host over content that never moved. Native reports a tab by its screen key, so the `tabPress` event and the navigation go to the route whose item the tab draws. A tab trades with one tab at a time and the focused route goes first. A new `tabBarItemHiddenRouteName` option names the hidden route a press on a visible tab's item opens. While that route is drawn in another tab, native does not select the pressed tab, which would show empty until JS answers. The bar shows the pressed item selected over the hidden route in a commit of its own, and the `tabPress` event is sent in the next task, because native mounts a commit only when the task that made it ends and the render of the navigation would hold the bar back. A press that starts no navigation puts the bar back, and one whose navigation never names the pressed item expires after 2 s. | ||
| - While it is not focused, a hidden route is laid out only under an item that shows it rightly: the host it names has to be its own tab or a tab whose item opens it, and its tab has to hold the item of that host on Android or show no view of another tab on iOS. Native shows a tab as soon as its item is tapped, so the route is also laid out in its own tab while the item that tab holds opens it, whichever host it names: Search on a saved search, which names More, shows under Expenses at once when it is drawn there, and on Android also under Reports while the tab of Search holds the Reports item of a pending press. Under any other item the tab shows its own content, such as the Search skeleton of the Expenses and Reports placeholders, until JS answers the tap. | ||
| - Without a hidden route that has a host, no order, no source key and no tap interception are sent and nothing changes. | ||
| - Upstream PR/issue: not reported, because it builds on patch 003, which has no upstream counterpart. |
There was a problem hiding this comment.
@sumo-slonik Can we follow up on this? ideally we dont have patches forever
| ### [react-native-screens+4.28.0+012+tab-bar-item-order.patch](react-native-screens+4.28.0+012+tab-bar-item-order.patch) | ||
|
|
||
| - Reason: Android only. Adds a `tabBarItemOrder` prop to the tabs host: the screen keys in the order their items take in the tab bar. With the flat navigation beta, Expenses and Reports are two items over the one Search screen, and native shows the content of a tab only under its own item, so the tab that holds Search has to take the place of the item to highlight. Moving the tab in React replaces its fragment, which remounts Search. With this prop the React children keep their order, so no view is moved or recreated: the menu items are added in that order and, only when an order is given, the selected one is checked again after the menu is rebuilt. `TabsHostA11yCoordinator` paired tabs with menu items by index, so it now matches them by menu item id. A rebuilt menu has new item views: Material fades them in, React Native lays them out only on a later frame and Material sizes their active indicators later still, so once the update is done the patch ends that fade, lays the bar out and sizes the indicators itself. The rebuilt menu also selects its first item, so the place that was selected is selected again without an animation before the selected tab, and the indicator moves from there as it does on a tab switch. A tab that takes another place takes that item's icon in the same update, and a decode lands a few frames later, so the bitmaps of tab icons loaded before are kept and set right away. An empty or missing order keeps the order of the children, which is what every host gets without the beta. iOS does not use the order, see patch 014. | ||
| - Upstream PR/issue: not reported yet. |
There was a problem hiding this comment.
@MelvinBot can you create Weekly issue and assign @mountiny @sumo-slonik to report all the patches from the Flat nav prs upstream and track them being removed eventually
There was a problem hiding this comment.
Created Upstream dependency patches and track their removal, labeled Weekly and assigned to mountiny and sumo-slonik.
Includes an initial patch inventory and tracking for upstream reports, releases, and eventual patch removal.
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.57-0 🚀
|
|
No help site update needed — the navigation changes remain behind the |
Explanation of Change
Flat Nav R5.1c, behind the
flatNavbeta, iOS and Android in a narrow layout.R5.1b moves Search to another native tab on every switch between Expenses, Reports and More, which remounts it and leaves the screen empty for seconds. This PR keeps Search mounted.
PUSH_PARAMS, as its type tabs do, instead of pushing a second Search page.SearchResultsSwapnow wraps the results of Search on wide and narrow layouts for every user, with or without the beta. When the search changes, the previous results stay on screen until the new ones lay out, instead of an empty list in between.On an iOS 26.3 simulator (dev build) a switch between Expenses and Reports went from 3.8 to 5.4 s to 0.1 to 0.7 s.
Known limitations:
Fixed Issues
$ #105631
PROPOSAL: N/A
Tests
Offline tests
Go offline with the beta on, repeat steps 2 and 3, and verify Search opens from cached data.
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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