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, 16:45 UTC
feat(mobile): support Duo in the shared iOS app (#12648)
Julius Marminge committed
Oct 9, 2026 at 16:02 UTC
c85dc642681a944e644cbbbea7257d274822c21a
42 files changed
+808
-126
apps/mobile/app.config.ts
+5
@@ -264,6 +264,11 @@ const config: ExpoConfig = {
264
"keychain-access-groups": [`$(AppIdentifierPrefix)${variant.iosBundleIdentifier}`],
265
},
266
infoPlist: {
267
+ UISupportedInterfaceOrientations: [
268
+ "UIInterfaceOrientationPortrait",
269
+ "UIInterfaceOrientationLandscapeLeft",
270
+ "UIInterfaceOrientationLandscapeRight",
271
+ ],
272
NSAppTransportSecurity: {
273
NSAllowsArbitraryLoads: true,
274
},
apps/mobile/deps/react-native-screens-5.0.0-t3.7.tgz
Binary files a/apps/mobile/deps/react-native-screens-5.0.0-t3.7.tgz and /dev/null differ
apps/mobile/deps/react-native-screens-5.0.0-t3.8.tgz
Binary files /dev/null and b/apps/mobile/deps/react-native-screens-5.0.0-t3.8.tgz differ
apps/mobile/eas.json
+15
-3
@@ -13,7 +13,10 @@
13
},
14
"channel": "development",
15
"developmentClient": true,
16
- "distribution": "internal"
16
+ "distribution": "internal",
17
+ "ios": {
18
+ "image": "macos-tahoe-26.6-xcode-27.1"
19
+ }
20
},
21
"preview": {
22
"corepack": true,
@@ -23,7 +26,10 @@
26
},
27
"channel": "preview",
28
"environment": "preview",
26
- "distribution": "internal"
29
+ "distribution": "internal",
30
+ "ios": {
31
+ "image": "macos-tahoe-26.6-xcode-27.1"
32
+ }
33
},
34
"preview:dev": {
35
"corepack": true,
@@ -38,6 +44,9 @@
44
"distribution": "internal",
45
"android": {
46
"buildType": "apk"
47
+ },
48
+ "ios": {
49
+ "image": "macos-tahoe-26.6-xcode-27.1"
50
}
51
},
52
"v2-preview": {
@@ -56,7 +65,10 @@
65
},
66
"channel": "production",
67
"environment": "production",
59
- "autoIncrement": true
68
+ "autoIncrement": true,
69
+ "ios": {
70
+ "image": "macos-tahoe-26.6-xcode-27.1"
71
+ }
72
}
73
},
74
"submit": {
apps/mobile/modules/t3-native-controls/expo-module.config.json
+2
-1
@@ -1,7 +1,8 @@
1
{
2
"platforms": ["apple", "android"],
3
"apple": {
4
- "modules": ["T3NativeControlsModule", "T3KeyboardCommandsModule"]
4
+ "modules": ["T3NativeControlsModule", "T3KeyboardCommandsModule"],
5
+ "appDelegateSubscribers": ["T3WorkspaceOrientationSubscriber"]
6
},
7
"android": {
8
"modules": [
apps/mobile/modules/t3-native-controls/ios/T3KeyboardCommandsModule.swift
+6
@@ -17,9 +17,13 @@ public final class T3KeyboardCommandsModule: Module {
17
public final class T3KeyboardCommandsView: ExpoView {
18
let onCommand = EventDispatcher()
19
private var enabledCommands = Set<String>()
20
+ private let shortcutInputView = UIView(frame: .zero)
21
22
public override var canBecomeFirstResponder: Bool { true }
23
24
+ // This responder handles hardware shortcuts, so reclaiming it must not show a software keyboard.
25
+ public override var inputView: UIView? { shortcutInputView }
26
+
27
public override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
28
if action == #selector(openCommandPalette) || action == #selector(paletteNext) || action == #selector(palettePrevious) || action == #selector(paletteDismiss),
29
let input = window?.t3FirstResponder as? UITextInput,
@@ -89,6 +93,8 @@ public final class T3KeyboardCommandsView: ExpoView {
93
94
public required init(appContext: AppContext? = nil) {
95
super.init(appContext: appContext)
96
+ inputAssistantItem.leadingBarButtonGroups = []
97
+ inputAssistantItem.trailingBarButtonGroups = []
98
NotificationCenter.default.addObserver(
99
self,
100
selector: #selector(reclaimFirstResponderIfAvailable),
apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift
+49
-2
@@ -1,10 +1,12 @@
1
import ExpoModulesCore
2
import UIKit
3
4
-/// Reports the body geometry of a native navigation column.
4
+/// Reports geometry in the observing view's coordinate space, including system
5
+/// reservations that safe-area rectangles cannot represent, such as the fold.
6
final class T3LayoutMetricsView: ExpoView {
7
let onMetricsChange = EventDispatcher()
8
private var lastMetrics: NSDictionary?
9
+ private var hasHinge: Bool? = false
10
11
required init(appContext: AppContext? = nil) {
12
super.init(appContext: appContext)
@@ -12,6 +14,22 @@ final class T3LayoutMetricsView: ExpoView {
14
registerForTraitChanges([UITraitHorizontalSizeClass.self, UITraitVerticalSizeClass.self]) { (view: T3LayoutMetricsView, _: UITraitCollection) in
15
view.publishMetrics()
16
}
17
+ #if compiler(>=6.4)
18
+ if #available(iOS 27.1, *) {
19
+ hasHinge = nil
20
+ addInteraction(UIHingeInteraction { [weak self] _, update in
21
+ guard let self, self.window != nil else { return }
22
+ // Capability survives temporary detachment and does not follow the hinge angle.
23
+ let hasHinge = self.hasHinge == true || update.hinge != nil
24
+ guard self.hasHinge != hasHinge else { return }
25
+ self.hasHinge = hasHinge
26
+ self.publishMetrics()
27
+ })
28
+ registerForTraitChanges(UITraitCollection.systemTraitsAffectingVerticalBarEdge) { (view: T3LayoutMetricsView, _: UITraitCollection) in
29
+ view.publishMetrics()
30
+ }
31
+ }
32
+ #endif
33
}
34
35
override func didMoveToWindow() {
@@ -31,14 +49,43 @@ final class T3LayoutMetricsView: ExpoView {
49
}
50
51
private func publishMetrics() {
34
- guard window != nil, bounds.width > 0, bounds.height > 0 else { return }
52
+ guard let window, bounds.width > 0, bounds.height > 0, let hasHinge else { return }
53
+ if hasHinge {
54
+ T3WorkspaceOrientationSubscriber.allowHingeOrientations(in: window)
55
+ }
56
+ var verticalBarEdge = "none"
57
+ var regions: [[String: Any]] = []
58
+ #if compiler(>=6.4)
59
+ if #available(iOS 27.1, *) {
60
+ let rtl = effectiveUserInterfaceLayoutDirection == .rightToLeft
61
+ switch traitCollection.verticalBarEdge {
62
+ case .leading: verticalBarEdge = rtl ? "right" : "left"
63
+ case .trailing: verticalBarEdge = rtl ? "left" : "right"
64
+ default: break
65
+ }
66
+ for kind in [UIView.ReservedRegion.Kind.division, .occlusion] {
67
+ for region in reservedRegions(kind: kind) where region.isActive {
68
+ let frame = region.frame.intersection(bounds)
69
+ guard !frame.isNull, !frame.isEmpty else { continue }
70
+ regions.append([
71
+ "kind": kind == .division ? "division" : "occlusion",
72
+ "x": frame.minX, "y": frame.minY,
73
+ "width": frame.width, "height": frame.height,
74
+ ])
75
+ }
76
+ }
77
+ }
78
+ #endif
79
let metrics: [String: Any] = [
80
"width": bounds.width, "height": bounds.height,
81
+ "hasHinge": hasHinge,
82
"horizontalSizeClass": traitCollection.horizontalSizeClass == .regular ? "regular" : "compact",
83
+ "verticalBarEdge": verticalBarEdge,
84
"safeArea": [
85
"top": safeAreaInsets.top, "bottom": safeAreaInsets.bottom,
86
"left": safeAreaInsets.left, "right": safeAreaInsets.right,
87
],
88
+ "reservedRegions": regions,
89
]
90
let next = metrics as NSDictionary
91
guard lastMetrics?.isEqual(next) != true else { return }
apps/mobile/modules/t3-native-controls/ios/T3NativeControlsModule.swift
+3
-1
@@ -13,7 +13,9 @@ public final class T3NativeControlsModule: Module {
13
public func definition() -> ModuleDefinition {
14
Constants {
15
if #available(iOS 26.0, *) {
16
- return ["supportsWorkspaceColumns": NSClassFromString("RNSSplitHostComponentView") != nil]
16
+ return [
17
+ "supportsWorkspaceColumns": NSClassFromString("RNSSplitHostComponentView") != nil,
18
+ ]
19
}
20
return ["supportsWorkspaceColumns": false]
21
}
apps/mobile/modules/t3-native-controls/ios/T3WorkspaceOrientationSubscriber.swift
new
+22
@@ -0,0 +1,22 @@
1
+import ExpoModulesCore
2
+import UIKit
3
+
4
+/// Keep ordinary phones portrait-only while allowing a hinge-backed scene to rotate.
5
+public final class T3WorkspaceOrientationSubscriber: ExpoAppDelegateSubscriber {
6
+ private static let hingeWindows = NSHashTable<UIWindow>.weakObjects()
7
+
8
+ static func allowHingeOrientations(in window: UIWindow) {
9
+ guard !hingeWindows.contains(window) else { return }
10
+ hingeWindows.add(window)
11
+ window.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations()
12
+ }
13
+
14
+ public func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
15
+ if UIDevice.current.userInterfaceIdiom == .pad {
16
+ // Keep iPad orientation policy, including portrait-only showcase captures.
17
+ let orientations = Bundle.main.object(forInfoDictionaryKey: "UISupportedInterfaceOrientations~ipad") as? [String] ?? []
18
+ return orientations == ["UIInterfaceOrientationPortrait"] ? .portrait : .all
19
+ }
20
+ return window.map { Self.hingeWindows.contains($0) } == true ? .allButUpsideDown : .portrait
21
+ }
22
+}
apps/mobile/package.json
+1
-1
@@ -127,7 +127,7 @@
127
"react-native-nitro-modules": "0.35.9",
128
"react-native-reanimated": "4.7.0",
129
"react-native-safe-area-context": "~5.9.1",
130
- "react-native-screens": "file:deps/react-native-screens-5.0.0-t3.7.tgz",
130
+ "react-native-screens": "file:deps/react-native-screens-5.0.0-t3.8.tgz",
131
"react-native-shiki-engine": "^0.3.12",
132
"react-native-svg": "15.15.5",
133
"react-native-webview": "14.0.1",
apps/mobile/src/App.tsx
+8
-5
@@ -27,6 +27,7 @@ import { useUiRuntimeMemoryWarningGc } from "./lib/useUiRuntimeMemoryWarningGc";
27
import { SubscriptionUsageCoordinator } from "./widgets/SubscriptionUsageCoordinator";
28
import { VoiceInputProvider } from "./features/voice-input/VoiceInputProvider";
29
import { GlobalVoiceInputControl } from "./features/voice-input/GlobalVoiceInputControl";
30
+import { NativeLayoutMetricsProvider } from "./native/native-layout-metrics";
31
32
import "../global.css";
33
@@ -91,11 +92,13 @@ function AppContent() {
92
header (glass buttons, title, materials) is forced light even when
93
the system is in dark mode. */}
94
<GlobalVoiceInputControl>
94
- <IncomingShareProvider>
95
- <Navigation linking={appLinking} theme={navigationTheme} />
96
- </IncomingShareProvider>
97
- <ConfirmDialogHost />
98
- <ThreadArrangementHost />
95
+ <NativeLayoutMetricsProvider>
96
+ <IncomingShareProvider>
97
+ <Navigation linking={appLinking} theme={navigationTheme} />
98
+ </IncomingShareProvider>
99
+ <ConfirmDialogHost />
100
+ <ThreadArrangementHost />
101
+ </NativeLayoutMetricsProvider>
102
</GlobalVoiceInputControl>
103
{/* Anchored-menu overlays render here — in-window, so the
104
keyboard stays up while a dropdown is open. */}
apps/mobile/src/Stack.tsx
+9
-1
@@ -128,6 +128,7 @@ import {
128
} from "./features/sharing/incoming-share-presentation";
129
import { NATIVE_LIQUID_GLASS_SUPPORTED } from "./native/native-glass";
130
import { deriveLayout } from "./lib/layout";
131
+import { useNativeLayoutMetrics } from "./native/native-layout-metrics";
132
import { nativeHeaderScrollEdgeEffects } from "./native/StackHeader";
133
import { FORM_SHEET_PRESENTATION_OPTIONS } from "./native/sheet-surface";
134
import { useThreadOutboxDrain } from "./state/use-thread-outbox-drain";
@@ -192,6 +193,9 @@ const LEGAL_DOCUMENT_HEADER_OPTIONS: AppScreenOptions = {
193
presentation: "fullScreenModal",
194
};
195
196
+// A navigator container leaves horizontal safe-area handling to its leaf screens.
197
+const NESTED_NAVIGATOR_OPTIONS = { nativeContentInsetHorizontally: false, headerShown: false };
198
+
199
const SettingsContentStack = createV5SheetStackNavigator({
200
initialRouteName: "Settings",
201
screenOptions: {
@@ -410,6 +414,7 @@ const SettingsSheetStack = createV5SheetStackNavigator({
414
screens: {
415
SettingsContent: createNativeStackScreen({
416
screen: SettingsContentStack,
417
+ options: NESTED_NAVIGATOR_OPTIONS,
418
linking: "",
419
layout: ({ children }) => (
420
<SettingsEnvironmentFilterProvider>
@@ -845,6 +850,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
850
screen: SettingsSheetStack,
851
linking: "settings",
852
options: {
853
+ ...NESTED_NAVIGATOR_OPTIONS,
854
gestureEnabled: true,
855
headerShown: false,
856
},
@@ -911,6 +917,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
917
</GuardedScreenLayout>
918
),
919
options: {
920
+ ...NESTED_NAVIGATOR_OPTIONS,
921
gestureEnabled: true,
922
headerShown: false,
923
},
@@ -951,8 +958,9 @@ function ScreenRenderFallback(props: RenderFailureProps & { readonly routeName:
958
959
export const RootStack = RootStackConfig.with(function AdaptiveRootStack({ Navigator }) {
960
const { width, height } = useWindowDimensions();
961
+ const nativeMetrics = useNativeLayoutMetrics();
962
const usesWorkspaceFlowScreens =
955
- Platform.OS === "android" || deriveLayout({ width, height }).usesSplitView;
963
+ Platform.OS === "android" || deriveLayout({ width, height, nativeMetrics }).usesSplitView;
964
965
return (
966
<Navigator
apps/mobile/src/components/ScreenHeader.tsx
+12
-4
@@ -1,9 +1,10 @@
1
import type { HeaderBarButtonMailSearchToolbarItem } from "react-native-screens";
2
import { useId } from "react";
3
-import { ActivityIndicator, View } from "react-native";
3
+import { ActivityIndicator, Platform, View } from "react-native";
4
import { createNativeHeaderMenu } from "./nativeHeaderMenu.ios";
5
import { ScreenHeaderButton } from "./ScreenHeaderButton";
6
import { NativeHeaderToolbar, NativeStackScreenOptions } from "../native/StackHeader";
7
+import { useNativeWorkspaceColumnsSupported } from "../native/NativeWorkspaceColumns";
8
import { useAdaptiveWorkspaceLayout } from "../features/layout/AdaptiveWorkspaceLayout";
9
import {
10
createNativeMailSearchToolbarItem,
@@ -12,6 +13,7 @@ import {
13
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
14
import type { ScreenHeaderMenuItem, ScreenHeaderProps } from "./ScreenHeader.types";
15
import type { AppSymbolName } from "./AppSymbol";
16
+import { useNativeMailSearchToolbar } from "../native/use-native-mail-search-toolbar";
17
18
function iosIcon(icon: AppSymbolName) {
19
return typeof icon === "string" ? icon : icon.ios;
@@ -33,15 +35,17 @@ function mailMenuItems(items: ReadonlyArray<ScreenHeaderMenuItem>): MailMenu["it
35
}
36
37
export function ScreenHeader(props: ScreenHeaderProps) {
38
+ const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
39
const headerId = useId();
40
const { layout, panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();
41
const { themeVariables } = useAppearancePreferences();
42
+ const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
43
const { search, menus } = props;
44
const menu = menus?.[0];
45
const compactSearch =
46
search !== undefined &&
47
(search.compactToolbar ?? !layout.usesSplitView) &&
44
- NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED;
48
+ usesNativeMailSearchToolbar;
49
const visibleMenus = compactSearch ? (menus?.slice(1) ?? []) : (menus ?? []);
50
const refresh = search?.refreshInToolbar ? search.onRefresh : undefined;
51
return (
@@ -88,7 +92,7 @@ export function ScreenHeader(props: ScreenHeaderProps) {
92
: undefined),
93
}),
94
]
91
- : undefined,
95
+ : () => [],
96
headerSearchBarOptions: compactSearch
97
? undefined
98
: {
@@ -116,8 +120,12 @@ export function ScreenHeader(props: ScreenHeaderProps) {
120
onPress={props.backInSplitView.onPress ?? props.onBack}
121
/>
122
) : null}
119
- {props.sidebar !== false ? (
123
+ {props.sidebar !== false &&
124
+ (!usesNativeWorkspaceColumns ||
125
+ (Platform.OS === "ios" && Platform.isPad) ||
126
+ !panes.primarySidebarVisible) ? (
127
<ScreenHeaderButton
128
+ axisBehavior={usesNativeWorkspaceColumns ? "horizontalOnly" : undefined}
129
accessibilityLabel={
130
panes.primarySidebarVisible
131
? `Maximize ${props.title.toLowerCase()}`
apps/mobile/src/features/home/HomeHeader.tsx
+34
-11
@@ -1,25 +1,43 @@
1
import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";
2
-import { use, useCallback, useRef } from "react";
2
+import { use, useCallback, useEffect, useRef } from "react";
3
+import { useNavigation, type ParamListBase } from "@react-navigation/native";
4
+import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
5
import { Platform } from "react-native";
6
import type { SearchBarCommands } from "react-native-screens";
7
import { NativePrimaryColumnContext } from "../../native/v5-workspace-context";
8
import { useUniwindTheme } from "../../lib/useUniwindTheme";
9
import { useHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";
10
import { withNativeGlassHeaderItem } from "../layout/native-glass-header-items";
9
-import {
10
- createNativeMailSearchToolbarItem,
11
- NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED,
12
-} from "../layout/native-mail-search-toolbar";
11
+import { createNativeMailSearchToolbarItem } from "../layout/native-mail-search-toolbar";
12
+import { useNativeMailSearchToolbar } from "../../native/use-native-mail-search-toolbar";
13
import { buildHomeListFilterMenu } from "./home-list-filter-menu";
14
import { createSidebarHeaderItems } from "../threads/sidebar-native-header-items";
15
import type { HomeHeaderProps } from "./HomeHeader.types";
16
+import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
17
18
export type { HomeHeaderEnvironment } from "./HomeHeader.types";
19
20
export function HomeHeader(props: HomeHeaderProps) {
21
+ const navigation = useNavigation<NativeStackNavigationProp<ParamListBase>>();
22
+ const { panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();
23
+ const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
24
const primaryColumn = use(NativePrimaryColumnContext);
21
- const iPadSidebar = Platform.OS === "ios" && Platform.isPad && primaryColumn !== null;
25
+ const sidebarHeader =
26
+ Platform.OS === "ios" &&
27
+ primaryColumn !== null &&
28
+ (Platform.isPad || !usesNativeMailSearchToolbar);
29
const searchBarRef = useRef<SearchBarCommands>(null);
30
+ const focusAfterReveal = useRef(false);
31
+ useEffect(
32
+ () =>
33
+ navigation.addListener("transitionEnd", (event) => {
34
+ if (focusAfterReveal.current && !event.data.closing) {
35
+ focusAfterReveal.current = false;
36
+ searchBarRef.current?.focus();
37
+ }
38
+ }),
39
+ [navigation],
40
+ );
41
const iconColor = useUniwindTheme()["--color-icon"];
42
// The list uses a fixed creation order and ignores sort/group options, so
43
// the filter menu only carries the filters and the "customized" icon state
@@ -27,9 +45,14 @@ export function HomeHeader(props: HomeHeaderProps) {
45
const hasCustomListOptions =
46
props.selectedEnvironmentId !== null || props.selectedProjectKey !== null;
47
const focusSearch = useCallback(() => {
48
+ if (primaryColumn && !panes.primarySidebarVisible) {
49
+ focusAfterReveal.current = true;
50
+ togglePrimarySidebar();
51
+ return true;
52
+ }
53
searchBarRef.current?.focus();
54
return searchBarRef.current !== null;
32
- }, []);
55
+ }, [primaryColumn, panes.primarySidebarVisible, togglePrimarySidebar]);
56
useHardwareKeyboardCommand("focusSearch", focusSearch);
57
const filterMenu = buildHomeListFilterMenu(props);
58
@@ -42,7 +65,7 @@ export function HomeHeader(props: HomeHeaderProps) {
65
// (GLASS_HEADER_OPTIONS). Only dynamic values are set here.
66
headerTintColor: iconColor,
67
unstable_headerRightItems: () =>
45
- iPadSidebar
68
+ sidebarHeader
69
? createSidebarHeaderItems({
70
filterIcon: hasCustomListOptions
71
? "line.3.horizontal.decrease.circle.fill"
@@ -62,7 +85,7 @@ export function HomeHeader(props: HomeHeaderProps) {
85
],
86
// The keys below are set per-branch (not `undefined`) so a later
87
// reapply cannot clobber options owned by NativeHeaderToolbar.
65
- ...(iPadSidebar
88
+ ...(sidebarHeader
89
? {
90
headerSearchBarOptions: {
91
ref: searchBarRef,
@@ -78,7 +101,7 @@ export function HomeHeader(props: HomeHeaderProps) {
101
},
102
unstable_headerToolbarItems: () => [],
103
}
81
- : NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED
104
+ : usesNativeMailSearchToolbar
105
? {
106
headerSearchBarOptions: {
107
ref: searchBarRef,
@@ -121,7 +144,7 @@ export function HomeHeader(props: HomeHeaderProps) {
144
}}
145
/>
146
124
- {iPadSidebar || NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED ? null : (
147
+ {sidebarHeader || usesNativeMailSearchToolbar ? null : (
148
<NativeHeaderToolbar placement="bottom">
149
<NativeHeaderToolbar.Menu
150
accessibilityLabel="Filter threads"
apps/mobile/src/features/home/HomeScreen.tsx
+14
-2
@@ -36,8 +36,12 @@ import type { SavedRemoteConnection } from "../../lib/connection";
36
import { scopedProjectKey, scopedThreadKey } from "../../lib/scopedEntities";
37
import { NativePrimaryColumnContext } from "../../native/v5-workspace-context";
38
import { nativeHeaderScrollEdgeEffects } from "../../native/scrollEdgeEffects";
39
-import { useNativeColumnLayoutMetrics } from "../../native/native-layout-metrics";
39
+import {
40
+ useNativeColumnLayoutMetrics,
41
+ useNativeLayoutMetrics,
42
+} from "../../native/native-layout-metrics";
43
import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass";
44
+import { useNativeWorkspaceColumnsSupported } from "../../native/NativeWorkspaceColumns";
45
import { useThreadSearch } from "../../state/queries";
46
import { useThreadJumpShortcuts } from "../keyboard/threadKeyboardShortcuts";
47
import { usePendingThreadOrder } from "../../state/thread-order";
@@ -264,6 +268,7 @@ function renderHomeScrollView(props: ScrollViewProps) {
268
/* ─── Main screen ────────────────────────────────────────────────────── */
269
270
export function HomeScreen(props: HomeScreenProps) {
271
+ const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
272
const primaryColumn = use(NativePrimaryColumnContext);
273
const contentBackground = primaryColumn ? "bg-drawer" : "bg-screen";
274
const containerClassName = cn(
@@ -277,6 +282,10 @@ export function HomeScreen(props: HomeScreenProps) {
282
const openSwipeableRef = useRef<SwipeableMethods | null>(null);
283
const insets = useSafeAreaInsets();
284
const { fabClearance } = useAndroidControlSizing();
285
+ const screenMetrics = useNativeLayoutMetrics();
286
+ const contentSideInsets = usesNativeWorkspaceColumns
287
+ ? (columnMetrics ?? screenMetrics)?.safeArea
288
+ : undefined;
289
// UIKit's column safe area already includes its bottom toolbar.
290
const iosBottomClearance = Math.max(columnMetrics?.safeArea.bottom ?? insets.bottom, 24);
291
const searchEnvironmentIds = useMemo(
@@ -908,6 +917,8 @@ export function HomeScreen(props: HomeScreenProps) {
917
style={{
918
paddingBottom: Platform.OS === "ios" ? iosBottomClearance : Math.max(insets.bottom, 24),
919
paddingTop: NATIVE_LIQUID_GLASS_SUPPORTED ? insets.top + 72 : 0,
920
+ paddingLeft: 32 + (contentSideInsets?.left ?? 0),
921
+ paddingRight: 32 + (contentSideInsets?.right ?? 0),
922
}}
923
>
924
<View className="w-full max-w-[430px]">
@@ -1038,7 +1049,8 @@ export function HomeScreen(props: HomeScreenProps) {
1049
{...scrollGateHandlers}
1050
scrollEventThrottle={16}
1051
contentContainerStyle={{
1041
- paddingHorizontal: primaryColumn ? 8 : 0,
1052
+ paddingLeft: (contentSideInsets?.left ?? 0) + (primaryColumn ? 8 : 0),
1053
+ paddingRight: (contentSideInsets?.right ?? 0) + (primaryColumn ? 8 : 0),
1054
paddingBottom:
1055
Platform.OS === "ios"
1056
? iosBottomClearance
apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
+23
-6
@@ -66,6 +66,8 @@ import {
66
NativeWorkspaceInspectorContext,
67
} from "../../native/v5-workspace-context";
68
69
+import { useNativeLayoutMetrics } from "../../native/native-layout-metrics";
70
+
71
interface AdaptiveWorkspaceContextValue {
72
readonly layout: Layout;
73
readonly panes: WorkspacePaneLayout;
@@ -239,7 +241,9 @@ function AdaptiveWorkspaceLayoutContent(
241
) {
242
const projectGroupingMode = props.projectGroupingMode;
243
const nativeWorkspace = use(NativeWorkspaceModeContext);
242
- const { width, height } = useWindowDimensions();
244
+ const windowDimensions = useWindowDimensions();
245
+ const nativeMetrics = useNativeLayoutMetrics();
246
+ const { width, height } = nativeMetrics ?? windowDimensions;
247
const pathname = props.pathname;
248
const navigation = useNavigation();
249
const activeRoleOwner = useRef<symbol | null>(null);
@@ -256,7 +260,10 @@ function AdaptiveWorkspaceLayoutContent(
260
const [primarySidebarSearchQuery, setPrimarySidebarSearchQuery] = useState("");
261
const [focusedAuxiliaryPaneRole, setFocusedAuxiliaryPaneRole] =
262
useState<WorkspaceAuxiliaryPaneRole | null>(null);
259
- const baseLayout = useMemo(() => deriveLayout({ width, height }), [height, width]);
263
+ const baseLayout = useMemo(
264
+ () => deriveLayout({ width, height, nativeMetrics }),
265
+ [height, width, nativeMetrics],
266
+ );
267
const layout = baseLayout;
268
// In split layouts the sidebar IS the thread list — it renders on every
269
// route, including Home (which shows an empty-detail pane instead of the
@@ -269,7 +276,9 @@ function AdaptiveWorkspaceLayoutContent(
276
viewportWidth: width,
277
preferredWidth: fileInspectorPreferredWidth ?? undefined,
278
reservedLeadingWidth:
272
- shouldRenderPrimarySidebar && showPrimarySidebar ? (layout.listPaneWidth ?? 0) : 0,
279
+ shouldRenderPrimarySidebar && showPrimarySidebar
280
+ ? (layout.listPaneWidth ?? 0) + (layout.listPaneGap ?? 0)
281
+ : 0,
282
}),
283
[fileInspectorPreferredWidth, layout, showPrimarySidebar, shouldRenderPrimarySidebar, width],
284
);
@@ -470,13 +479,21 @@ function AdaptiveWorkspaceLayoutContent(
479
);
480
481
const renderedSidebarWidth = useSharedValue(
473
- panes.primarySidebarVisible ? (layout.listPaneWidth ?? 0) : 0,
482
+ panes.primarySidebarVisible ? (layout.listPaneWidth ?? 0) + (layout.listPaneGap ?? 0) : 0,
483
);
484
useEffect(() => {
485
if (nativeWorkspace) return;
477
- const targetWidth = panes.primarySidebarVisible ? (layout.listPaneWidth ?? 0) : 0;
486
+ const targetWidth = panes.primarySidebarVisible
487
+ ? (layout.listPaneWidth ?? 0) + (layout.listPaneGap ?? 0)
488
+ : 0;
489
renderedSidebarWidth.value = withTiming(targetWidth, WORKSPACE_PANE_TIMING);
479
- }, [nativeWorkspace, layout.listPaneWidth, panes.primarySidebarVisible, renderedSidebarWidth]);
490
+ }, [
491
+ nativeWorkspace,
492
+ layout.listPaneWidth,
493
+ layout.listPaneGap,
494
+ panes.primarySidebarVisible,
495
+ renderedSidebarWidth,
496
+ ]);
497
const sidebarAnimatedStyle = useAnimatedStyle(() => ({
498
opacity: Math.min(1, renderedSidebarWidth.value / 80),
499
width: renderedSidebarWidth.value,
apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
+59
-9
@@ -20,7 +20,7 @@ import {
20
type NativeStackTypeBag,
21
} from "@react-navigation/native-stack";
22
import { use, useCallback, useEffect, useMemo, useRef, type ComponentProps } from "react";
23
-import { View } from "react-native";
23
+import { Platform, View } from "react-native";
24
import { Split, type SplitHostCommands } from "react-native-screens";
25
import { EnvironmentId, ThreadId } from "@t3tools/contracts";
26
import { scopedThreadKey } from "../../lib/scopedEntities";
@@ -33,8 +33,13 @@ import {
33
V5CardStackView,
34
V5StackView,
35
} from "../../native/createV5StackNavigator.ios";
36
-import { NATIVE_WORKSPACE_COLUMNS_SUPPORTED } from "../../native/NativeWorkspaceColumns";
36
+import {
37
+ useNativeWorkspaceColumnsReady,
38
+ useNativeWorkspaceColumnsSupported,
39
+} from "../../native/NativeWorkspaceColumns";
40
import { V5StackHeader } from "../../native/V5StackHeader.ios";
41
+import type { AppNativeStackNavigationOptions } from "../../native/StackHeader";
42
+import { dispatchHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";
43
import {
44
nativeWorkspacePopAction,
45
projectWorkspaceStack,
@@ -89,7 +94,12 @@ function ColumnScreen(props: {
94
canGoBack={!props.primary}
95
primary={props.primary}
96
/>
92
- <ColumnContent primary={props.primary}>
97
+ <ColumnContent
98
+ primary={props.primary}
99
+ insetHorizontally={
100
+ (descriptor.options as AppNativeStackNavigationOptions).nativeContentInsetHorizontally
101
+ }
102
+ >
103
<NativePrimaryColumnContext value={primaryColumn}>
104
{descriptor.render()}
105
</NativePrimaryColumnContext>
@@ -107,6 +117,8 @@ function WorkspaceColumns(
117
const inspector = use(NativeWorkspaceInspectorContext);
118
const hostRef = useRef<SplitHostCommands>(null);
119
const activeDetailKey = props.detail.at(-1)?.key;
120
+ const compactColumn = activeDetailKey ? "secondary" : "primary";
121
+ const shownCompactColumn = useRef(compactColumn);
122
const threadParams = props.detail.findLast((route) => route.name === "Thread")?.params;
123
const selectedThreadKey =
124
threadParams &&
@@ -131,9 +143,12 @@ function WorkspaceColumns(
143
useEffect(() => {
144
// In compact size classes UIKit exposes one column. Selecting a thread
145
// changes the visible column without rebuilding either navigation stack.
134
- if (layout.usesSplitView) return;
135
- hostRef.current?.show(activeDetailKey ? "secondary" : "primary");
136
- }, [activeDetailKey, layout.usesSplitView]);
146
+ // The initial column is a native prop, so it is applied before the host
147
+ // attaches. Commands only handle later navigation changes.
148
+ if (layout.usesSplitView || shownCompactColumn.current === compactColumn) return;
149
+ shownCompactColumn.current = compactColumn;
150
+ hostRef.current?.show(compactColumn);
151
+ }, [compactColumn, layout.usesSplitView]);
152
153
const primary = props.descriptors[props.primary.key];
154
if (!primary) return null;
@@ -142,6 +157,7 @@ function WorkspaceColumns(
157
ref={hostRef}
158
testID="adaptive-workspace-layout"
159
preferredSplitBehavior="tile"
160
+ topColumnForCollapsing={compactColumn}
161
preferredDisplayMode={
162
panes.primarySidebarVisible || !activeDetailKey ? "oneBesideSecondary" : "secondaryOnly"
163
}
@@ -153,7 +169,7 @@ function WorkspaceColumns(
169
}}
170
columnMetrics={{
171
minimumPrimaryColumnWidth: 280,
156
- maximumPrimaryColumnWidth: 380,
172
+ maximumPrimaryColumnWidth: Math.max(380, layout.listPaneWidth ?? 0),
173
preferredPrimaryColumnWidthOrFraction: layout.listPaneWidth ?? 320,
174
minimumSecondaryColumnWidth: 320,
175
}}
@@ -179,6 +195,37 @@ function WorkspaceColumns(
195
options={{
196
headerShown: true,
197
title: "",
198
+ unstable_headerRightItems: () =>
199
+ Platform.OS === "ios" && !Platform.isPad && layout.usesSplitView
200
+ ? [
201
+ ...(!panes.primarySidebarVisible
202
+ ? [
203
+ {
204
+ type: "button" as const,
205
+ axisBehavior: "verticalPreferred" as const,
206
+ accessibilityLabel: "Search threads",
207
+ label: "Search threads",
208
+ icon: {
209
+ type: "sfSymbol" as const,
210
+ name: "magnifyingglass" as const,
211
+ },
212
+ onPress: () => {
213
+ dispatchHardwareKeyboardCommand("focusSearch");
214
+ },
215
+ },
216
+ ]
217
+ : []),
218
+ {
219
+ type: "button",
220
+ axisBehavior: "verticalPreferred",
221
+ accessibilityLabel: "New task",
222
+ label: "New task",
223
+ icon: { type: "sfSymbol", name: "square.and.pencil" },
224
+ onPress: () =>
225
+ props.navigation.navigate("NewTaskSheet", { screen: "NewTask" }),
226
+ },
227
+ ]
228
+ : [],
229
unstable_headerLeftItems: () => [
230
{
231
type: "button",
@@ -293,6 +340,8 @@ function WorkspaceStackNavigator({
340
UNSTABLE_router,
341
...rest
342
}: NativeStackNavigatorProps) {
343
+ const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
344
+ const nativeWorkspaceColumnsReady = useNativeWorkspaceColumnsReady();
345
const { state, describe, descriptors, navigation, NavigationContent } = useNavigationBuilder<
346
StackNavigationState<ParamListBase>,
347
StackRouterOptions,
@@ -310,9 +359,10 @@ function WorkspaceStackNavigator({
359
screenLayout,
360
UNSTABLE_router,
361
});
313
- const WorkspaceView = NATIVE_WORKSPACE_COLUMNS_SUPPORTED ? WorkspaceStackView : V5StackView;
362
+ if (!nativeWorkspaceColumnsReady) return null;
363
+ const WorkspaceView = usesNativeWorkspaceColumns ? WorkspaceStackView : V5StackView;
364
return (
315
- <NativeWorkspaceModeContext value={NATIVE_WORKSPACE_COLUMNS_SUPPORTED}>
365
+ <NativeWorkspaceModeContext value={usesNativeWorkspaceColumns}>
366
<NavigationContent>
367
<WorkspaceView
368
{...rest}
apps/mobile/src/features/layout/native-glass-header-items.ts
+1
@@ -4,6 +4,7 @@ type NativeGlassHeaderItem = {
4
readonly hidesSharedBackground?: boolean;
5
readonly sharesBackground?: boolean;
6
readonly variant?: "plain" | "done" | "prominent";
7
+ readonly axisBehavior?: "automatic" | "horizontalOnly" | "verticalPreferred";
8
readonly width?: number;
9
};
10
apps/mobile/src/features/settings/SettingsOpenSourceLicensesRouteScreen.tsx
+2
-2
@@ -19,8 +19,8 @@ import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/Stac
19
import {
20
createNativeMailSearchToolbarItem,
21
NATIVE_MAIL_SEARCH_TOOLBAR_CONTENT_INSET,
22
- NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED,
22
} from "../layout/native-mail-search-toolbar";
23
+import { useNativeMailSearchToolbar } from "../../native/use-native-mail-search-toolbar";
24
25
import { getMobileThirdPartyLicenses } from "./mobileThirdPartyLicenses";
26
@@ -72,7 +72,7 @@ export function SettingsOpenSourceLicensesRouteScreen() {
72
const navigation = useNavigation();
73
const insets = useSafeAreaInsets();
74
const [query, setQuery] = useState("");
75
- const usesNativeMailSearchToolbar = Platform.OS === "ios" && NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED;
75
+ const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
76
const manifest = useMobileThirdPartyLicenses();
77
const entries = manifest?.entries ?? [];
78
const filteredEntries = useMemo(
apps/mobile/src/features/settings/components/SettingsEnvironmentFilterHeader.tsx
+2
@@ -54,6 +54,7 @@ export function SettingsEnvironmentFilterHeader(props: {
54
options={{
55
unstable_headerRightItems: () => [
56
withNativeGlassHeaderItem({
57
+ axisBehavior: "horizontalOnly",
58
accessibilityLabel: "Filter settings environments and projects",
59
icon: { name: filterIcon, type: "sfSymbol" },
60
label: "",
@@ -120,6 +121,7 @@ export function SettingsEnvironmentFilterHeader(props: {
121
...(closeSettings
122
? [
123
withNativeGlassHeaderItem({
124
+ axisBehavior: "horizontalOnly",
125
accessibilityLabel: "Close settings",
126
icon: { name: "xmark", type: "sfSymbol" },
127
identifier: "settings-close",
apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx
+2
-2
@@ -37,8 +37,8 @@ import { vcsEnvironment } from "../../state/vcs";
37
import {
38
createNativeMailSearchToolbarItem,
39
NATIVE_MAIL_SEARCH_TOOLBAR_CONTENT_INSET,
40
- NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED,
40
} from "../layout/native-mail-search-toolbar";
41
+import { useNativeMailSearchToolbar } from "../../native/use-native-mail-search-toolbar";
42
import { branchBadgeLabel, useNewTaskFlow } from "./new-task-flow-provider";
43
import { checkoutNewTaskBranch } from "./checkout-new-task-branch";
44
@@ -413,7 +413,7 @@ export function BranchPickerScreen(props: {
413
}) {
414
const navigation = useNavigation();
415
const insets = useSafeAreaInsets();
416
- const usesNativeMailSearchToolbar = Platform.OS === "ios" && NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED;
416
+ const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
417
const selectedBranchName =
418
props.selectedBranchName ??
419
props.branches.find((branch) => branch.current)?.name ??
apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+29
-4
@@ -14,6 +14,8 @@ import { useKeyboardChatComposerInset, useKeyboardScrollToEnd } from "@legendapp
14
import { resolveProviderSkillsForCwd } from "@t3tools/client-runtime/providerSkills";
15
import type { LegendListRef } from "@legendapp/list/react-native";
16
import { HeaderHeightContext } from "@react-navigation/elements";
17
+import { NativeLayoutObserver } from "../../native/NativeLayoutObserver";
18
+import { deriveBottomControlInsets, type NativeLayoutMetrics } from "../../lib/reserved-regions";
19
import type {
20
EnvironmentId,
21
MessageId,
@@ -84,6 +86,8 @@ import Animated, {
86
} from "react-native-reanimated";
87
import { useSafeAreaInsets } from "react-native-safe-area-context";
88
import { useWorkspaceContentWidth } from "../layout/workspace-content-width";
89
+import { useNativeWorkspaceColumnsSupported } from "../../native/NativeWorkspaceColumns";
90
+import { useNativeColumnLayoutMetrics } from "../../native/native-layout-metrics";
91
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
92
import { collectProviderUsageLimits } from "@t3tools/shared/usageLimits";
93
import type { ComposerEditorHandle } from "../../components/ComposerEditor";
@@ -317,6 +321,7 @@ const USER_INPUT_TOGGLE_TIMING = {
321
};
322
323
export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: ThreadDetailScreenProps) {
324
+ const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
325
const navigation = useNavigation();
326
const { session: voiceInputSession } = useGlobalVoiceInput();
327
const reportedModelSelection = useThreadReportedModelSelection({
@@ -388,7 +393,11 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
393
}
394
}, []);
395
const windowHeight = useWindowDimensions().height;
391
- const navigationHeaderHeight = useContext(HeaderHeightContext) || insets.top + 44;
396
+ const navigationHeaderHeight = useContext(HeaderHeightContext) ?? insets.top + 44;
397
+ const [screenMetrics, setScreenMetrics] = useState<NativeLayoutMetrics | null>(null);
398
+ const columnMetrics = useNativeColumnLayoutMetrics();
399
+ const nativeMetrics = usesNativeWorkspaceColumns ? columnMetrics : screenMetrics;
400
+ const controlInsets = deriveBottomControlInsets(nativeMetrics);
401
const agentLabel = `${props.selectedThread.modelSelection.instanceId} agent`;
402
const selectedThreadKey = scopedThreadKey(props.environmentId, props.selectedThread.id);
403
const composerError = useAtomValue(threadComposerErrorsAtom)[selectedThreadKey]?.message ?? null;
@@ -826,8 +835,14 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
835
// Assign both layouts explicitly so the dock always follows its current parent.
836
const composerWidthStyle = useAnimatedStyle(() =>
837
isSplitLayout && workspaceContentWidth !== null
829
- ? { width: workspaceContentWidth.value }
830
- : { width: "100%" },
838
+ ? {
839
+ width: Math.max(
840
+ 0,
841
+ workspaceContentWidth.value - controlInsets.left - controlInsets.right,
842
+ ),
843
+ right: undefined,
844
+ }
845
+ : { width: undefined, right: controlInsets.right },
846
);
847
const selectedInstanceId = props.selectedThread.modelSelection.instanceId;
848
useStreamingHaptics(props.selectedThread.id, props.selectedThreadFeed);
@@ -1083,6 +1098,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
1098
1099
return (
1100
<View className="flex-1">
1101
+ {!usesNativeWorkspaceColumns ? <NativeLayoutObserver onChange={setScreenMetrics} /> : null}
1102
{showContent ? (
1103
<View
1104
style={{ flex: 1 }}
@@ -1140,6 +1156,7 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
1156
}
1157
contentMaxWidth={contentMaxWidth}
1158
historyControls={props.historyControls}
1159
+ contentSideInsets={nativeMetrics?.safeArea}
1160
layoutVariant={layoutVariant}
1161
usesAutomaticContentInsets={props.usesAutomaticContentInsets}
1162
onHeaderMaterialVisibilityChange={props.onHeaderMaterialVisibilityChange}
@@ -1183,7 +1200,15 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
1200
<Animated.View
1201
layout={COMPOSER_LAYOUT_TRANSITION}
1202
pointerEvents="box-none"
1186
- style={[{ position: "absolute", bottom: 0, left: 0 }, composerWidthStyle]}
1203
+ style={[
1204
+ {
1205
+ position: "absolute",
1206
+ bottom: controlInsets.bottom,
1207
+ left: controlInsets.left,
1208
+ right: controlInsets.right,
1209
+ },
1210
+ composerWidthStyle,
1211
+ ]}
1212
>
1213
{/* No paddingTop here: the overlay's measured height becomes the
1214
list's bottom inset, so any padding above the pill/composer
apps/mobile/src/features/threads/ThreadFeed.tsx
+40
-8
@@ -57,6 +57,7 @@ import { videoMimeType } from "@t3tools/shared/video";
57
import { SymbolView, type AppSymbolName } from "../../components/AppSymbol";
58
import { HeaderHeightContext } from "@react-navigation/elements";
59
import { useFocusEffect, useNavigation } from "@react-navigation/native";
60
+import { useNativeWorkspaceColumnsSupported } from "../../native/NativeWorkspaceColumns";
61
import {
62
createContext,
63
memo,
@@ -297,6 +298,7 @@ export interface ThreadFeedProps {
298
readonly contentBottomInset?: number;
299
readonly historyControls?: ThreadFeedHistoryControls;
300
readonly contentMaxWidth?: number;
301
+ readonly contentSideInsets?: { readonly left: number; readonly right: number };
302
readonly layoutVariant?: LayoutVariant;
303
readonly usesAutomaticContentInsets?: boolean;
304
readonly onHeaderMaterialVisibilityChange?: (visible: boolean) => void;
@@ -1543,6 +1545,7 @@ function renderFeedEntry(
1545
readonly reviewCommentColors: ReviewCommentColors;
1546
readonly reviewCommentBubbleWidth: number;
1547
readonly themeAppearance: "light" | "dark";
1548
+ readonly usesNativeWorkspaceColumns: boolean;
1549
readonly userBubbleMaxWidth: number;
1550
/** Width assistant markdown lays out in, so images can size their frame before layout. */
1551
readonly markdownContentWidth: number;
@@ -1730,11 +1733,19 @@ function renderFeedEntry(
1733
className="min-w-0 gap-2 rounded-[20px] px-3.5 py-2.5"
1734
style={{
1735
backgroundColor: userBubbleColor,
1733
- maxWidth: props.userBubbleMaxWidth,
1736
+ maxWidth:
1737
+ props.usesNativeWorkspaceColumns && Platform.OS === "ios" && !Platform.isPad
1738
+ ? "85%"
1739
+ : props.userBubbleMaxWidth,
1740
...(hasReviewCommentContext
1741
? { width: props.reviewCommentBubbleWidth }
1742
: hasWideBlock
1737
- ? { width: props.userBubbleMaxWidth }
1743
+ ? {
1744
+ width:
1745
+ props.usesNativeWorkspaceColumns && Platform.OS === "ios" && !Platform.isPad
1746
+ ? "85%"
1747
+ : props.userBubbleMaxWidth,
1748
+ }
1749
: null),
1750
}}
1751
>
@@ -2174,6 +2185,7 @@ function ThreadFeedPlaceholder(props: {
2185
}
2186
2187
export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
2188
+ const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
2189
const navigation = useNavigation();
2190
const { themeAppearance } = useAppearancePreferences();
2191
const copyFeedbackTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
@@ -2257,12 +2269,15 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
2269
setExpandedFile(null);
2270
}, [props.environmentId, props.threadId, props.contentPresentation.kind]);
2271
const horizontalPadding = props.layoutVariant === "split" ? 20 : 16;
2272
+ const contentLeftInset = props.contentSideInsets?.left ?? 0;
2273
+ const contentRightInset = props.contentSideInsets?.right ?? 0;
2274
+ const usableViewportWidth = Math.max(0, viewportWidth - contentLeftInset - contentRightInset);
2275
const contentHorizontalPadding = deriveCenteredContentHorizontalPadding({
2261
- viewportWidth,
2276
+ viewportWidth: usableViewportWidth,
2277
maxContentWidth: props.contentMaxWidth ?? null,
2278
minimumPadding: horizontalPadding,
2279
});
2265
- const contentWidth = Math.max(0, viewportWidth - contentHorizontalPadding * 2);
2280
+ const contentWidth = Math.max(0, usableViewportWidth - contentHorizontalPadding * 2);
2281
const userBubbleMaxWidth = contentWidth * 0.85;
2282
const markdownContentWidth = Math.max(0, contentWidth - ASSISTANT_ROW_HORIZONTAL_PADDING * 2);
2283
const reviewCommentBubbleWidth = Math.min(Math.max(280, contentWidth * 0.85), contentWidth);
@@ -2285,7 +2300,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
2300
// header-providing screen) and fall back to the standard iOS bar height.
2301
const navigationHeaderHeight = useContext(HeaderHeightContext);
2302
const anchorTopInset = usesNativeAutomaticInsets
2288
- ? navigationHeaderHeight || insets.top + IOS_NAV_BAR_HEIGHT
2303
+ ? (navigationHeaderHeight ?? insets.top + IOS_NAV_BAR_HEIGHT)
2304
: topContentInset;
2305
2306
const theme = useUniwindTheme();
@@ -3030,6 +3045,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
3045
reviewCommentColors,
3046
reviewCommentBubbleWidth,
3047
themeAppearance,
3048
+ usesNativeWorkspaceColumns,
3049
userBubbleMaxWidth,
3050
markdownContentWidth,
3051
contentWidth,
@@ -3067,6 +3083,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
3083
reviewCommentColors,
3084
reviewCommentBubbleWidth,
3085
themeAppearance,
3086
+ usesNativeWorkspaceColumns,
3087
userBubbleMaxWidth,
3088
markdownContentWidth,
3089
contentWidth,
@@ -3119,7 +3136,18 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
3136
// (facebook/react-native#54123); the anchored end space after a send
3137
// is pure inset, so without this the blank region can't be scrolled.
3138
applyWorkaroundForContentInsetHitTestBug
3122
- contentInsetAdjustmentBehavior={usesNativeAutomaticInsets ? "automatic" : "never"}
3139
+ // Horizontal Duo reservations are already included in the row padding.
3140
+ // Let UIKit adjust the scrolling axis without shifting content sideways.
3141
+ contentInsetAdjustmentBehavior={
3142
+ usesNativeAutomaticInsets
3143
+ ? usesNativeWorkspaceColumns &&
3144
+ Platform.OS === "ios" &&
3145
+ !Platform.isPad &&
3146
+ props.layoutVariant === "split"
3147
+ ? "scrollableAxes"
3148
+ : "automatic"
3149
+ : "never"
3150
+ }
3151
automaticallyAdjustsScrollIndicatorInsets={usesNativeAutomaticInsets}
3152
{...(usesNativeAutomaticInsets
3153
? {
@@ -3231,7 +3259,8 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
3259
}
3260
contentContainerStyle={{
3261
paddingTop: 12,
3234
- paddingHorizontal: contentHorizontalPadding,
3262
+ paddingLeft: contentHorizontalPadding + contentLeftInset,
3263
+ paddingRight: contentHorizontalPadding + contentRightInset,
3264
}}
3265
/>
3266
</View>
@@ -3239,7 +3268,10 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
3268
!props.worktreeSetup &&
3269
props.activeWorkStartedAt === null &&
3270
props.contentPresentation.kind === "ready" ? (
3242
- <View pointerEvents="none" style={StyleSheet.absoluteFill}>
3271
+ <View
3272
+ pointerEvents="none"
3273
+ style={[StyleSheet.absoluteFill, { left: contentLeftInset, right: contentRightInset }]}
3274
+ >
3275
<ThreadFeedPlaceholder
3276
title="No conversation yet"
3277
detail="Ask the agent to inspect the repo, run a command, or continue the active thread."
apps/mobile/src/features/threads/ThreadSettingsSheet.tsx
+6
-6
@@ -73,8 +73,8 @@ import {
73
import {
74
createNativeMailSearchToolbarItem,
75
NATIVE_MAIL_SEARCH_TOOLBAR_CONTENT_INSET,
76
- NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED,
76
} from "../layout/native-mail-search-toolbar";
77
+import { useNativeMailSearchToolbar } from "../../native/use-native-mail-search-toolbar";
78
import { ModelRow, ChoiceRow } from "./ThreadSettingsRows";
79
import {
80
compatibleRuntimeModeForChoices,
@@ -742,10 +742,10 @@ function ThreadSettingsOptionsItem(props: {
742
.get(session.environmentId)
743
?.providers.find((provider) => provider.instanceId === session.providerInstanceId) ?? null)
744
: null;
745
- const bottomToolbarInset =
746
- Platform.OS === "ios" && NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED
747
- ? NATIVE_MAIL_SEARCH_TOOLBAR_CONTENT_INSET
748
- : 0;
745
+ const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
746
+ const bottomToolbarInset = usesNativeMailSearchToolbar
747
+ ? NATIVE_MAIL_SEARCH_TOOLBAR_CONTENT_INSET
748
+ : 0;
749
750
return (
751
<View style={{ paddingBottom: insets.bottom + bottomToolbarInset + 12 }}>
@@ -1107,7 +1107,7 @@ function ThreadSettingsModelsScreen() {
1107
const session = useThreadSettingsSession();
1108
const presentation = useThreadSettingsPickerPresentation();
1109
const navigation = useNavigation<NativeStackNavigationProp<ThreadSettingsPickerStackParams>>();
1110
- const usesNativeMailSearchToolbar = Platform.OS === "ios" && NATIVE_MAIL_SEARCH_TOOLBAR_SUPPORTED;
1110
+ const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
1111
const hasCustomCatalogFilter = session.providerFilter !== null || session.showLegacy;
1112
const commitAndClose = useCallback(() => {
1113
if (!session.commitPendingModel()) return;
apps/mobile/src/features/threads/git/GitOverviewSheet.tsx
+3
-2
@@ -21,6 +21,7 @@ import { Alert, Platform, Pressable, RefreshControl, ScrollView, View } from "re
21
22
import { Screen, ScreenStack, ScreenStackHeaderConfig } from "react-native-screens";
23
import { useSafeAreaInsets } from "react-native-safe-area-context";
24
+import { NativeSheetContent } from "../../../native/NativeSheetContent";
25
import { useUniwindTheme } from "../../../lib/useUniwindTheme";
26
import {
27
AndroidHeaderIconButton,
@@ -411,7 +412,7 @@ function GitOverviewSheetContent(props: GitOverviewSheetProps) {
412
scrollEdgeEffects={HEADER_SCROLL_EDGE_EFFECTS}
413
style={{ backgroundColor: sheetColor, flex: 1 }}
414
>
414
- {content}
415
+ <NativeSheetContent>{content}</NativeSheetContent>
416
<ScreenStackHeaderConfig
417
backgroundColor="rgba(0,0,0,0)"
418
color={foregroundColor}
@@ -447,7 +448,7 @@ function GitOverviewSheetContent(props: GitOverviewSheetProps) {
448
scrollEdgeEffects={HEADER_SCROLL_EDGE_EFFECTS}
449
style={{ backgroundColor: sheetColor, flex: 1 }}
450
>
450
- {content}
451
+ <NativeSheetContent>{content}</NativeSheetContent>
452
<ScreenStackHeaderConfig
453
backgroundColor="rgba(0,0,0,0)"
454
color={foregroundColor}
apps/mobile/src/features/threads/sidebar-native-header-items.ts
+5
-2
@@ -34,7 +34,8 @@ function toNativeHeaderMenuItems(items: HomeListFilterMenu["items"]): NativeHead
34
/**
35
* Right-side UINavigationBar items for the sidebar column: the thread list
36
* filter/sort menu plus the settings button, sharing one glass capsule —
37
- * the Messages-style grouped header buttons.
37
+ * the Messages-style grouped header buttons. The embedded sidebar keeps these
38
+ * beside its title; only the detail column uses the Duo's vertical bar.
39
*/
40
export function createSidebarHeaderItems(input: {
41
readonly filterIcon: string;
@@ -44,6 +45,7 @@ export function createSidebarHeaderItems(input: {
45
return [
46
withNativeGlassHeaderItem({
47
type: "menu",
48
+ axisBehavior: "horizontalOnly",
49
label: "",
50
accessibilityLabel: "Filter threads",
51
icon: sfSymbolIcon(input.filterIcon),
@@ -54,7 +56,8 @@ export function createSidebarHeaderItems(input: {
56
}),
57
withNativeGlassHeaderItem({
58
type: "button",
57
- label: "",
59
+ axisBehavior: "horizontalOnly",
60
+ label: "Settings",
61
accessibilityLabel: "Open settings",
62
icon: sfSymbolIcon("gearshape"),
63
onPress: input.onOpenSettings,
apps/mobile/src/features/threads/useThreadHeaderOptions.tsx
+83
-16
@@ -1,8 +1,11 @@
1
import { StackActions, useNavigation } from "@react-navigation/native";
2
import { useMemo } from "react";
3
+import { Platform } from "react-native";
4
import type { AppNativeStackNavigationOptions } from "../../native/StackHeader";
5
+import { useNativeWorkspaceColumnsSupported } from "../../native/NativeWorkspaceColumns";
6
import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
7
import { withNativeGlassHeaderItem } from "../layout/native-glass-header-items";
8
+import { dispatchHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";
9
import {
10
ThreadGitControls,
11
useThreadGitCenterHeaderItems,
@@ -19,18 +22,24 @@ export function useThreadHeaderOptions(props: {
22
readonly gitControls: Parameters<typeof ThreadGitControls>[0];
23
readonly onReturnToThread?: () => void;
24
}) {
25
+ const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
26
+ const usesDuoHeader = usesNativeWorkspaceColumns && Platform.OS === "ios" && !Platform.isPad;
27
const navigation = useNavigation();
28
const { layout, panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();
29
const threadCenterHeaderItems = useThreadGitCenterHeaderItems(props.gitControls);
30
const compactRightHeaderItems = useThreadGitRightHeaderItems(props.gitControls);
31
const splitLeftHeaderItems = useMemo<NativeHeaderItems>(
32
() => [
28
- {
29
- // Match Mail's split-view detail toolbar: the first detail action sits
30
- // inside the content pane, not flush against the sidebar divider.
31
- spacing: 18,
32
- type: "spacing" as const,
33
- },
33
+ ...(!usesDuoHeader
34
+ ? [
35
+ {
36
+ // Match Mail's split-view detail toolbar: the first detail action sits
37
+ // inside the content pane, not flush against the sidebar divider.
38
+ spacing: 18,
39
+ type: "spacing" as const,
40
+ },
41
+ ]
42
+ : []),
43
...(props.onReturnToThread
44
? [
45
withNativeGlassHeaderItem({
@@ -43,6 +52,7 @@ export function useThreadHeaderOptions(props: {
52
]
53
: []),
54
withNativeGlassHeaderItem({
55
+ axisBehavior: usesNativeWorkspaceColumns ? "horizontalOnly" : undefined,
56
accessibilityLabel: panes.primarySidebarVisible
57
? "Maximize content"
58
: "Show thread sidebar",
@@ -51,18 +61,31 @@ export function useThreadHeaderOptions(props: {
61
type: "sfSymbol" as const,
62
},
63
identifier: "thread-left-sidebar",
64
+ label: panes.primarySidebarVisible ? "Maximize content" : "Show thread sidebar",
65
onPress: togglePrimarySidebar,
66
type: "button" as const,
67
}),
57
- withNativeGlassHeaderItem({
58
- accessibilityLabel: "New task",
59
- icon: { name: "square.and.pencil", type: "sfSymbol" as const },
60
- identifier: "thread-left-new-task",
61
- onPress: () => navigation.navigate("NewTaskSheet", { screen: "NewTask" }),
62
- type: "button" as const,
63
- }),
68
+ ...(!usesDuoHeader
69
+ ? [
70
+ withNativeGlassHeaderItem({
71
+ accessibilityLabel: "New task",
72
+ icon: { name: "square.and.pencil", type: "sfSymbol" as const },
73
+ identifier: "thread-left-new-task",
74
+ label: "New task",
75
+ onPress: () => navigation.navigate("NewTaskSheet", { screen: "NewTask" }),
76
+ type: "button" as const,
77
+ }),
78
+ ]
79
+ : []),
80
+ ],
81
+ [
82
+ panes.primarySidebarVisible,
83
+ props.onReturnToThread,
84
+ navigation,
85
+ togglePrimarySidebar,
86
+ usesDuoHeader,
87
+ usesNativeWorkspaceColumns,
88
],
65
- [panes.primarySidebarVisible, props.onReturnToThread, navigation, togglePrimarySidebar],
89
);
90
// Deep links / cold starts land with Thread as the ONLY route, where the
91
// native back button does not render. Provide an explicit Home escape for
@@ -81,6 +104,41 @@ export function useThreadHeaderOptions(props: {
104
[navigation],
105
);
106
107
+ const duoRightHeaderItems = useMemo<NativeHeaderItems>(
108
+ () => [
109
+ ...threadCenterHeaderItems,
110
+ { type: "spacing", spacing: 8 },
111
+ ...(layout.usesSplitView &&
112
+ Platform.OS === "ios" &&
113
+ !Platform.isPad &&
114
+ !panes.primarySidebarVisible
115
+ ? [
116
+ withNativeGlassHeaderItem({
117
+ type: "button" as const,
118
+ axisBehavior: "verticalPreferred",
119
+ identifier: "thread-right-search",
120
+ label: "Search threads",
121
+ accessibilityLabel: "Search threads",
122
+ icon: { name: "magnifyingglass", type: "sfSymbol" as const },
123
+ onPress: () => {
124
+ dispatchHardwareKeyboardCommand("focusSearch");
125
+ },
126
+ }),
127
+ ]
128
+ : []),
129
+ withNativeGlassHeaderItem({
130
+ type: "button" as const,
131
+ axisBehavior: "verticalPreferred",
132
+ identifier: "thread-right-new-task",
133
+ label: "New task",
134
+ accessibilityLabel: "New task",
135
+ icon: { name: "square.and.pencil", type: "sfSymbol" as const },
136
+ onPress: () => navigation.navigate("NewTaskSheet", { screen: "NewTask" }),
137
+ }),
138
+ ],
139
+ [navigation, threadCenterHeaderItems, layout.usesSplitView, panes.primarySidebarVisible],
140
+ );
141
+
142
const options: AppNativeStackNavigationOptions = {
143
headerShown: true,
144
headerTitle: props.title,
@@ -104,7 +162,12 @@ export function useThreadHeaderOptions(props: {
162
// the git controls on the RIGHT (no center items — center space is
163
// reserved for future breadcrumbs/status).
164
unstable_headerRightItems: () =>
107
- layout.usesSplitView ? threadCenterHeaderItems : compactRightHeaderItems,
165
+ usesDuoHeader
166
+ ? duoRightHeaderItems
167
+ : layout.usesSplitView
168
+ ? threadCenterHeaderItems
169
+ : compactRightHeaderItems,
170
+ unstable_headerToolbarItems: () => [],
171
unstable_headerSubtitle: props.usesNativeHeaderGlass ? props.subtitle : undefined,
172
contentStyle: undefined,
173
};
@@ -116,7 +179,11 @@ export function useThreadHeaderOptions(props: {
179
// callbacks also read state the items do not display (a "Push" item runs `push` or
180
// `commit_push` depending on the default ref), so that state is keyed too.
181
optionsVersion: [
119
- layout.usesSplitView ? threadCenterHeaderItems : compactRightHeaderItems,
182
+ splitLeftHeaderItems,
183
+ threadCenterHeaderItems,
184
+ compactRightHeaderItems,
185
+ duoRightHeaderItems,
186
+ usesDuoHeader,
187
environmentId,
188
threadId,
189
gitStatus?.isDefaultRef,
apps/mobile/src/lib/layout.ts
+37
-10
@@ -1,5 +1,6 @@
1
import { scaledTypographyLineHeight } from "./appearancePreferences";
2
import { MOBILE_TYPOGRAPHY } from "./typography";
3
+import type { NativeLayoutMetrics } from "./reserved-regions";
4
5
function clamp(value: number, min: number, max: number): number {
6
return Math.min(Math.max(value, min), max);
@@ -56,6 +57,7 @@ export interface Layout {
57
readonly variant: LayoutVariant;
58
readonly usesSplitView: boolean;
59
readonly listPaneWidth: number | null;
60
+ readonly listPaneGap?: number;
61
readonly shellPadding: number;
62
}
63
@@ -87,9 +89,25 @@ export function deriveThreadFeedInitialContentInset(input: {
89
90
export type WorkspaceAuxiliaryPaneRole = "supplementary" | "inspector";
91
90
-export function deriveLayout(input: { readonly width: number; readonly height: number }): Layout {
92
+export function deriveLayout(input: {
93
+ readonly width: number;
94
+ readonly height: number;
95
+ readonly nativeMetrics?: NativeLayoutMetrics | null;
96
+}): Layout {
97
const { width, height } = input;
92
- const wideEnoughForSplit = width >= SPLIT_LAYOUT_MIN_WIDTH && height >= SPLIT_LAYOUT_MIN_HEIGHT;
98
+ const metrics = input.nativeMetrics;
99
+ const usableWidth = width - (metrics?.safeArea.left ?? 0) - (metrics?.safeArea.right ?? 0);
100
+ // UIKit's size class supports the shorter Duo inner display. Geometry remains
101
+ // a floor so a narrow multitasking window cannot squeeze both columns.
102
+ const hasDuoGeometry =
103
+ metrics &&
104
+ (metrics.verticalBarEdge !== "none" ||
105
+ metrics.reservedRegions.some((region) => region.kind === "division"));
106
+ const wideEnoughForSplit = hasDuoGeometry
107
+ ? metrics.horizontalSizeClass === "regular" &&
108
+ usableWidth >= SPLIT_SIDEBAR_MIN_WIDTH + 320 &&
109
+ height >= 400
110
+ : width >= SPLIT_LAYOUT_MIN_WIDTH && height >= SPLIT_LAYOUT_MIN_HEIGHT;
111
112
if (!wideEnoughForSplit) {
113
return {
@@ -100,14 +118,20 @@ export function deriveLayout(input: { readonly width: number; readonly height: n
118
};
119
}
120
121
+ const division = metrics?.reservedRegions.find(
122
+ (region) =>
123
+ region.kind === "division" &&
124
+ region.height >= height / 2 &&
125
+ region.x - metrics.safeArea.left >= SPLIT_SIDEBAR_MIN_WIDTH &&
126
+ width - region.x - region.width - metrics.safeArea.right >= 320,
127
+ );
128
return {
129
variant: "split",
130
usesSplitView: true,
106
- listPaneWidth: clamp(
107
- Math.round(width * 0.32),
108
- SPLIT_SIDEBAR_MIN_WIDTH,
109
- SPLIT_SIDEBAR_DEFAULT_MAX_WIDTH,
110
- ),
131
+ listPaneWidth:
132
+ division?.x ??
133
+ clamp(Math.round(width * 0.32), SPLIT_SIDEBAR_MIN_WIDTH, SPLIT_SIDEBAR_DEFAULT_MAX_WIDTH),
134
+ ...(division ? { listPaneGap: division.width } : {}),
135
shellPadding: 0,
136
};
137
}
@@ -125,7 +149,7 @@ export function deriveWorkspacePaneLayout(input: {
149
const preferredPrimarySidebarVisible =
150
input.layout.usesSplitView && input.primarySidebarPreferredVisible;
151
const preferredPrimarySidebarWidth = preferredPrimarySidebarVisible
128
- ? (input.layout.listPaneWidth ?? 0)
152
+ ? (input.layout.listPaneWidth ?? 0) + (input.layout.listPaneGap ?? 0)
153
: 0;
154
155
if (auxiliaryPaneRole === "inspector") {
@@ -141,11 +165,14 @@ export function deriveWorkspacePaneLayout(input: {
165
auxiliaryPaneVisible &&
166
fileInspector.width !== null &&
167
input.layout.listPaneWidth !== null &&
144
- viewportWidth - input.layout.listPaneWidth - fileInspector.width <
168
+ viewportWidth -
169
+ input.layout.listPaneWidth -
170
+ (input.layout.listPaneGap ?? 0) -
171
+ fileInspector.width <
172
FILE_INSPECTOR_MIN_MAIN_WIDTH;
173
const primarySidebarVisible =
174
preferredPrimarySidebarVisible && !primarySidebarSuppressedByAuxiliary;
148
- const primarySidebarWidth = primarySidebarVisible ? (input.layout.listPaneWidth ?? 0) : 0;
175
+ const primarySidebarWidth = primarySidebarVisible ? preferredPrimarySidebarWidth : 0;
176
177
return {
178
primarySidebarVisible,
apps/mobile/src/lib/reserved-regions.test.ts
new
+140
@@ -0,0 +1,140 @@
1
+import { describe, expect, it } from "vite-plus/test";
2
+import { deriveBottomControlInsets, type NativeLayoutMetrics } from "./reserved-regions";
3
+import { deriveLayout, deriveWorkspacePaneLayout } from "./layout";
4
+
5
+const innerDisplay: NativeLayoutMetrics = {
6
+ width: 960,
7
+ height: 560,
8
+ horizontalSizeClass: "regular",
9
+ verticalBarEdge: "right",
10
+ safeArea: { top: 0, bottom: 20, left: 8, right: 72 },
11
+ reservedRegions: [],
12
+};
13
+
14
+describe("bottom controls around reserved regions", () => {
15
+ it("respects asymmetric side controls without reserving the bottom twice", () => {
16
+ expect(deriveBottomControlInsets(innerDisplay)).toEqual({ left: 8, right: 72, bottom: 0 });
17
+ });
18
+
19
+ it("leaves ordinary non-native clients unchanged", () => {
20
+ expect(deriveBottomControlInsets(null)).toEqual({ left: 0, right: 0, bottom: 0 });
21
+ });
22
+
23
+ it("keeps the editor entirely on one side of a book fold", () => {
24
+ const insets = deriveBottomControlInsets({
25
+ ...innerDisplay,
26
+ reservedRegions: [{ kind: "division", x: 456, y: 0, width: 48, height: 560 }],
27
+ });
28
+ expect(insets).toEqual({ left: 8, right: 504, bottom: 0 });
29
+ expect(innerDisplay.width - insets.left - insets.right).toBeGreaterThan(320);
30
+ });
31
+
32
+ it("keeps controls below a horizontal fold in a hands-free pose", () => {
33
+ expect(
34
+ deriveBottomControlInsets({
35
+ ...innerDisplay,
36
+ reservedRegions: [{ kind: "division", x: 0, y: 240, width: 960, height: 40 }],
37
+ }),
38
+ ).toEqual({ left: 8, right: 72, bottom: 0 });
39
+ });
40
+
41
+ it("moves a control away from a bottom camera while leaving a top camera alone", () => {
42
+ expect(
43
+ deriveBottomControlInsets({
44
+ ...innerDisplay,
45
+ reservedRegions: [
46
+ { kind: "occlusion", x: 8, y: 0, width: 60, height: 60 },
47
+ { kind: "occlusion", x: 8, y: 510, width: 60, height: 50 },
48
+ ],
49
+ }),
50
+ ).toEqual({ left: 68, right: 72, bottom: 0 });
51
+ });
52
+
53
+ it("restores the full editor width when the device opens flat", () => {
54
+ const folded = {
55
+ ...innerDisplay,
56
+ reservedRegions: [{ kind: "division" as const, x: 456, y: 0, width: 48, height: 560 }],
57
+ };
58
+ expect(deriveBottomControlInsets(folded)).not.toEqual(deriveBottomControlInsets(innerDisplay));
59
+ expect(deriveBottomControlInsets(innerDisplay)).toEqual({ left: 8, right: 72, bottom: 0 });
60
+ });
61
+});
62
+
63
+describe("Duo workspace sizing", () => {
64
+ it("shows both columns on a short regular-width inner display", () => {
65
+ const layout = deriveLayout({ ...innerDisplay, nativeMetrics: innerDisplay });
66
+ expect(layout.usesSplitView).toBe(true);
67
+ expect(
68
+ deriveWorkspacePaneLayout({
69
+ layout,
70
+ viewportWidth: innerDisplay.width,
71
+ primarySidebarPreferredVisible: true,
72
+ auxiliaryPanePreferredVisible: false,
73
+ }).contentPaneWidth,
74
+ ).toBeGreaterThan(320);
75
+ });
76
+
77
+ it("keeps an ordinary phone compact when it rotates", () => {
78
+ expect(deriveLayout({ width: 852, height: 393 }).usesSplitView).toBe(false);
79
+ for (const [width, height] of [
80
+ [932, 430],
81
+ [650, 500],
82
+ ]) {
83
+ const metrics: NativeLayoutMetrics = {
84
+ ...innerDisplay,
85
+ width: width!,
86
+ height: height!,
87
+ verticalBarEdge: "none",
88
+ safeArea: { top: 0, bottom: 20, left: 59, right: 59 },
89
+ };
90
+ expect(deriveLayout({ ...metrics, nativeMetrics: metrics }).usesSplitView).toBe(false);
91
+ const cameraMetrics = {
92
+ ...metrics,
93
+ reservedRegions: [{ kind: "occlusion" as const, x: 0, y: 0, width: 60, height: 60 }],
94
+ };
95
+ expect(deriveLayout({ ...cameraMetrics, nativeMetrics: cameraMetrics }).usesSplitView).toBe(
96
+ false,
97
+ );
98
+ }
99
+ expect(
100
+ deriveLayout({
101
+ width: 960,
102
+ height: 560,
103
+ nativeMetrics: {
104
+ ...innerDisplay,
105
+ horizontalSizeClass: "compact",
106
+ },
107
+ }).usesSplitView,
108
+ ).toBe(false);
109
+ });
110
+
111
+ it("requires enough safe width for both panes in a multitasking window", () => {
112
+ const metrics = { ...innerDisplay, width: 660 };
113
+ expect(deriveLayout({ ...metrics, nativeMetrics: metrics }).usesSplitView).toBe(false);
114
+ });
115
+
116
+ it("aligns the panes to the book fold and accounts for the reserved gap", () => {
117
+ const metrics = {
118
+ ...innerDisplay,
119
+ reservedRegions: [{ kind: "division" as const, x: 456, y: 0, width: 48, height: 560 }],
120
+ };
121
+ const layout = deriveLayout({ ...metrics, nativeMetrics: metrics });
122
+ expect(layout.listPaneWidth).toBe(456);
123
+ expect(layout.listPaneGap).toBe(48);
124
+ const panes = deriveWorkspacePaneLayout({
125
+ layout,
126
+ viewportWidth: 960,
127
+ primarySidebarPreferredVisible: true,
128
+ auxiliaryPanePreferredVisible: false,
129
+ });
130
+ expect(panes.contentPaneWidth).toBe(456);
131
+ expect(
132
+ deriveWorkspacePaneLayout({
133
+ layout,
134
+ viewportWidth: 960,
135
+ primarySidebarPreferredVisible: false,
136
+ auxiliaryPanePreferredVisible: false,
137
+ }).contentPaneWidth,
138
+ ).toBe(960);
139
+ });
140
+});
apps/mobile/src/lib/reserved-regions.ts
+40
-1
@@ -1,12 +1,51 @@
1
-/** Geometry of the body inside a native navigation column. */
1
+export interface ReservedRegion {
2
+ readonly kind: "division" | "occlusion";
3
+ readonly x: number;
4
+ readonly y: number;
5
+ readonly width: number;
6
+ readonly height: number;
7
+}
8
+
9
export interface NativeLayoutMetrics {
10
readonly width: number;
11
readonly height: number;
12
+ readonly hasHinge?: boolean;
13
readonly horizontalSizeClass: "compact" | "regular";
14
+ readonly verticalBarEdge: "none" | "left" | "right";
15
readonly safeArea: {
16
readonly top: number;
17
readonly bottom: number;
18
readonly left: number;
19
readonly right: number;
20
};
21
+ readonly reservedRegions: ReadonlyArray<ReservedRegion>;
22
+}
23
+
24
+/**
25
+ * Keep bottom controls in one usable region. A book-like fold selects the
26
+ * larger side; a horizontal fold leaves the controls on the lower display.
27
+ * Text and other scrollable content can continue to use the full canvas.
28
+ */
29
+export function deriveBottomControlInsets(metrics: NativeLayoutMetrics | null) {
30
+ if (!metrics) return { left: 0, right: 0, bottom: 0 };
31
+ let left = metrics.safeArea.left;
32
+ let right = metrics.width - metrics.safeArea.right;
33
+ let bottom = metrics.height;
34
+ for (const region of metrics.reservedRegions) {
35
+ const x = Math.max(left, region.x);
36
+ const endX = Math.min(right, region.x + region.width);
37
+ const y = Math.max(0, region.y);
38
+ const endY = Math.min(bottom, region.y + region.height);
39
+ if (endX <= x || endY <= y) continue;
40
+ if (region.kind === "division" && region.height >= metrics.height / 2) {
41
+ if (right - endX >= x - left) left = endX;
42
+ else right = x;
43
+ } else if (endY >= bottom - metrics.safeArea.bottom) {
44
+ // An occlusion at the bottom can also occupy just one corner.
45
+ if (region.width >= right - left) bottom = y;
46
+ else if (right - endX >= x - left) left = endX;
47
+ else right = x;
48
+ }
49
+ }
50
+ return { left, right: metrics.width - right, bottom: metrics.height - bottom };
51
}
apps/mobile/src/native/NativeColumnContent.ios.tsx
+5
-1
@@ -9,12 +9,16 @@ import { NativeLayoutObserver } from "./NativeLayoutObserver";
9
export function NativeColumnContent(props: {
10
readonly children: ReactNode;
11
readonly primary?: boolean;
12
+ readonly insetHorizontally?: boolean;
13
}) {
14
const [metrics, setMetrics] = useState<NativeLayoutMetrics | null>(null);
15
return (
16
<View className={props.primary ? "flex-1 bg-drawer" : "flex-1 bg-screen"}>
17
<SafeAreaProvider style={{ flex: 1 }}>
17
- <SafeAreaView edges={["left", "right"]} style={{ flex: 1 }}>
18
+ <SafeAreaView
19
+ edges={props.insetHorizontally === false ? [] : ["left", "right"]}
20
+ style={{ flex: 1 }}
21
+ >
22
{/* Observe the inset body. UIKit can reserve other columns in its safe area. */}
23
<View style={{ flex: 1 }}>
24
<NativeLayoutObserver onChange={setMetrics} />
apps/mobile/src/native/NativeHeaderToolbar.tsx
+25
-7
@@ -14,6 +14,7 @@ import {
14
type ReactNode,
15
} from "react";
16
import type { ColorValue } from "react-native";
17
+import type { HeaderBarButtonSearchBarPlacementItem } from "react-native-screens";
18
19
function useNativeStackNavigation(): NativeStackNavigationProp<ParamListBase> | null {
20
return useNavigation<NativeStackNavigationProp<ParamListBase>>();
@@ -34,8 +35,13 @@ function labelFromChildren(children: ReactNode): string {
35
type NativeStackHeaderIcon = NonNullable<
36
Extract<NativeStackHeaderItem, { type: "button" }>["icon"]
37
>;
38
+type NativeStackHeaderAxisBehavior = Extract<
39
+ NativeStackHeaderItem,
40
+ { type: "button" }
41
+>["axisBehavior"];
42
+type NativeToolbarItem = NativeStackHeaderItem | HeaderBarButtonSearchBarPlacementItem;
43
type NativeStackOptionsWithToolbar = NativeStackNavigationOptions & {
38
- unstable_headerToolbarItems?: () => NativeStackHeaderItem[];
44
+ unstable_headerToolbarItems?: () => NativeToolbarItem[];
45
};
46
47
function iconFromProp(icon: unknown): NativeStackHeaderIcon | undefined {
@@ -112,7 +118,7 @@ function collectMenuItems(children: ReactNode): NativeStackHeaderItemMenu["menu"
118
return items;
119
}
120
115
-function convertToolbarChild(child: ReactNode): NativeStackHeaderItem | null {
121
+function convertToolbarChild(child: ReactNode): NativeToolbarItem | null {
122
if (!isValidElement<ToolbarElementProps>(child)) {
123
return null;
124
}
@@ -121,15 +127,22 @@ function convertToolbarChild(child: ReactNode): NativeStackHeaderItem | null {
127
if (typeName === "NativeHeaderToolbarCustom" && isValidElement(child.props.children)) {
128
return { type: "custom", element: child.props.children };
129
}
130
+ if (typeName === "NativeHeaderToolbarSearchBarSlot") {
131
+ return { type: "searchBarPlacement" };
132
+ }
133
134
if (typeName === "NativeHeaderToolbarButton") {
135
return {
136
type: "button",
128
- label: typeof child.props.label === "string" ? child.props.label : "",
137
+ label:
138
+ typeof child.props.label === "string"
139
+ ? child.props.label
140
+ : String(child.props.accessibilityLabel ?? ""),
141
accessibilityLabel:
142
typeof child.props.accessibilityLabel === "string"
143
? child.props.accessibilityLabel
144
: undefined,
145
+ axisBehavior: child.props.axisBehavior as NativeStackHeaderAxisBehavior,
146
disabled: Boolean(child.props.disabled),
147
icon: iconFromProp(child.props.icon),
148
onPress:
@@ -173,8 +186,8 @@ function convertToolbarChild(child: ReactNode): NativeStackHeaderItem | null {
186
return null;
187
}
188
176
-function collectToolbarItems(children: ReactNode): NativeStackHeaderItem[] {
177
- const items: NativeStackHeaderItem[] = [];
189
+function collectToolbarItems(children: ReactNode): NativeToolbarItem[] {
190
+ const items: NativeToolbarItem[] = [];
191
Children.forEach(children, (child) => {
192
const item = convertToolbarChild(child);
193
if (item) {
@@ -211,13 +224,17 @@ function NativeHeaderToolbarRoot(props: {
224
} as NativeStackOptionsWithToolbar);
225
};
226
}
227
+ // UIKit's search placement item belongs to the toolbar, never a header group.
228
+ const headerItems = items.filter(
229
+ (item): item is NativeStackHeaderItem => item.type !== "searchBarPlacement",
230
+ );
231
if (props.placement === "left") {
215
- navigation.setOptions({ unstable_headerLeftItems: () => items });
232
+ navigation.setOptions({ unstable_headerLeftItems: () => headerItems });
233
return () => {
234
navigation.setOptions({ unstable_headerLeftItems: () => [] });
235
};
236
}
220
- navigation.setOptions({ unstable_headerRightItems: () => items });
237
+ navigation.setOptions({ unstable_headerRightItems: () => headerItems });
238
return () => {
239
navigation.setOptions({ unstable_headerRightItems: () => [] });
240
};
@@ -228,6 +245,7 @@ function NativeHeaderToolbarRoot(props: {
245
246
function NativeHeaderToolbarButton(_props: {
247
readonly accessibilityLabel?: string;
248
+ readonly axisBehavior?: NativeStackHeaderAxisBehavior;
249
readonly disabled?: boolean;
250
readonly icon?: string;
251
readonly label?: string;
apps/mobile/src/native/NativeSheetContent.tsx
new
+19
@@ -0,0 +1,19 @@
1
+import type { ReactNode } from "react";
2
+import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
3
+
4
+import { useNativeWorkspaceColumnsSupported } from "./NativeWorkspaceColumns";
5
+
6
+/** Reserve the sheet's own side bars without moving its native navigation chrome. */
7
+export function NativeSheetContent(props: { readonly children: ReactNode }) {
8
+ const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
9
+ if (!usesNativeWorkspaceColumns) return <>{props.children}</>;
10
+
11
+ // A floating sheet can have different insets from the workspace underneath it.
12
+ return (
13
+ <SafeAreaProvider style={{ flex: 1 }}>
14
+ <SafeAreaView edges={["left", "right"]} style={{ flex: 1 }}>
15
+ {props.children}
16
+ </SafeAreaView>
17
+ </SafeAreaProvider>
18
+ );
19
+}
apps/mobile/src/native/NativeWorkspaceColumns.ios.tsx
+25
-3
@@ -1,7 +1,29 @@
1
import { requireOptionalNativeModule } from "expo";
2
import { Platform } from "react-native";
3
-const nativeControls = requireOptionalNativeModule<{ readonly supportsWorkspaceColumns?: boolean }>(
4
- "T3NativeControls",
5
-);
3
+import { useNativeLayoutMetrics } from "./native-layout-metrics";
4
+
5
+const nativeControls = requireOptionalNativeModule<{
6
+ readonly supportsWorkspaceColumns?: boolean;
7
+ readonly ViewPrototypes?: { readonly T3NativeControls_LayoutMetrics?: unknown };
8
+}>("T3NativeControls");
9
export const NATIVE_WORKSPACE_COLUMNS_SUPPORTED =
10
Platform.OS === "ios" && Platform.isPad && nativeControls?.supportsWorkspaceColumns === true;
11
+
12
+export function useNativeWorkspaceColumnsReady() {
13
+ const metrics = useNativeLayoutMetrics();
14
+ // Choose the phone's native host before attaching any screens. Older clients
15
+ // 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
+ );
21
+}
22
+
23
+export function useNativeWorkspaceColumnsSupported() {
24
+ const metrics = useNativeLayoutMetrics();
25
+ return (
26
+ NATIVE_WORKSPACE_COLUMNS_SUPPORTED ||
27
+ (nativeControls?.supportsWorkspaceColumns === true && metrics?.hasHinge === true)
28
+ );
29
+}
apps/mobile/src/native/NativeWorkspaceColumns.tsx
+8
@@ -1,3 +1,11 @@
1
import { Platform } from "react-native";
2
// Android retains its existing navigator. The iOS file checks native availability.
3
export const NATIVE_WORKSPACE_COLUMNS_SUPPORTED = Platform.OS === "ios" && Platform.isPad;
4
+
5
+export function useNativeWorkspaceColumnsReady() {
6
+ return true;
7
+}
8
+
9
+export function useNativeWorkspaceColumnsSupported() {
10
+ return NATIVE_WORKSPACE_COLUMNS_SUPPORTED;
11
+}
apps/mobile/src/native/StackHeader.tsx
+2
@@ -19,6 +19,8 @@ export type AppNativeStackNavigationOptions = Omit<
19
NativeStackNavigationOptions,
20
"headerTintColor" | "unstable_headerLeftItems" | "unstable_headerRightItems"
21
> & {
22
+ /** Nested navigator leaves apply their own horizontal safe area. */
23
+ readonly nativeContentInsetHorizontally?: boolean;
24
readonly headerTintColor?: string | ColorValue;
25
readonly unstable_headerCenterItems?: unknown;
26
readonly unstable_headerLeftItems?: unknown;
apps/mobile/src/native/V5StackHeader.ios.tsx
+23
-1
@@ -6,6 +6,7 @@ import type {
6
import { isValidElement, useRef } from "react";
7
import { Platform, StyleSheet } from "react-native";
8
import { useMobileNavigationTheme } from "../lib/useMobileNavigationTheme";
9
+import { useNativeLayoutMetrics } from "../native/native-layout-metrics";
10
import {
11
SearchBar,
12
Stack,
@@ -110,6 +111,7 @@ function convertItems(items: NativeStackHeaderItem[], prefix: string): HeaderIte
111
id,
112
identifier: item.identifier,
113
title: item.label || item.accessibilityLabel || undefined,
114
+ axisBehavior: item.axisBehavior,
115
icon: convertIcon(item.icon),
116
menu: item.disabled ? undefined : convertMenu(item.menu, `${id}:menu`),
117
hidesSharedBackground: item.hidesSharedBackground,
@@ -120,6 +122,7 @@ function convertItems(items: NativeStackHeaderItem[], prefix: string): HeaderIte
122
id,
123
identifier: item.identifier,
124
title: item.label || item.accessibilityLabel || undefined,
125
+ axisBehavior: item.axisBehavior,
126
icon: convertIcon(item.icon),
127
onPress: item.disabled ? undefined : item.onPress,
128
hidesSharedBackground: item.hidesSharedBackground,
@@ -136,6 +139,7 @@ export function V5StackHeader(props: {
139
}) {
140
const { options } = props;
141
const theme = useMobileNavigationTheme();
142
+ const nativeMetrics = useNativeLayoutMetrics();
143
const searchRef = useRef<SearchBarCommands>(null);
144
const itemProps = { tintColor: options.headerTintColor, canGoBack: props.canGoBack };
145
const leading = convertItems(options.unstable_headerLeftItems?.(itemProps) ?? [], "leading");
@@ -162,6 +166,7 @@ export function V5StackHeader(props: {
166
bottom.push({
167
type: "item",
168
id: mailSearch.filterButtonId ?? "filter",
169
+ axisBehavior: bottomSearch ? "horizontalOnly" : undefined,
170
icon: {
171
type: "sfSymbol",
172
name: mailSearch.filterSystemImageName ?? "line.3.horizontal.decrease",
@@ -171,7 +176,12 @@ export function V5StackHeader(props: {
176
if (bottomSearch) {
177
if (bottom.length)
178
bottom.push({ type: "spacer", id: "before-search", sizing: "fixed", width: 8 });
174
- bottom.push({ type: "item", id: "home-search", searchBarPlacement: true });
179
+ bottom.push({
180
+ type: "item",
181
+ id: "home-search",
182
+ axisBehavior: "horizontalOnly",
183
+ searchBarPlacement: true,
184
+ });
185
if (mailSearch.onComposePress)
186
bottom.push({ type: "spacer", id: "after-search", sizing: "fixed", width: 8 });
187
}
@@ -179,10 +189,22 @@ export function V5StackHeader(props: {
189
bottom.push({
190
type: "item",
191
id: mailSearch.composeButtonId ?? "compose",
192
+ axisBehavior: bottomSearch ? "horizontalOnly" : undefined,
193
icon: { type: "sfSymbol", name: mailSearch.composeSystemImageName ?? "square.and.pencil" },
194
onPress: mailSearch.onComposePress,
195
});
196
}
197
+ // Expanded Duo panes put toolbar actions in the side bar. Folded phones
198
+ // keep their bottom search toolbar. UIKit keeps the
199
+ // primary column's navigation items beside its title and the detail's in
200
+ // the rail; a conventional UIToolbar can otherwise leave them inaccessible.
201
+ if (
202
+ nativeMetrics?.horizontalSizeClass === "regular" &&
203
+ nativeMetrics.verticalBarEdge !== "none"
204
+ ) {
205
+ trailing.push(...bottom);
206
+ bottom.length = 0;
207
+ }
208
const left = options.headerLeft?.(itemProps);
209
const right = options.headerRight?.(itemProps);
210
if (!options.unstable_headerLeftItems && isValidElement(left))
apps/mobile/src/native/createV5StackNavigator.ios.tsx
+9
-1
@@ -24,6 +24,7 @@ import { useCallback, useRef, useState, type ComponentProps } from "react";
24
import { StyleSheet, View } from "react-native";
25
import { FormSheet, Stack } from "react-native-screens";
26
import { V5StackHeader } from "./V5StackHeader.ios";
27
+import type { AppNativeStackNavigationOptions } from "./StackHeader";
28
import { NativeColumnContent } from "./NativeColumnContent.ios";
29
import {
30
nativeStackPopAction,
@@ -232,7 +233,14 @@ export function V5CardStackView(props: V5StackViewProps) {
233
: index > 0
234
}
235
/>
235
- <NativeColumnContent>{descriptor.render()}</NativeColumnContent>
236
+ <NativeColumnContent
237
+ insetHorizontally={
238
+ (descriptor.options as AppNativeStackNavigationOptions)
239
+ .nativeContentInsetHorizontally
240
+ }
241
+ >
242
+ {descriptor.render()}
243
+ </NativeColumnContent>
244
</NavigationRouteContext>
245
</NavigationContext>
246
</Stack.Screen>
apps/mobile/src/native/use-native-mail-search-toolbar.ts
new
+13
@@ -0,0 +1,13 @@
1
+import { useNativeLayoutMetrics } from "./native-layout-metrics";
2
+import { NATIVE_LIQUID_GLASS_SUPPORTED } from "./native-glass";
3
+
4
+/** Folded phones keep search in the bottom toolbar; expanded Duo panes use the side bar. */
5
+export function useNativeMailSearchToolbar() {
6
+ const metrics = useNativeLayoutMetrics();
7
+ return (
8
+ NATIVE_LIQUID_GLASS_SUPPORTED &&
9
+ (metrics === null ||
10
+ metrics.horizontalSizeClass === "compact" ||
11
+ metrics.verticalBarEdge === "none")
12
+ );
13
+}
docs/operations/mobile-screens-fork.md
+7
-2
@@ -1,7 +1,7 @@
1
# Building the mobile Screens dependency
2
3
The mobile v5 stack uses a committed tarball from the
4
-[T3 Screens fork](https://github.com/juliusmarminge/react-native-screens/tree/t3-v5.0.0-t3.7).
4
+[T3 Screens fork](https://github.com/juliusmarminge/react-native-screens/tree/t3-v5.0.0-t3.8).
5
The fork owns the integration changes; the app does not patch this package.
6
Each archive includes compiled JavaScript, declarations, native source and
7
`t3-fork.json` recording its version, source commit and upstream base.
@@ -9,7 +9,7 @@ Each archive includes compiled JavaScript, declarations, native source and
9
To reproduce the current archive with Node 24 and the repository's pinned Yarn:
10
11
```sh
12
-git clone --branch t3-v5.0.0-t3.7 https://github.com/juliusmarminge/react-native-screens.git /tmp/t3-screens-fork
12
+git clone --branch t3-v5.0.0-t3.8 https://github.com/juliusmarminge/react-native-screens.git /tmp/t3-screens-fork
13
yarn --cwd /tmp/t3-screens-fork pack:t3 /absolute/path/to/t3code/apps/mobile/deps
14
```
15
@@ -20,3 +20,8 @@ Run `pack:t3` from that clean checkout and tag the source as `t3-v<version>`.
20
Replace the old archive, update `apps/mobile/package.json` and run `vp i` to
21
regenerate the lockfile. Verify mobile types and affected navigation tests.
22
Changes to native source also require rebuilding and testing the native client.
23
+
24
+The same iOS binary supports iPhone, iPad, and Duo. UIKit hinge updates enable
25
+phone workspace columns at runtime; regular phones retain portrait rotation.
26
+Use the normal EAS build profiles and update channels. Duo support requires a
27
+binary built with the iOS 27.1 SDK; an OTA cannot add the native APIs.
patches/@react-navigation%2Fnative-stack@7.17.6.patch
+10
-2
@@ -67,7 +67,7 @@ index 9c21aa48cb580704aa17e59d9cdadcc612a1e4ff..a1b3a38368c5ef2257570f382e87df5d
67
}
68
return item;
69
}
70
-+ if (item.type === 'mailSearchToolbar') {
70
++ if (item.type === 'mailSearchToolbar' || item.type === 'searchBarPlacement') {
71
+ return {
72
+ ...item,
73
+ index
@@ -81,7 +81,7 @@ index 9c21aa48cb580704aa17e59d9cdadcc612a1e4ff..a1b3a38368c5ef2257570f382e87df5d
81
return processedItem;
82
}
83
- throw new Error(`Invalid item type: ${JSON.stringify(item)}. Valid types are 'button', 'menu', 'custom' and 'spacing'.`);
84
-+ throw new Error(`Invalid item type: ${JSON.stringify(item)}. Valid types are 'button', 'menu', 'custom', 'spacing' and 'mailSearchToolbar'.`);
84
++ throw new Error(`Invalid item type: ${JSON.stringify(item)}. Valid types are 'button', 'menu', 'custom', 'spacing', 'mailSearchToolbar' and 'searchBarPlacement'.`);
85
}).filter(item => item != null);
86
};
87
const transformIcon = icon => {
@@ -190,6 +190,10 @@ index 2f1351a89f0f2e67e854dc81e392198326b71834..ccf8556911fa1fa17588f06b56edb215
190
/**
191
* A React Element to display as the item.
192
*/
193
+@@ -864,1 +864,3 @@
194
+ sharesBackground?: boolean;
195
++ /** Native bar axis preference on iOS 27.1 and later. */
196
++ axisBehavior?: 'automatic' | 'horizontalOnly' | 'verticalPreferred';
197
diff --git a/src/types.tsx b/src/types.tsx
198
index 7488b1cf20afe36b5c585fbfcd369471fdb6ab8d..f4bd78e48c687024ba84e998fac79e9eb16f1a80 100644
199
--- a/src/types.tsx
@@ -208,6 +212,10 @@ index 7488b1cf20afe36b5c585fbfcd369471fdb6ab8d..f4bd78e48c687024ba84e998fac79e9e
212
/**
213
* A React Element to display as the item.
214
*/
215
+@@ -920,1 +920,3 @@
216
+ sharesBackground?: boolean;
217
++ /** Native bar axis preference on iOS 27.1 and later. */
218
++ axisBehavior?: 'automatic' | 'horizontalOnly' | 'verticalPreferred';
219
diff --git a/src/views/useHeaderConfigProps.tsx b/src/views/useHeaderConfigProps.tsx
220
index 3f3fff405048b3c2250afbe99dd7f35cecb9a6d5..bb062b898cfa77f8c02f951dc9d81b51672d7d0e 100644
221
--- a/src/views/useHeaderConfigProps.tsx
pnpm-lock.yaml
+10
-10
@@ -154,7 +154,7 @@ patchedDependencies:
154
'@pierre/diffs@1.5.2': b33a575eb1382270ed0df956307e4b6ffe4b8e4349cefeb43e14f648c0fdc3b0
155
'@react-native-ai/apple@0.12.0': 2d09870c2848d185cb05b53ed823a46e12dba519324d8dd8e584e28731990f9d
156
'@react-native-menu/menu@2.0.0': a4866ecfcd44f318043de839d20110c17e14909004900f002ffe12050376f2ba
157
- '@react-navigation/native-stack@7.17.6': 3a53ec9b92f5db5f083f3ada585da75d62a13c82250c6ae47d92be91a828ad87
157
+ '@react-navigation/native-stack@7.17.6': d2d52f3776e30765519748fd5e177592dc3b9cc778c52fb00e02674dfa9042c5
158
alchemy@2.0.0-beta.80: bea1b6c0c0b23157fd5f439a1d7feff430f28ac1621ba135d8a13eeec60ccacd
159
dbus-next@0.10.2: cfff57561b0ee59b5addb3b2e6c6f20906e967507a530ab67e8db8108e520ba4
160
effect@4.0.2: ec61ee307eaec3e17f757e0e6a16296ea4b7a8c3188df0c6ec5e66301fd78688
@@ -346,7 +346,7 @@ importers:
346
version: 7.3.4(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
347
'@react-navigation/native-stack':
348
specifier: 7.17.6
349
- version: 7.17.6(patch_hash=3a53ec9b92f5db5f083f3ada585da75d62a13c82250c6ae47d92be91a828ad87)(141a742cd91f55378cde709a48a3af06)
349
+ version: 7.17.6(patch_hash=d2d52f3776e30765519748fd5e177592dc3b9cc778c52fb00e02674dfa9042c5)(cc0272b81e52c9a28f5defc327cee1b5)
350
'@shikijs/core':
351
specifier: 4.2.0
352
version: 4.2.0
@@ -549,8 +549,8 @@ importers:
549
specifier: ~5.9.1
550
version: 5.9.1(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
551
react-native-screens:
552
- specifier: file:deps/react-native-screens-5.0.0-t3.7.tgz
553
- version: file:apps/mobile/deps/react-native-screens-5.0.0-t3.7.tgz(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
552
+ specifier: file:deps/react-native-screens-5.0.0-t3.8.tgz
553
+ version: file:apps/mobile/deps/react-native-screens-5.0.0-t3.8.tgz(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
554
react-native-shiki-engine:
555
specifier: ^0.3.12
556
version: 0.3.12(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
@@ -10798,9 +10798,9 @@ packages:
10798
react: '*'
10799
react-native: '*'
10800
10801
- react-native-screens@file:apps/mobile/deps/react-native-screens-5.0.0-t3.7.tgz:
10802
- resolution: {integrity: sha512-Di1+YTCuhWpk9helKBxkvXAVAQTCSRo24tpFBGXdbTAT4vPm2vGPbtPe+lnIXcePjNHbTEaI1ha5n9PqQKl5lg==, tarball: file:apps/mobile/deps/react-native-screens-5.0.0-t3.7.tgz}
10803
- version: 5.0.0-t3.7
10801
+ react-native-screens@file:apps/mobile/deps/react-native-screens-5.0.0-t3.8.tgz:
10802
+ resolution: {integrity: sha512-sgvyU7L9I1iKfFF5p/oe84duBpA2rJmY/WTgHgKmSI2JGLhWBWQ5qWjo/7WRyZkt36sjOkdNGxwNGhx7dCPzJA==, tarball: file:apps/mobile/deps/react-native-screens-5.0.0-t3.8.tgz}
10803
+ version: 5.0.0-t3.8
10804
peerDependencies:
10805
react: '*'
10806
react-native: '*'
@@ -15971,7 +15971,7 @@ snapshots:
15971
optionalDependencies:
15972
'@react-native-masked-view/masked-view': 0.3.2(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
15973
15974
- '@react-navigation/native-stack@7.17.6(patch_hash=3a53ec9b92f5db5f083f3ada585da75d62a13c82250c6ae47d92be91a828ad87)(141a742cd91f55378cde709a48a3af06)':
15974
+ '@react-navigation/native-stack@7.17.6(patch_hash=d2d52f3776e30765519748fd5e177592dc3b9cc778c52fb00e02674dfa9042c5)(cc0272b81e52c9a28f5defc327cee1b5)':
15975
dependencies:
15976
'@react-navigation/elements': 2.9.26(83de68753219ecf7f3321e065bd378be)
15977
'@react-navigation/native': 7.3.4(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
@@ -15979,7 +15979,7 @@ snapshots:
15979
react: 19.3.0
15980
react-native: 0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6)
15981
react-native-safe-area-context: 5.9.1(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
15982
- react-native-screens: file:apps/mobile/deps/react-native-screens-5.0.0-t3.7.tgz(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
15982
+ react-native-screens: file:apps/mobile/deps/react-native-screens-5.0.0-t3.8.tgz(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
15983
sf-symbols-typescript: 2.2.0
15984
warn-once: 0.1.1
15985
transitivePeerDependencies:
@@ -21967,7 +21967,7 @@ snapshots:
21967
react: 19.3.0
21968
react-native: 0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6)
21969
21970
- react-native-screens@file:apps/mobile/deps/react-native-screens-5.0.0-t3.7.tgz(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0):
21970
+ react-native-screens@file:apps/mobile/deps/react-native-screens-5.0.0-t3.8.tgz(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0):
21971
dependencies:
21972
react: 19.3.0
21973
react-freeze: 1.0.4(react@19.3.0)