| ... | ... | @@ -56,7 +56,14 @@ function sceneFromPathname(pathname: string): ShowcaseScene | null { |
| 56 | 56 | return null; |
| 57 | 57 | } |
| 58 | 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. |
| 59 | 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 }) { |
| 60 | 67 | const navigation = useNavigation(); |
| 61 | 68 | const { connectPairingUrl } = useConnectionController(); |
| 62 | 69 | const { |
| ... | ... | @@ -92,7 +99,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 92 | 99 | ); |
| 93 | 100 | |
| 94 | 101 | useEffect(() => { |
| 95 | | if (!SHOWCASE_ENABLED || pairingUrls.length > 0) return; |
| 102 | if (pairingUrls.length > 0) return; |
| 96 | 103 | |
| 97 | 104 | const readLaunchRequest = () => { |
| 98 | 105 | const values = getNativeShowcasePairingUrls(); |
| ... | ... | @@ -110,7 +117,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 110 | 117 | }, [pairingUrls.length]); |
| 111 | 118 | |
| 112 | 119 | useEffect(() => { |
| 113 | | if (!SHOWCASE_ENABLED || orientationSettled) return; |
| 120 | if (orientationSettled) return; |
| 114 | 121 | const orientation = getNativeShowcaseOrientation(); |
| 115 | 122 | if (orientation === null) { |
| 116 | 123 | setOrientationSettled(true); |
| ... | ... | @@ -130,8 +137,6 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 130 | 137 | }, [orientationSettled]); |
| 131 | 138 | |
| 132 | 139 | useEffect(() => { |
| 133 | | if (!SHOWCASE_ENABLED) return; |
| 134 | | |
| 135 | 140 | const readRequestedScene = () => { |
| 136 | 141 | const value = getNativeShowcaseScene(); |
| 137 | 142 | if (!value || requestedSceneRef.current === value) return; |
| ... | ... | @@ -156,7 +161,6 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 156 | 161 | |
| 157 | 162 | useEffect(() => { |
| 158 | 163 | if ( |
| 159 | | !SHOWCASE_ENABLED || |
| 160 | 164 | requestedTheme === null || |
| 161 | 165 | themeApplied || |
| 162 | 166 | // Writing before stored preferences load would be overwritten by them. |
| ... | ... | @@ -168,7 +172,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 168 | 172 | }, [appearancePreferencesReady, requestedTheme, setThemeIdForBothAppearances, themeApplied]); |
| 169 | 173 | |
| 170 | 174 | useEffect(() => { |
| 171 | | if (!SHOWCASE_ENABLED || pairingUrls.length === 0) return; |
| 175 | if (pairingUrls.length === 0) return; |
| 172 | 176 | let cancelled = false; |
| 173 | 177 | void (async () => { |
| 174 | 178 | await Promise.all( |
| ... | ... | @@ -201,7 +205,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 201 | 205 | const showcaseThread = threads.find((thread) => String(thread.id) === SHOWCASE_THREAD_ID); |
| 202 | 206 | |
| 203 | 207 | useEffect(() => { |
| 204 | | if (!SHOWCASE_ENABLED || !hasServerFixture || pendingTasksReady) return; |
| 208 | if (!hasServerFixture || pendingTasksReady) return; |
| 205 | 209 | |
| 206 | 210 | const pendingTasks = buildShowcasePendingTasks(projects, Date.now()); |
| 207 | 211 | if (pendingTasks.length !== SHOWCASE_PENDING_TASK_DEFINITIONS.length) return; |
| ... | ... | @@ -232,7 +236,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 232 | 236 | }, [hasServerFixture, pendingTasksReady, projects]); |
| 233 | 237 | |
| 234 | 238 | useEffect(() => { |
| 235 | | if (!SHOWCASE_ENABLED || requestedScene === null || !hasFixture || !showcaseThread) return; |
| 239 | if (requestedScene === null || !hasFixture || !showcaseThread) return; |
| 236 | 240 | if (scene === requestedScene) return; |
| 237 | 241 | |
| 238 | 242 | const params = { |
| ... | ... | @@ -285,7 +289,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 285 | 289 | }, [hasFixture, navigation, requestedScene, scene, showcaseThread]); |
| 286 | 290 | |
| 287 | 291 | useEffect(() => { |
| 288 | | if (!SHOWCASE_ENABLED || scene !== "agent-activity" || !hasFixture || agentActivityStaged) { |
| 292 | if (scene !== "agent-activity" || !hasFixture || agentActivityStaged) { |
| 289 | 293 | return; |
| 290 | 294 | } |
| 291 | 295 | let cancelled = false; |
| ... | ... | @@ -319,7 +323,6 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 319 | 323 | |
| 320 | 324 | useEffect(() => { |
| 321 | 325 | if ( |
| 322 | | !SHOWCASE_ENABLED || |
| 323 | 326 | scene === null || |
| 324 | 327 | requestedScene === null || |
| 325 | 328 | scene !== requestedScene || |
| ... | ... | @@ -363,7 +366,7 @@ export function ShowcaseCaptureCoordinator(props: { readonly pathname: string }) |
| 363 | 366 | themeId, |
| 364 | 367 | ]); |
| 365 | 368 | |
| 366 | | if (!SHOWCASE_ENABLED || readyScene === null) return null; |
| 369 | if (readyScene === null) return null; |
| 367 | 370 | |
| 368 | 371 | return ( |
| 369 | 372 | <View |