Skip to content

Commit a956c6f

Browse files
t3dotggclaude
andcommitted
fix(android): opening a thread on a foldable no longer slides in
In the split view, Thread and PullRequest replace the detail pane next to the sidebar. They are not a layer on top of Home, so the default push slide made no sense. Turn the animation off for them while split view is on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 16918b5 commit a956c6f

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎apps/mobile/src/Stack.tsx‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
import { useResolveClassNames } from "uniwind";
3131

3232
import { AppText as Text } from "./components/ui/AppText";
33+
import { androidWorkspaceDestinationAnimation } from "./lib/android-workspace-navigation";
3334
import { getCompactBrandHeaderOptions } from "./components/CompactBrandTitle";
3435
import { WorkspaceRootScreen } from "./features/workspace/WorkspaceRootScreen";
3536
import { AndroidWorkspaceTabsProvider } from "./features/workspace/AndroidWorkspaceTabsProvider";
@@ -1007,15 +1008,17 @@ function ScreenRenderFallback(props: RenderFailureProps & { readonly routeName:
10071008
export const RootStack = RootStackConfig.with(function AdaptiveRootStack({ Navigator }) {
10081009
const { width, height } = useWindowDimensions();
10091010
const nativeMetrics = useNativeLayoutMetrics();
1010-
const usesWorkspaceFlowScreens =
1011-
Platform.OS === "android" || deriveLayout({ width, height, nativeMetrics }).usesSplitView;
1011+
const usesSplitView = deriveLayout({ width, height, nativeMetrics }).usesSplitView;
1012+
const usesWorkspaceFlowScreens = Platform.OS === "android" || usesSplitView;
10121013

10131014
return (
10141015
<Navigator
10151016
screenLayout={GuardedScreenLayout}
10161017
screenOptions={({ route }) => {
10171018
if (route.name !== "SettingsSheet" && route.name !== "NewTaskSheet") {
1018-
return {};
1019+
return Platform.OS === "android"
1020+
? { animation: androidWorkspaceDestinationAnimation(route.name, usesSplitView) }
1021+
: {};
10191022
}
10201023

10211024
return usesWorkspaceFlowScreens

‎apps/mobile/src/lib/android-workspace-navigation.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@ export function androidWorkspaceNavigationState(
3131
],
3232
};
3333
}
34+
35+
// In the split view these destinations swap the detail pane beside the sidebar instead of
36+
// stacking over Home, so the default slide-in would show a layer that is not there.
37+
export function androidWorkspaceDestinationAnimation(routeName: string, usesSplitView: boolean) {
38+
return usesSplitView && (routeName === "Thread" || routeName === "PullRequest")
39+
? ("none" as const)
40+
: undefined;
41+
}

0 commit comments

Comments
 (0)