From 2a5928aa13849e87f5bc1d0a31579e91c1915a9b Mon Sep 17 00:00:00 2001 From: wSedlacek Date: Sat, 7 Nov 2026 14:48:25 -0800 Subject: [PATCH 1/4] fix(mobile): back swipe reveals the tab bar under the card The floating dock was an overlay toggled by lifecycle events, so it either flashed mid-gesture or appeared late after settle. Keep it on the root card so the interactive pop uncovers it like native navigation. Co-authored-by: Cursor --- .../createWorkspaceStackNavigator.ios.tsx | 47 +++++++++++++++++-- .../workspace/WorkspaceNativeTabs.ios.tsx | 21 +++------ .../src/native/createV5StackNavigator.ios.tsx | 5 +- 3 files changed, 52 insertions(+), 21 deletions(-) diff --git a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx index 14ffb11abf22b..4226c4eb73e6b 100644 --- a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx +++ b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx @@ -28,7 +28,7 @@ import { type ComponentProps, type ReactNode, } from "react"; -import { StyleSheet, View } from "react-native"; +import { StyleSheet, useWindowDimensions, View } from "react-native"; import { Split, type SplitHostCommands } from "react-native-screens"; import { SafeAreaView } from "react-native-safe-area-context"; import { GestureHandlerRootView } from "react-native-gesture-handler"; @@ -40,6 +40,10 @@ import { WorkspaceNativeTabs, WorkspaceSidebarTabsFooter, } from "./workspace/WorkspaceNativeTabs.ios"; +import { + useCompactWorkspaceTabs, + useFloatingWorkspaceTabs, +} from "./workspace/useSystemWorkspaceTabBar"; import { workspaceUsesColumns } from "./workspace/workspace-tabs-state"; import { isSettingsRoute, settingsOpenIn } from "../settings/settings-navigation"; import { workspaceRoutesOf } from "./workspace-overlay-routes"; @@ -497,19 +501,45 @@ function WorkspaceColumns( ); } +function CardStackDock() { + const deviceType = useDeviceType(); + const { layout } = useAdaptiveWorkspaceLayout(); + const floatingTabs = useFloatingWorkspaceTabs(); + const { width } = useWindowDimensions(); + return ( + + + + ); +} + function WorkspaceStackView(props: ViewProps & { readonly nativeColumns: boolean }) { const { layout } = useAdaptiveWorkspaceLayout(); const deviceType = useDeviceType(); const workspace = useWorkspaceTabs()!; - // Native dismiss commits the route pop after the transition. Restore the dock + const compactTabs = useCompactWorkspaceTabs(); + // Native dismiss commits the route pop after the transition. Restore the system tab bar // when the primary screen starts appearing, including interactive back gestures. const [primaryVisible, setPrimaryVisible] = useState(false); const metrics = useNativeLayoutMetrics(); const projection = projectWorkspaceStack(props.state, (route) => { return isPresentedRoute(props.descriptors[route.key]?.options); }); - // The root's willDisappear reaches JS frames into the push, so hide the dock in the commit that - // pushes; the native events still own every later change, including back gestures. + // The root's willDisappear reaches JS frames into the push, so hide the system tab bar in the + // commit that pushes; the native events still own every later change, including back gestures. const topDetailKey = projection.detail.at(-1)?.key; const [pushedDetailKey, setPushedDetailKey] = useState(topDetailKey); if (pushedDetailKey !== topDetailKey) { @@ -524,6 +554,12 @@ function WorkspaceStackView(props: ViewProps & { readonly nativeColumns: boolean const baseRoute = { key: `${props.state.key}:workspace`, name: "Workspace" }; const visibleRoute = projection.detail.at(-1) ?? primaryRoute; const workspacePage = !workspaceUsesColumns(workspace.state.selectedTab, workspace.settingsOpen); + const tabsInSidebarColumn = props.nativeColumns && !workspacePage && deviceType === "pad"; + // Keep the floating dock on the root card so a back swipe reveals it under the leaving screen + // instead of mounting an overlay mid-gesture or after the transition settles. + const cardStackDock = + !tabsInSidebarColumn && + (deviceType === "pad" || compactTabs || (layout.variant === "medium" && !workspacePage)); const baseDescriptor: Descriptor = { ...primaryDescriptor, navigation: props.descriptors[visibleRoute.key]!.navigation, @@ -532,7 +568,7 @@ function WorkspaceStackView(props: ViewProps & { readonly nativeColumns: boolean options: { headerShown: false }, render: () => (