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 21, 19:45 UTC
fix(mobile): browser and MCP-app links with blank IDs no longer crash the screen (#35415)
Julius Marminge committed
Nov 12, 2026 at 09:49 UTC
60c3b222db553796ef4c2b093691ad9b7ad6bf34
2 files changed
+54
-6
apps/mobile/src/features/browser/BrowserPreviewRouteScreen.tsx
+19
-2
@@ -35,16 +35,33 @@ type BrowserPreviewRouteScreenProps = StaticScreenProps<{
35
export function BrowserPreviewRouteScreen({ route }: BrowserPreviewRouteScreenProps) {
36
const navigation = useNavigation();
37
const onClose = () => navigation.goBack();
38
+ const { environmentId, threadId } = route.params;
39
+ if (!environmentId?.trim() || !threadId?.trim()) {
40
+ return <BrowserUnavailableScreen onClose={onClose} />;
41
+ }
42
return (
43
<BrowserPreviewScreen
40
- environmentId={EnvironmentId.make(route.params.environmentId)}
41
- threadId={ThreadId.make(route.params.threadId)}
44
+ environmentId={EnvironmentId.make(environmentId)}
45
+ threadId={ThreadId.make(threadId)}
46
initialTabId={route.params.tabId ?? null}
47
onClose={onClose}
48
/>
49
);
50
}
51
52
+function BrowserUnavailableScreen({ onClose }: { readonly onClose: () => void }) {
53
+ const insets = useSafeAreaInsets();
54
+ const contentTopInset = useContentTopInset();
55
+ return (
56
+ <View
57
+ className="flex-1 bg-sheet"
58
+ style={{ paddingTop: contentTopInset, paddingBottom: insets.bottom }}
59
+ >
60
+ <SheetHeader title="Browser" onClose={onClose} accessibilityLabel="Close browser" />
61
+ </View>
62
+ );
63
+}
64
+
65
function BrowserPreviewScreen({
66
environmentId,
67
threadId,
apps/mobile/src/features/threads/McpAppFullscreenScreen.tsx
+35
-4
@@ -56,6 +56,41 @@ function descendsFrom(
56
57
/** Resolve apps from stored tool calls so links cannot supply apps the call never produced. */
58
export function McpAppFullscreenScreen({ route }: McpAppFullscreenScreenProps) {
59
+ const navigation = useNavigation();
60
+ const { environmentId, threadId, itemId } = route.params;
61
+ if (!environmentId?.trim() || !threadId?.trim() || !itemId?.trim()) {
62
+ return (
63
+ <View className="flex-1 bg-screen">
64
+ <AppBar
65
+ title="App"
66
+ onClose={() => navigation.goBack()}
67
+ closeAccessibilityLabel="Exit full screen"
68
+ />
69
+ <Text className="m-6 text-sm text-foreground-muted">This app cannot be shown.</Text>
70
+ </View>
71
+ );
72
+ }
73
+ return (
74
+ <McpAppFullscreen
75
+ params={route.params}
76
+ environmentId={EnvironmentId.make(environmentId)}
77
+ threadId={ThreadId.make(threadId)}
78
+ itemId={TurnItemId.make(itemId)}
79
+ />
80
+ );
81
+}
82
+
83
+function McpAppFullscreen({
84
+ params,
85
+ environmentId,
86
+ threadId,
87
+ itemId,
88
+}: {
89
+ readonly params: McpAppFullscreenScreenProps["route"]["params"];
90
+ readonly environmentId: EnvironmentId;
91
+ readonly threadId: ThreadId;
92
+ readonly itemId: TurnItemId;
93
+}) {
94
const navigation = useNavigation();
95
const insets = useSafeAreaInsets();
96
// Wait for focus before goBack; an exit under another screen must not pop that screen.
@@ -74,10 +109,6 @@ export function McpAppFullscreenScreen({ route }: McpAppFullscreenScreenProps) {
109
});
110
};
111
const [size, setSize] = useState({ width: 0, height: 0 });
77
- const params = route.params;
78
- const environmentId = EnvironmentId.make(params.environmentId);
79
- const threadId = ThreadId.make(params.threadId);
80
- const itemId = TurnItemId.make(params.itemId);
112
const conversationThreadId = useConversationThreadId(
113
environmentId,
114
threadId,