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 24, 02:45 UTC
fix(mobile): add close controls to tablet files and terminal (#11115)
Julius Marminge committed
Sep 10, 2026 at 13:31 UTC
47dbb06c3b171c40ebdfbd5b38cd954127949bc0
2 files changed
+42
-2
apps/mobile/src/features/files/thread-file-navigator-pane.tsx
+22
-1
@@ -18,6 +18,7 @@ import { useEnvironmentQuery } from "../../state/query";
18
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
19
import { FileTreeBrowser } from "./FileTreeBrowser";
20
import { preloadWorkspaceFileContents } from "./preload-workspace-file";
21
+import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
22
23
export function ThreadFileNavigatorPane(props: {
24
readonly cwd: string;
@@ -28,6 +29,7 @@ export function ThreadFileNavigatorPane(props: {
29
readonly onSelectFile: (path: string) => void;
30
}) {
31
const [searchQuery, setSearchQuery] = useState("");
32
+ const { toggleAuxiliaryPane } = useAdaptiveWorkspaceLayout();
33
const { themeAppearance: highlightTheme } = useAppearancePreferences();
34
const theme = useUniwindTheme();
35
const foregroundColor = theme["--color-foreground"];
@@ -64,8 +66,18 @@ export function ThreadFileNavigatorPane(props: {
66
type: "button" as const,
67
width: 44,
68
},
69
+ {
70
+ accessibilityLabel: "Close files",
71
+ icon: { name: "xmark", type: "sfSymbol" as const },
72
+ identifier: "thread-file-navigator-close",
73
+ onPress: toggleAuxiliaryPane,
74
+ sharesBackground: false,
75
+ tintColor: foregroundColor,
76
+ type: "button" as const,
77
+ width: 44,
78
+ },
79
] as ComponentProps<typeof ScreenStackHeaderConfig>["headerRightBarButtonItems"],
68
- [entriesQuery.refresh, foregroundColor],
80
+ [entriesQuery.refresh, foregroundColor, toggleAuxiliaryPane],
81
);
82
83
const fileTree = (
@@ -159,6 +171,15 @@ export function ThreadFileNavigatorPane(props: {
171
type="monochrome"
172
/>
173
</Pressable>
174
+ <Pressable
175
+ accessibilityRole="button"
176
+ accessibilityLabel="Close files"
177
+ hitSlop={8}
178
+ className="h-8 w-8 items-center justify-center rounded-full active:bg-subtle"
179
+ onPress={toggleAuxiliaryPane}
180
+ >
181
+ <SymbolView name="xmark" size={14} tintColorClassName="accent-icon-muted" />
182
+ </Pressable>
183
</View>
184
<View className="flex-row items-center gap-2 border-t border-border px-3 py-2">
185
<SymbolView
apps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsx
+20
-1
@@ -850,6 +850,19 @@ export function ThreadTerminalRouteScreen(props: ThreadTerminalRouteScreenProps)
850
[navigation, selectedThread, terminalId],
851
);
852
853
+ const handleCloseTerminal = useCallback(() => {
854
+ if (navigation.canGoBack()) {
855
+ navigation.goBack();
856
+ return;
857
+ }
858
+ navigation.dispatch(
859
+ StackActions.replace("Thread", {
860
+ environmentId: params.environmentId,
861
+ threadId: params.threadId,
862
+ }),
863
+ );
864
+ }, [navigation, params.environmentId, params.threadId]);
865
+
866
const navigateAwayAfterExit = useCallback(() => {
867
// With other shells still live, fall through to the previous one instead
868
// of dropping the user back on the thread.
@@ -1143,7 +1156,7 @@ export function ThreadTerminalRouteScreen(props: ThreadTerminalRouteScreenProps)
1156
<AndroidScreenHeader
1157
title="Terminal"
1158
subtitle={headerSubtitle}
1146
- onBack={navigation.canGoBack() ? () => navigation.goBack() : undefined}
1159
+ onBack={handleCloseTerminal}
1160
trailing={
1161
<>
1162
{layout.usesSplitView ? (
@@ -1179,6 +1192,12 @@ export function ThreadTerminalRouteScreen(props: ThreadTerminalRouteScreenProps)
1192
1193
{layout.usesSplitView ? (
1194
<NativeHeaderToolbar placement="left">
1195
+ <NativeHeaderToolbar.Button
1196
+ accessibilityLabel="Close terminal"
1197
+ icon="xmark"
1198
+ onPress={handleCloseTerminal}
1199
+ separateBackground
1200
+ />
1201
<NativeHeaderToolbar.Button
1202
accessibilityLabel={panes.primarySidebarVisible ? "Maximize terminal" : "Show threads"}
1203
icon={