From d70803c2ae8fd5789d1c33a560634f9420781af4 Mon Sep 17 00:00:00 2001 From: sumo_slonik Date: Wed, 22 Oct 2025 12:59:04 +0200 Subject: [PATCH 1/6] add home to preload --- src/components/Navigation/NavigationTabBar/index.tsx | 2 +- .../Navigation/AppNavigator/usePreloadFullScreenNavigators.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Navigation/NavigationTabBar/index.tsx b/src/components/Navigation/NavigationTabBar/index.tsx index cc7d66003514..8b9ae4749bcc 100644 --- a/src/components/Navigation/NavigationTabBar/index.tsx +++ b/src/components/Navigation/NavigationTabBar/index.tsx @@ -1,4 +1,4 @@ -import {findFocusedRoute, StackActions, useNavigationState} from '@react-navigation/native'; +import {CommonActions, findFocusedRoute, StackActions, useNavigationState} from '@react-navigation/native'; import reportsSelector from '@selectors/Attributes'; import React, {memo, useCallback, useEffect, useState} from 'react'; import {View} from 'react-native'; diff --git a/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts b/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts index 068430672414..2fc6be6ee656 100644 --- a/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts +++ b/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts @@ -25,7 +25,7 @@ import {getPreservedNavigatorState} from './createSplitNavigator/usePreserveNavi const TIMING_TO_CALL_PRELOAD = 1000; // Currently, only the Account and Workspaces tabs are preloaded. The remaining tabs will be supported soon. -const TABS_TO_PRELOAD = [NAVIGATION_TABS.SETTINGS, NAVIGATION_TABS.WORKSPACES]; +const TABS_TO_PRELOAD = [NAVIGATION_TABS.SETTINGS, NAVIGATION_TABS.WORKSPACES, NAVIGATION_TABS.HOME]; function preloadWorkspacesTab(navigation: PlatformStackNavigationProp) { const state = getWorkspacesTabStateFromSessionStorage() ?? navigation.getState(); From 4b365948d8568b45378e51ce562809bf2b3b86c3 Mon Sep 17 00:00:00 2001 From: sumo_slonik Date: Wed, 22 Oct 2025 15:15:03 +0200 Subject: [PATCH 2/6] add home to preload --- src/components/Navigation/NavigationTabBar/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Navigation/NavigationTabBar/index.tsx b/src/components/Navigation/NavigationTabBar/index.tsx index 8b9ae4749bcc..9e68d33a2253 100644 --- a/src/components/Navigation/NavigationTabBar/index.tsx +++ b/src/components/Navigation/NavigationTabBar/index.tsx @@ -5,7 +5,6 @@ import {View} from 'react-native'; import type {ValueOf} from 'type-fest'; import HeaderGap from '@components/HeaderGap'; import Icon from '@components/Icon'; -// import * as Expensicons from '@components/Icon/Expensicons'; import ImageSVG from '@components/ImageSVG'; import DebugTabView from '@components/Navigation/DebugTabView'; import {PressableWithFeedback} from '@components/Pressable'; @@ -122,8 +121,13 @@ function NavigationTabBar({selectedTab, isTopLevelBar = false}: NavigationTabBar return; } + if (!shouldUseNarrowLayout && isRoutePreloaded(NAVIGATORS.REPORTS_SPLIT_NAVIGATOR)) { + navigationRef.dispatch(CommonActions.navigate(NAVIGATORS.REPORTS_SPLIT_NAVIGATOR)); + return; + } + Navigation.navigate(ROUTES.HOME); - }, [selectedTab]); + }, [selectedTab, shouldUseNarrowLayout]); const navigateToSearch = useCallback(() => { if (selectedTab === NAVIGATION_TABS.SEARCH) { From bf2be2b5fc1127f68ee8a254bbafa64c945a812d Mon Sep 17 00:00:00 2001 From: sumo_slonik Date: Thu, 23 Oct 2025 14:55:35 +0200 Subject: [PATCH 3/6] change navigate to push --- src/components/Navigation/NavigationTabBar/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Navigation/NavigationTabBar/index.tsx b/src/components/Navigation/NavigationTabBar/index.tsx index 9e68d33a2253..2ac444cde36d 100644 --- a/src/components/Navigation/NavigationTabBar/index.tsx +++ b/src/components/Navigation/NavigationTabBar/index.tsx @@ -122,7 +122,7 @@ function NavigationTabBar({selectedTab, isTopLevelBar = false}: NavigationTabBar } if (!shouldUseNarrowLayout && isRoutePreloaded(NAVIGATORS.REPORTS_SPLIT_NAVIGATOR)) { - navigationRef.dispatch(CommonActions.navigate(NAVIGATORS.REPORTS_SPLIT_NAVIGATOR)); + navigationRef.dispatch(StackActions.push(NAVIGATORS.REPORTS_SPLIT_NAVIGATOR)); return; } From abd98fb4553001f02a2cbac3397fa69ac98eb915 Mon Sep 17 00:00:00 2001 From: sumo_slonik Date: Thu, 23 Oct 2025 16:05:54 +0200 Subject: [PATCH 4/6] change navigate to push --- src/components/Navigation/NavigationTabBar/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Navigation/NavigationTabBar/index.tsx b/src/components/Navigation/NavigationTabBar/index.tsx index 2ac444cde36d..5160f331991e 100644 --- a/src/components/Navigation/NavigationTabBar/index.tsx +++ b/src/components/Navigation/NavigationTabBar/index.tsx @@ -1,4 +1,4 @@ -import {CommonActions, findFocusedRoute, StackActions, useNavigationState} from '@react-navigation/native'; +import {findFocusedRoute, StackActions, useNavigationState} from '@react-navigation/native'; import reportsSelector from '@selectors/Attributes'; import React, {memo, useCallback, useEffect, useState} from 'react'; import {View} from 'react-native'; From 5c71d1cceb3c95124ccb53f7f53dd99a5af498ae Mon Sep 17 00:00:00 2001 From: sumo_slonik Date: Fri, 24 Oct 2025 12:18:39 +0200 Subject: [PATCH 5/6] fix comment --- .../Navigation/AppNavigator/usePreloadFullScreenNavigators.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts b/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts index 2fc6be6ee656..e809b1948946 100644 --- a/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts +++ b/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts @@ -24,7 +24,7 @@ import {getPreservedNavigatorState} from './createSplitNavigator/usePreserveNavi // This timing is used to call the preload function after a tab change, when the initial tab screen has already been rendered. const TIMING_TO_CALL_PRELOAD = 1000; -// Currently, only the Account and Workspaces tabs are preloaded. The remaining tabs will be supported soon. +// Currently, only the Account, Inbox and Workspaces tabs are preloaded. The remaining tabs will be supported soon. const TABS_TO_PRELOAD = [NAVIGATION_TABS.SETTINGS, NAVIGATION_TABS.WORKSPACES, NAVIGATION_TABS.HOME]; function preloadWorkspacesTab(navigation: PlatformStackNavigationProp) { From 55a7284cec529b40ae41adf90bf2b5526298c45d Mon Sep 17 00:00:00 2001 From: sumo_slonik Date: Thu, 30 Oct 2025 09:46:09 +0100 Subject: [PATCH 6/6] change preload order tab --- .../Navigation/AppNavigator/usePreloadFullScreenNavigators.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts b/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts index 4db2ca4d4ee9..c7581905db80 100644 --- a/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts +++ b/src/libs/Navigation/AppNavigator/usePreloadFullScreenNavigators.ts @@ -24,8 +24,8 @@ import {getPreservedNavigatorState} from './createSplitNavigator/usePreserveNavi // This timing is used to call the preload function after a tab change, when the initial tab screen has already been rendered. const TIMING_TO_CALL_PRELOAD = 1000; -// Currently, only the Account, Inbox and Workspaces tabs are preloaded. The remaining tabs will be supported soon. -const TABS_TO_PRELOAD = [NAVIGATION_TABS.SETTINGS, NAVIGATION_TABS.WORKSPACES, NAVIGATION_TABS.HOME]; +// Currently, only the Inbox, Workspaces, Account tabs are preloaded. The remaining tabs will be supported soon. +const TABS_TO_PRELOAD = [NAVIGATION_TABS.HOME, NAVIGATION_TABS.WORKSPACES, NAVIGATION_TABS.SETTINGS]; function preloadWorkspacesTab(navigation: PlatformStackNavigationProp) { const state = getWorkspacesTabStateFromSessionStorage() ?? navigation.getState();