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, 18:00 UTC
perf(mobile): skip showcase subscriptions in normal builds (#16131)
Julius Marminge committed
Oct 7, 2026 at 22:48 UTC
6651aaab38c6814ed7bba3e805a1ec7a01870b55
1 file changed
+14
-11
apps/mobile/src/features/showcase/ShowcaseCaptureCoordinator.tsx
+14
-11
@@ -56,7 +56,14 @@ function sceneFromPathname(pathname: string): ShowcaseScene | null {
56
return null;
57
}
58
59
+// Showcase capture only runs in showcase builds. Gate the mount so normal builds
60
+// never subscribe to workspace, project, or thread shell state.
61
export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) {
62
+ if (!SHOWCASE_ENABLED) return null;
63
+ return <EnabledShowcaseCaptureCoordinator pathname={props.pathname} />;
64
+}
65
+
66
+function EnabledShowcaseCaptureCoordinator(props: { readonly pathname: string }) {
67
const navigation = useNavigation();
68
const { connectPairingUrl } = useConnectionController();
69
const {
@@ -92,7 +99,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
99
);
100
101
useEffect(() => {
95
- if (!SHOWCASE_ENABLED || pairingUrls.length > 0) return;
102
+ if (pairingUrls.length > 0) return;
103
104
const readLaunchRequest = () => {
105
const values = getNativeShowcasePairingUrls();
@@ -110,7 +117,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
117
}, [pairingUrls.length]);
118
119
useEffect(() => {
113
- if (!SHOWCASE_ENABLED || orientationSettled) return;
120
+ if (orientationSettled) return;
121
const orientation = getNativeShowcaseOrientation();
122
if (orientation === null) {
123
setOrientationSettled(true);
@@ -130,8 +137,6 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
137
}, [orientationSettled]);
138
139
useEffect(() => {
133
- if (!SHOWCASE_ENABLED) return;
134
-
140
const readRequestedScene = () => {
141
const value = getNativeShowcaseScene();
142
if (!value || requestedSceneRef.current === value) return;
@@ -156,7 +161,6 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
161
162
useEffect(() => {
163
if (
159
- !SHOWCASE_ENABLED ||
164
requestedTheme === null ||
165
themeApplied ||
166
// Writing before stored preferences load would be overwritten by them.
@@ -168,7 +172,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
172
}, [appearancePreferencesReady, requestedTheme, setThemeIdForBothAppearances, themeApplied]);
173
174
useEffect(() => {
171
- if (!SHOWCASE_ENABLED || pairingUrls.length === 0) return;
175
+ if (pairingUrls.length === 0) return;
176
let cancelled = false;
177
void (async () => {
178
await Promise.all(
@@ -201,7 +205,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
205
const showcaseThread = threads.find((thread) => String(thread.id) === SHOWCASE_THREAD_ID);
206
207
useEffect(() => {
204
- if (!SHOWCASE_ENABLED || !hasServerFixture || pendingTasksReady) return;
208
+ if (!hasServerFixture || pendingTasksReady) return;
209
210
const pendingTasks = buildShowcasePendingTasks(projects, Date.now());
211
if (pendingTasks.length !== SHOWCASE_PENDING_TASK_DEFINITIONS.length) return;
@@ -232,7 +236,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
236
}, [hasServerFixture, pendingTasksReady, projects]);
237
238
useEffect(() => {
235
- if (!SHOWCASE_ENABLED || requestedScene === null || !hasFixture || !showcaseThread) return;
239
+ if (requestedScene === null || !hasFixture || !showcaseThread) return;
240
if (scene === requestedScene) return;
241
242
const params = {
@@ -285,7 +289,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
289
}, [hasFixture, navigation, requestedScene, scene, showcaseThread]);
290
291
useEffect(() => {
288
- if (!SHOWCASE_ENABLED || scene !== "agent-activity" || !hasFixture || agentActivityStaged) {
292
+ if (scene !== "agent-activity" || !hasFixture || agentActivityStaged) {
293
return;
294
}
295
let cancelled = false;
@@ -319,7 +323,6 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
323
324
useEffect(() => {
325
if (
322
- !SHOWCASE_ENABLED ||
326
scene === null ||
327
requestedScene === null ||
328
scene !== requestedScene ||
@@ -363,7 +366,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string })
366
themeId,
367
]);
368
366
- if (!SHOWCASE_ENABLED || readyScene === null) return null;
369
+ if (readyScene === null) return null;
370
371
return (
372
<View