@devries-cameron20 / t3code Mirror · read-only / commits / a1f81a44e5
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 15:30 UTC

fix(android): Match thread fallback layouts to the loaded pane (#14669)

Alex committed Oct 11, 2026 at 11:30 UTC a1f81a44e5ba18f099a7c43b310ddb7f7fa7fb37
2 files changed +71 -21
apps/mobile/src/components/LoadingScreen.tsx
+6 -1
@@ -7,6 +7,8 @@ import { BrandMark } from "./BrandMark";
7
8 export function LoadingScreen(props: {
9 readonly message: string;
10 + /** Let the enclosing pane supply the background and top inset. */
11 + readonly embedded?: boolean;
12 readonly messagePlacement?: "above-spinner" | "below-spinner";
13 }) {
14 const { themeAppearance: colorScheme } = useAppearancePreferences();
@@ -14,7 +16,10 @@ export function LoadingScreen(props: {
16 const messagePlacement = props.messagePlacement ?? "below-spinner";
17
18 return (
17 - <View className="flex-1 bg-screen" style={{ paddingTop: insets.top }}>
19 + <View
20 + className={props.embedded ? "flex-1" : "flex-1 bg-screen"}
21 + style={{ paddingTop: props.embedded ? 0 : insets.top }}
22 + >
23 <StatusBar barStyle={colorScheme === "dark" ? "light-content" : "dark-content"} />
24 <View className="flex-1 items-center justify-center gap-5 px-6">
25 <BrandMark compact />
apps/mobile/src/features/threads/ThreadRouteScreen.tsx
+65 -20
@@ -2,6 +2,7 @@ import { makeTurnCommandMetadata } from "../../lib/commandMetadata";
2 import { buildProjectThreadStartTurnInput } from "../../lib/projectThreadStartTurn";
3 import { useWorktreeSetup } from "./use-worktree-setup";
4 import { worktreeSetupAgentStarted } from "@t3tools/client-runtime/worktree-setup";
5 +import { ScreenHeader } from "../../components/ScreenHeader";
6 import {
7 StackActions,
8 useFocusEffect,
@@ -103,8 +104,50 @@ function firstRouteParam(value: string | string[] | undefined): string | null {
104 return first === undefined || first.trim().length === 0 ? null : first;
105 }
106
107 +function ThreadPane(props: { readonly children: ReactNode }) {
108 + return (
109 + <View className="flex-1 bg-screen android:overflow-hidden android:rounded-t-[28px] android:bg-thread-canvas">
110 + {props.children}
111 + </View>
112 + );
113 +}
114 +
115 +function ThreadRouteFallbackLayout(props: { readonly children: ReactNode }) {
116 + const navigation = useNavigation();
117 + const { layout } = useAdaptiveWorkspaceLayout();
118 + const { themeVariables } = useAppearancePreferences();
119 + if (Platform.OS !== "android") return props.children;
120 +
121 + return (
122 + <>
123 + <ScreenHeader
124 + title="Thread"
125 + options={{ contentStyle: { backgroundColor: themeVariables["--color-header"] } }}
126 + onBack={
127 + layout.usesSplitView
128 + ? undefined
129 + : () => {
130 + if (navigation.canGoBack()) navigation.goBack();
131 + else navigation.dispatch(StackActions.replace("Home"));
132 + }
133 + }
134 + hideBottomBorder
135 + />
136 + <ThreadPane>{props.children}</ThreadPane>
137 + </>
138 + );
139 +}
140 +
141 function OpeningThreadLoadingScreen() {
107 - return <LoadingScreen message="Opening thread…" messagePlacement="above-spinner" />;
142 + return (
143 + <ThreadRouteFallbackLayout>
144 + <LoadingScreen
145 + message="Opening thread…"
146 + messagePlacement="above-spinner"
147 + embedded={Platform.OS === "android"}
148 + />
149 + </ThreadRouteFallbackLayout>
150 + );
151 }
152
153 type ThreadRouteScreenRouteProps = StaticScreenProps<{
@@ -123,23 +166,25 @@ function ThreadUnavailableScreen(props: {
166 readonly onAction: () => void;
167 }) {
168 return (
126 - <ScrollView
127 - contentInsetAdjustmentBehavior="automatic"
128 - contentContainerStyle={{
129 - flexGrow: 1,
130 - justifyContent: "center",
131 - paddingHorizontal: 24,
132 - paddingVertical: 32,
133 - }}
134 - className="bg-screen flex-1"
135 - >
136 - <EmptyState
137 - title="Thread unavailable"
138 - detail="This thread is not available in the current mobile snapshot."
139 - actionLabel={props.actionLabel}
140 - onAction={props.onAction}
141 - />
142 - </ScrollView>
169 + <ThreadRouteFallbackLayout>
170 + <ScrollView
171 + contentInsetAdjustmentBehavior="automatic"
172 + contentContainerStyle={{
173 + flexGrow: 1,
174 + justifyContent: "center",
175 + paddingHorizontal: 24,
176 + paddingVertical: 32,
177 + }}
178 + className="bg-screen flex-1 android:bg-transparent"
179 + >
180 + <EmptyState
181 + title="Thread unavailable"
182 + detail="This thread is not available in the current mobile snapshot."
183 + actionLabel={props.actionLabel}
184 + onAction={props.onAction}
185 + />
186 + </ScrollView>
187 + </ThreadRouteFallbackLayout>
188 );
189 }
190
@@ -931,7 +976,7 @@ function ThreadRouteContent(
976 <>
977 <GitActionProgressOverlay progress={gitActionProgress} onDismiss={dismissGitActionResult} />
978
934 - <View className="flex-1 bg-screen android:overflow-hidden android:rounded-t-[28px] android:bg-thread-canvas">
979 + <ThreadPane>
980 <ThreadDetailScreen
981 canOperateThread={canOperateThread}
982 selectedThread={selectedThreadWithDraftSettings ?? selectedThread}
@@ -1023,7 +1068,7 @@ function ThreadRouteContent(
1068 onSubmitUserInput={requests.onSubmitUserInput}
1069 onDismissUserInput={requests.onDismissUserInput}
1070 />
1026 - </View>
1071 + </ThreadPane>
1072 </>
1073 );
1074