@devries-cameron20 / t3code Mirror · read-only / commits / 7b6d907574
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, 14:15 UTC

fix(mobile): iPhones on iOS 27.2 beta no longer open to a black screen (#18654)

Co-authored-by: T3 Code Test <t3code-test@example.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

shivam committed Oct 12, 2026 at 20:00 UTC 7b6d90757415f7897bac1a39e42cfb1331c97ee5
2 files changed +30 -5
apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift
+12
@@ -35,9 +35,21 @@ final class T3LayoutMetricsView: ExpoView {
35 override func didMoveToWindow() {
36 super.didMoveToWindow()
37 lastMetrics = nil
38 + assumeNoHingeIfSilent()
39 publishMetrics()
40 }
41
42 + /// UIKit only sends hinge updates on devices that have a hinge. Without this,
43 + /// an ordinary iPhone never publishes and the navigator never attaches.
44 + private func assumeNoHingeIfSilent() {
45 + guard window != nil, hasHinge == nil else { return }
46 + DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { [weak self] in
47 + guard let self, self.window != nil, self.hasHinge == nil else { return }
48 + self.hasHinge = false
49 + self.publishMetrics()
50 + }
51 + }
52 +
53 override func layoutSubviews() {
54 super.layoutSubviews()
55 publishMetrics()
apps/mobile/src/native/NativeWorkspaceColumns.ios.tsx
+18 -5
@@ -1,4 +1,5 @@
1 import { requireOptionalNativeModule } from "expo";
2 +import { useEffect, useState } from "react";
3 import { Platform } from "react-native";
4 import { useNativeLayoutMetrics } from "./native-layout-metrics";
5
@@ -9,15 +10,27 @@ const nativeControls = requireOptionalNativeModule<{
10 export const NATIVE_WORKSPACE_COLUMNS_SUPPORTED =
11 Platform.OS === "ios" && Platform.isPad && nativeControls?.supportsWorkspaceColumns === true;
12
13 +// Binaries without the native no-hinge fallback never report metrics on ordinary
14 +// iPhones running iOS 27.1 or later. Use the compact navigator rather than staying blank.
15 +const NATIVE_METRICS_TIMEOUT_MS = 1000;
16 +
17 export function useNativeWorkspaceColumnsReady() {
18 const metrics = useNativeLayoutMetrics();
19 + const [timedOut, setTimedOut] = useState(false);
20 // Choose the phone's native host before attaching any screens. Older clients
21 // without the observer can immediately use the compact navigator.
16 - return (
17 - (Platform.OS === "ios" && Platform.isPad) ||
18 - !nativeControls?.ViewPrototypes?.T3NativeControls_LayoutMetrics ||
19 - metrics !== null
20 - );
22 + const waiting =
23 + !(Platform.OS === "ios" && Platform.isPad) &&
24 + !!nativeControls?.ViewPrototypes?.T3NativeControls_LayoutMetrics &&
25 + metrics === null;
26 +
27 + useEffect(() => {
28 + if (!waiting) return;
29 + const timeout = setTimeout(() => setTimedOut(true), NATIVE_METRICS_TIMEOUT_MS);
30 + return () => clearTimeout(timeout);
31 + }, [waiting]);
32 +
33 + return !waiting || timedOut;
34 }
35
36 export function useNativeWorkspaceColumnsSupported() {