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 22, 19:30 UTC
fix(mobile): use native full-width sheets on iPhone Duo (#22980)
Co-authored-by: Pixel Perfect <me@pixp.cc> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 21, 2026 at 17:58 UTC
13eea3f6e19def1a06d128fd6a57aee08b2f910d
13 files changed
+184
-141
apps/mobile/src/Stack.tsx
+49
-42
@@ -149,7 +149,7 @@ import { NATIVE_LIQUID_GLASS_SUPPORTED } from "./native/native-glass";
149
import { deriveLayout } from "./lib/layout";
150
import { useNativeLayoutMetrics } from "./native/native-layout-metrics";
151
import { nativeHeaderScrollEdgeEffects } from "./native/StackHeader";
152
-import { FORM_SHEET_PRESENTATION_OPTIONS } from "./native/sheet-surface";
152
+import { HORIZONTAL_FORM_SHEET_OPTIONS, formSheetDetents } from "./native/sheet-surface";
153
import { useThreadOutboxDrain } from "./state/use-thread-outbox-drain";
154
import { useComposerAttachmentUploadWorker } from "./state/composer-attachment-uploads";
155
@@ -210,6 +210,15 @@ const LEGAL_DOCUMENT_HEADER_OPTIONS: AppScreenOptions = {
210
211
const NESTED_NAVIGATOR_OPTIONS = { nativeContentInsetHorizontally: false, headerShown: false };
212
213
+// Thread settings keep the Duo's vertical bar so cancel, search, filter and confirm sit in the
214
+// rail. The picker stack spans the sheet so its header reaches the rail, and insets its content.
215
+const THREAD_SETTINGS_SHEET_OPTIONS = {
216
+ presentation: "formSheet" as const,
217
+ sheetAllowedDetents: [1],
218
+ sheetGrabberVisible: true,
219
+ nativeContentInsetHorizontally: false,
220
+};
221
+
222
const SettingsContentStack = createV5SheetStackNavigator({
223
initialRouteName: "Settings",
224
screenOptions: {
@@ -368,9 +377,7 @@ const SettingsContentStack = createV5SheetStackNavigator({
377
...(Platform.OS === "android"
378
? { presentation: "card" as const }
379
: {
371
- ...FORM_SHEET_PRESENTATION_OPTIONS,
372
- sheetAllowedDetents: [1],
373
- sheetGrabberVisible: true,
380
+ ...THREAD_SETTINGS_SHEET_OPTIONS,
381
}),
382
},
383
}),
@@ -513,9 +520,7 @@ const NewTaskSheetStack = createNativeStackNavigator({
520
...(Platform.OS === "android"
521
? { presentation: "card" as const }
522
: {
516
- ...FORM_SHEET_PRESENTATION_OPTIONS,
517
- sheetAllowedDetents: [1],
518
- sheetGrabberVisible: true,
523
+ ...THREAD_SETTINGS_SHEET_OPTIONS,
524
}),
525
},
526
}),
@@ -734,8 +739,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
739
screen: PullRequestFilesSheet,
740
options: {
741
...(Platform.OS === "ios" ? SHEET_GLASS_HEADER_OPTIONS : undefined),
737
- ...FORM_SHEET_PRESENTATION_OPTIONS,
738
- sheetAllowedDetents: [0.6, 0.92],
742
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
743
+ sheetAllowedDetents: formSheetDetents(0.6),
744
sheetGrabberVisible: true,
745
sheetCornerRadius: Platform.OS === "android" ? 28 : undefined,
746
},
@@ -744,8 +749,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
749
screen: PullRequestReviewersScreen,
750
options: {
751
...DETAIL_HEADER_OPTIONS,
747
- ...FORM_SHEET_PRESENTATION_OPTIONS,
748
- sheetAllowedDetents: [0.75, 0.92],
752
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
753
+ sheetAllowedDetents: formSheetDetents(0.75),
754
sheetGrabberVisible: true,
755
headerBackVisible: false,
756
},
@@ -759,8 +764,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
764
options: {
765
...(Platform.OS === "android"
766
? { presentation: "fullScreenModal" as const }
762
- : { ...SHEET_GLASS_HEADER_OPTIONS, ...FORM_SHEET_PRESENTATION_OPTIONS }),
763
- sheetAllowedDetents: Platform.OS === "android" ? undefined : [0.75, 0.92],
767
+ : { ...SHEET_GLASS_HEADER_OPTIONS, ...HORIZONTAL_FORM_SHEET_OPTIONS }),
768
+ sheetAllowedDetents: Platform.OS === "android" ? undefined : formSheetDetents(0.75),
769
sheetGrabberVisible: Platform.OS !== "android",
770
},
771
}),
@@ -768,8 +773,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
773
screen: PullRequestReviewSheet,
774
options: {
775
...(Platform.OS === "ios" ? SHEET_GLASS_HEADER_OPTIONS : undefined),
771
- ...FORM_SHEET_PRESENTATION_OPTIONS,
772
- sheetAllowedDetents: [0.75, 0.92],
776
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
777
+ sheetAllowedDetents: formSheetDetents(0.75),
778
sheetGrabberVisible: true,
779
},
780
}),
@@ -816,8 +821,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
821
// formSheet; use a full-screen modal there instead.
822
...(Platform.OS === "android"
823
? { presentation: "fullScreenModal" as const }
819
- : FORM_SHEET_PRESENTATION_OPTIONS),
820
- sheetAllowedDetents: Platform.OS === "android" ? undefined : [0.55, 0.92],
824
+ : HORIZONTAL_FORM_SHEET_OPTIONS),
825
+ sheetAllowedDetents: Platform.OS === "android" ? undefined : formSheetDetents(0.55),
826
sheetGrabberVisible: Platform.OS !== "android",
827
},
828
}),
@@ -856,36 +861,34 @@ const RootStackConfig = createWorkspaceStackNavigator({
861
...(Platform.OS === "android"
862
? { presentation: "card" as const }
863
: {
859
- ...FORM_SHEET_PRESENTATION_OPTIONS,
860
- sheetAllowedDetents: [1],
861
- sheetGrabberVisible: true,
864
+ ...THREAD_SETTINGS_SHEET_OPTIONS,
865
}),
866
},
867
}),
868
ThreadQueue: createNativeStackScreen({
869
screen: ThreadQueueSheet,
870
options: {
868
- ...FORM_SHEET_PRESENTATION_OPTIONS,
871
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
872
headerShown: false,
870
- sheetAllowedDetents: [0.65, 0.95],
873
+ sheetAllowedDetents: formSheetDetents(0.65, 0.95),
874
sheetGrabberVisible: true,
875
},
876
}),
877
ThreadBackgroundWork: createNativeStackScreen({
878
screen: ThreadBackgroundWorkSheet,
879
options: {
877
- ...FORM_SHEET_PRESENTATION_OPTIONS,
880
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
881
headerShown: false,
879
- sheetAllowedDetents: [0.5, 0.9],
882
+ sheetAllowedDetents: formSheetDetents(0.5, 0.9),
883
sheetGrabberVisible: true,
884
},
885
}),
886
ThreadAgents: createNativeStackScreen({
887
screen: ThreadAgentsSheet,
888
options: {
886
- ...FORM_SHEET_PRESENTATION_OPTIONS,
889
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
890
headerShown: false,
888
- sheetAllowedDetents: [0.5, 0.9],
891
+ sheetAllowedDetents: formSheetDetents(0.5, 0.9),
892
sheetGrabberVisible: true,
893
},
894
}),
@@ -893,8 +896,9 @@ const RootStackConfig = createWorkspaceStackNavigator({
896
screen: GitOverviewSheet,
897
linking: `${THREAD_LINKING_PREFIX}/git`,
898
options: {
896
- ...FORM_SHEET_PRESENTATION_OPTIONS,
897
- sheetAllowedDetents: [0.55, 0.92],
899
+ ...(Platform.OS === "ios" ? SHEET_GLASS_HEADER_OPTIONS : undefined),
900
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
901
+ sheetAllowedDetents: formSheetDetents(0.55),
902
sheetGrabberVisible: true,
903
},
904
}),
@@ -902,8 +906,9 @@ const RootStackConfig = createWorkspaceStackNavigator({
906
screen: ThreadPullRequestsSheet,
907
linking: `${THREAD_LINKING_PREFIX}/pull-requests`,
908
options: {
905
- ...FORM_SHEET_PRESENTATION_OPTIONS,
906
- sheetAllowedDetents: [0.55, 0.92],
909
+ ...(Platform.OS === "ios" ? SHEET_GLASS_HEADER_OPTIONS : undefined),
910
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
911
+ sheetAllowedDetents: formSheetDetents(0.55),
912
sheetGrabberVisible: true,
913
},
914
}),
@@ -912,8 +917,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
917
linking: `${THREAD_LINKING_PREFIX}/git/commit`,
918
options: {
919
...(Platform.OS === "ios" ? SHEET_GLASS_HEADER_OPTIONS : undefined),
915
- ...FORM_SHEET_PRESENTATION_OPTIONS,
916
- sheetAllowedDetents: [0.8, 0.92],
920
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
921
+ sheetAllowedDetents: formSheetDetents(0.8),
922
sheetGrabberVisible: true,
923
},
924
}),
@@ -921,8 +926,9 @@ const RootStackConfig = createWorkspaceStackNavigator({
926
screen: GitBranchesSheet,
927
linking: `${THREAD_LINKING_PREFIX}/git/branches`,
928
options: {
924
- ...FORM_SHEET_PRESENTATION_OPTIONS,
925
- sheetAllowedDetents: [0.55, 0.92],
929
+ ...(Platform.OS === "ios" ? SHEET_GLASS_HEADER_OPTIONS : undefined),
930
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
931
+ sheetAllowedDetents: formSheetDetents(0.55),
932
sheetGrabberVisible: true,
933
},
934
}),
@@ -930,8 +936,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
936
screen: GitConfirmSheet,
937
linking: `${THREAD_LINKING_PREFIX}/git-confirm`,
938
options: {
933
- ...FORM_SHEET_PRESENTATION_OPTIONS,
934
- sheetAllowedDetents: [0.45, 0.7],
939
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
940
+ sheetAllowedDetents: [0.55, 0.7],
941
sheetGrabberVisible: true,
942
},
943
}),
@@ -964,8 +970,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
970
...(Platform.OS === "android" ? { headerShown: false } : SHEET_SOLID_HEADER_OPTIONS),
971
title: "Set up T3 Connect",
972
gestureEnabled: true,
967
- ...FORM_SHEET_PRESENTATION_OPTIONS,
968
- sheetAllowedDetents: [0.6, 0.95],
973
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
974
+ sheetAllowedDetents: formSheetDetents(0.6, 0.95),
975
sheetGrabberVisible: true,
976
},
977
}),
@@ -977,7 +983,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
983
...(Platform.OS === "android"
984
? { presentation: "card" as const, headerShown: false }
985
: {
980
- ...FORM_SHEET_PRESENTATION_OPTIONS,
986
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
987
sheetAllowedDetents: [0.55, 0.7],
988
sheetGrabberVisible: true,
989
}),
@@ -991,7 +997,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
997
// native header stack mounts without remounting the pairing form.
998
...(Platform.OS === "ios" ? SHEET_GLASS_HEADER_OPTIONS : undefined),
999
title: "Add Environment",
994
- ...FORM_SHEET_PRESENTATION_OPTIONS,
1000
+ ...HORIZONTAL_FORM_SHEET_OPTIONS,
1001
sheetAllowedDetents: [0.55, 0.7],
1002
sheetGrabberVisible: true,
1003
},
@@ -1009,6 +1015,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
1015
),
1016
options: {
1017
...NESTED_NAVIGATOR_OPTIONS,
1018
+ sheetPrefersHorizontalBars: true,
1019
gestureEnabled: true,
1020
headerShown: false,
1021
},
@@ -1066,8 +1073,8 @@ export const RootStack = RootStackConfig.with(function AdaptiveRootStack({ Navig
1073
return usesWorkspaceFlowScreens
1074
? { presentation: "card" }
1075
: {
1069
- ...FORM_SHEET_PRESENTATION_OPTIONS,
1070
- sheetAllowedDetents: [0.92],
1076
+ presentation: "formSheet",
1077
+ sheetAllowedDetents: [1],
1078
sheetGrabberVisible: true,
1079
};
1080
}}
apps/mobile/src/components/ui/Sheet.tsx
+4
-1
@@ -4,6 +4,7 @@ import { FormSheet, ScreenStack } from "react-native-screens";
4
import { useResolveClassNames } from "uniwind";
5
6
import { nativeHeaderScrollEdgeEffects } from "../../native/StackHeader";
7
+import { formSheetDetents } from "../../native/sheet-surface";
8
import { NativeHeader, NativeScreen } from "../../native/ThemedScreenStack";
9
10
const HEADER_SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version);
@@ -21,8 +22,10 @@ export function Sheet(props: SheetProps) {
22
return (
23
<FormSheet
24
isOpen={isOpen}
24
- detents={[0.5, 0.9]}
25
+ detents={formSheetDetents(0.5, 0.9)}
26
prefersGrabberVisible
27
+ // The header holds the close button, so the Duo needs no rail inside this sheet.
28
+ prefersHorizontalBars
29
nativeContainerStyle={containerStyle}
30
onDismiss={props.onClose}
31
onNativeDismiss={props.onClose}
apps/mobile/src/components/ui/SheetHeader.tsx
+1
@@ -75,6 +75,7 @@ function NativeSheetHeader(props: SheetHeaderProps) {
75
<Toolbar.Button
76
icon="checkmark"
77
variant="prominent"
78
+ visibilityPriority="high"
79
tintColor={colors["--color-prominent-action"]}
80
accessibilityLabel={confirmation.label}
81
disabled={confirmation.disabled}
apps/mobile/src/features/threads/ThreadPullRequestsSheet.tsx
+13
-43
@@ -2,15 +2,14 @@ import { useNavigation, type StaticScreenProps } from "@react-navigation/native"
2
import { LegendList } from "@legendapp/list/react-native";
3
import { useMemo } from "react";
4
import { Platform, View } from "react-native";
5
-import { ScreenStack } from "react-native-screens";
5
import { useSafeAreaInsets } from "react-native-safe-area-context";
6
7
import { AndroidSheetHeader } from "../../components/ui/AndroidScreenHeader";
8
import { AppText as Text } from "../../components/ui/AppText";
9
import { ScreenContent } from "../../components/ui/ScreenContent";
11
-import { NativeSheetContent } from "../../native/NativeSheetContent";
12
-import { NativeStackScreenOptions, nativeHeaderScrollEdgeEffects } from "../../native/StackHeader";
13
-import { NativeHeader, NativeScreen } from "../../native/ThemedScreenStack";
10
+import { SheetHeader } from "../../components/ui/SheetHeader";
11
+import { Toolbar } from "../../components/ui/Toolbar";
12
+import { NativeStackScreenOptions } from "../../native/StackHeader";
13
import { useOpenPullRequest } from "../../native/useOpenPullRequest";
14
import { useThreadSelection } from "../../state/use-thread-selection";
15
import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
@@ -21,7 +20,6 @@ import {
20
} from "./LinkedPullRequestList";
21
import { useLinkedPullRequestActions } from "./useLinkedPullRequestActions";
22
24
-const HEADER_SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version);
23
const TITLE = "Linked pull requests";
24
25
export function ThreadPullRequestsSheet(
@@ -92,47 +90,19 @@ export function ThreadPullRequestsSheet(
90
);
91
92
if (Platform.OS === "ios") {
95
- // A plain formSheet screen never renders a stack header, so it comes from
96
- // a nested native stack inside the sheet (same shape as the git sheet).
93
return (
94
<View collapsable={false} className="flex-1 bg-sheet">
99
- <ScreenStack style={{ flex: 1 }}>
100
- <NativeScreen
101
- activityState={2}
102
- enabled
103
- isNativeStack
104
- screenId="thread-pull-requests-sheet-native"
105
- scrollEdgeEffects={HEADER_SCROLL_EDGE_EFFECTS}
106
- className="flex-1 bg-sheet"
107
- >
108
- <NativeSheetContent>{content}</NativeSheetContent>
109
- <NativeHeader
110
- backgroundColor="rgba(0,0,0,0)"
111
- tintColorClassName="accent-foreground"
112
- hideBackButton
113
- hideShadow={false}
114
- navigationItemStyle="editor"
115
- title={TITLE}
116
- titleColorClassName="accent-foreground"
117
- titleFontSize={18}
118
- titleFontWeight="800"
119
- translucent
120
- headerRightBarButtonItems={
121
- actions.canLink
122
- ? [
123
- {
124
- type: "button",
125
- accessibilityLabel: "Link pull request",
126
- icon: { name: "plus", type: "sfSymbol" },
127
- identifier: "thread-pull-requests-link",
128
- onPress: actions.promptLink,
129
- },
130
- ]
131
- : undefined
132
- }
95
+ <SheetHeader presentation="native" title={TITLE} onClose={() => navigation.goBack()} />
96
+ {actions.canLink ? (
97
+ <Toolbar placement="right">
98
+ <Toolbar.Button
99
+ icon="plus"
100
+ accessibilityLabel="Link pull request"
101
+ onPress={actions.promptLink}
102
/>
134
- </NativeScreen>
135
- </ScreenStack>
103
+ </Toolbar>
104
+ ) : null}
105
+ {content}
106
</View>
107
);
108
}
apps/mobile/src/features/threads/ThreadSettingsSheet.tsx
+12
-6
@@ -85,6 +85,7 @@ import {
85
createNativeMailSearchToolbarItem,
86
NATIVE_MAIL_SEARCH_TOOLBAR_CONTENT_INSET,
87
} from "../layout/native-mail-search-toolbar";
88
+import { useNativeLayoutMetrics } from "../../native/native-layout-metrics";
89
import { useNativeMailSearchToolbar } from "../../native/use-native-mail-search-toolbar";
90
import { ModelRow, ChoiceRow } from "./ThreadSettingsRows";
91
import {
@@ -847,10 +848,8 @@ function ThreadSettingsOptionsItem(props: {
848
.get(session.environmentId)
849
?.providers.find((provider) => provider.instanceId === session.providerInstanceId) ?? null)
850
: null;
850
- const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
851
- const bottomToolbarInset = usesNativeMailSearchToolbar
852
- ? NATIVE_MAIL_SEARCH_TOOLBAR_CONTENT_INSET
853
- : 0;
851
+ // Both iOS search layouts float a bottom toolbar over the list's last rows.
852
+ const bottomToolbarInset = Platform.OS === "ios" ? NATIVE_MAIL_SEARCH_TOOLBAR_CONTENT_INSET : 0;
853
854
return (
855
<View style={{ paddingBottom: insets.bottom + bottomToolbarInset + 12 }}>
@@ -1211,11 +1210,17 @@ function useThreadSettingsPickerPresentation() {
1210
return value;
1211
}
1212
1213
+// With a Duo vertical bar, filter and search join cancel and confirm in the rail.
1214
+function useThreadSettingsMailSearchToolbar() {
1215
+ const metrics = useNativeLayoutMetrics();
1216
+ return useNativeMailSearchToolbar() && (metrics?.verticalBarEdge ?? "none") === "none";
1217
+}
1218
+
1219
function ThreadSettingsModelsScreen() {
1220
const session = useThreadSettingsSession();
1221
const presentation = useThreadSettingsPickerPresentation();
1222
const navigation = useNavigation<NativeStackNavigationProp<ThreadSettingsPickerStackParams>>();
1218
- const usesNativeMailSearchToolbar = useNativeMailSearchToolbar();
1223
+ const usesNativeMailSearchToolbar = useThreadSettingsMailSearchToolbar();
1224
const hasCustomCatalogFilter = session.providerFilter !== null || session.showLegacy;
1225
const commitAndClose = useEffectEvent(() => {
1226
if (!session.commitPendingModel()) return;
@@ -1335,6 +1340,7 @@ function ThreadSettingsModelsScreen() {
1340
headerSearchBarOptions:
1341
Platform.OS === "ios" && !usesNativeMailSearchToolbar
1342
? {
1343
+ allowToolbarIntegration: true,
1344
autoCapitalize: "none",
1345
hideNavigationBar: false,
1346
obscureBackground: false,
@@ -1378,7 +1384,6 @@ function ThreadSettingsModelsScreen() {
1384
? "line.3.horizontal.decrease.circle.fill"
1385
: "line.3.horizontal.decrease.circle"
1386
}
1381
- separateBackground
1387
title="Model filters"
1388
>
1389
<Toolbar.Menu title="Provider">
@@ -1414,6 +1419,7 @@ function ThreadSettingsModelsScreen() {
1419
</Toolbar.MenuAction>
1420
) : null}
1421
</Toolbar.Menu>
1422
+ <Toolbar.SearchBarSlot />
1423
</Toolbar>
1424
) : null}
1425
</>
apps/mobile/src/features/threads/git/GitBranchesSheet.tsx
+9
-1
@@ -5,6 +5,7 @@ import { Platform, Pressable, ScrollView, useWindowDimensions, View } from "reac
5
import { useSafeAreaInsets } from "react-native-safe-area-context";
6
7
import { AndroidSheetHeader } from "../../../components/ui/AndroidScreenHeader";
8
+import { SheetHeader } from "../../../components/ui/SheetHeader";
9
import { ScreenContent } from "../../../components/ui/ScreenContent";
10
import { NativeStackScreenOptions } from "../../../native/StackHeader";
11
import { AppText as Text, AppTextInput as TextInput } from "../../../components/ui/AppText";
@@ -81,11 +82,18 @@ export function GitBranchesSheet(_props: GitBranchesSheetProps) {
82
onBack={() => navigation.goBack()}
83
hideBottomBorder
84
/>
84
- ) : null}
85
+ ) : (
86
+ <SheetHeader
87
+ presentation="native"
88
+ title="Branches & worktrees"
89
+ onClose={() => navigation.goBack()}
90
+ />
91
+ )}
92
<ScreenContent fitToContents>
93
<ScrollView
94
nestedScrollEnabled
95
className="android:shrink android:grow-0 ios:flex-1"
96
+ contentInsetAdjustmentBehavior={Platform.OS === "ios" ? "automatic" : "never"}
97
keyboardShouldPersistTaps="handled"
98
showsVerticalScrollIndicator={false}
99
contentInset={{ bottom: Math.max(insets.bottom, 18) + 18 }}
apps/mobile/src/features/threads/git/GitOverviewSheet.tsx
+8
-27
@@ -1,4 +1,5 @@
1
import * as Dialog from "../../../components/ui/Dialog";
2
+import { SheetHeader } from "../../../components/ui/SheetHeader";
3
import { useOpenPullRequest } from "../../../native/useOpenPullRequest";
4
import {
5
type GitActionRequestInput,
@@ -368,35 +369,15 @@ function GitOverviewSheetContent(props: GitOverviewSheetProps) {
369
}
370
371
if (Platform.OS === "ios") {
371
- // Compact form sheet: a plain screen presented as formSheet never renders a
372
- // stack header, so — like the Settings sheet — the header must come from a
373
- // nested native stack INSIDE the sheet.
372
return (
373
<View collapsable={false} className="flex-1 bg-sheet">
376
- <ScreenStack style={{ flex: 1 }}>
377
- <NativeScreen
378
- activityState={2}
379
- enabled
380
- isNativeStack
381
- screenId="thread-git-sheet-native"
382
- scrollEdgeEffects={HEADER_SCROLL_EDGE_EFFECTS}
383
- className="flex-1 bg-sheet"
384
- >
385
- <NativeSheetContent>{content}</NativeSheetContent>
386
- <NativeHeader
387
- backgroundColor="rgba(0,0,0,0)"
388
- tintColorClassName="accent-foreground"
389
- hideBackButton
390
- hideShadow={false}
391
- navigationItemStyle="editor"
392
- title={currentBranchLabel}
393
- titleColorClassName="accent-foreground"
394
- titleFontSize={18}
395
- titleFontWeight="800"
396
- translucent
397
- />
398
- </NativeScreen>
399
- </ScreenStack>
374
+ <SheetHeader
375
+ presentation="native"
376
+ title={currentBranchLabel}
377
+ subtitle={currentStatusSummary}
378
+ onClose={() => navigation.goBack()}
379
+ />
380
+ {content}
381
</View>
382
);
383
}
apps/mobile/src/native/NativeHeaderToolbar.tsx
+6
@@ -42,6 +42,10 @@ type NativeStackHeaderAxisBehavior = Extract<
42
NativeStackHeaderItem,
43
{ type: "button" }
44
>["axisBehavior"];
45
+type NativeStackHeaderVisibilityPriority = Extract<
46
+ NativeStackHeaderItem,
47
+ { type: "button" }
48
+>["visibilityPriority"];
49
type NativeToolbarItem = NativeStackHeaderItem | HeaderBarButtonSearchBarPlacementItem;
50
type NativeStackOptionsWithToolbar = NativeStackNavigationOptions & {
51
unstable_headerToolbarItems?: () => NativeToolbarItem[];
@@ -166,6 +170,7 @@ function convertToolbarChild(child: ReactNode): NativeToolbarItem | null {
170
? child.props.variant
171
: "plain",
172
identifier: typeof child.props.identifier === "string" ? child.props.identifier : undefined,
173
+ visibilityPriority: child.props.visibilityPriority as NativeStackHeaderVisibilityPriority,
174
};
175
}
176
@@ -277,6 +282,7 @@ function NativeHeaderToolbarButton(_props: {
282
readonly tintColor?: ColorValue;
283
readonly variant?: "plain" | "done" | "prominent";
284
readonly identifier?: string;
285
+ readonly visibilityPriority?: NativeStackHeaderVisibilityPriority;
286
}) {
287
return null;
288
}
apps/mobile/src/native/V5StackHeader.ios.tsx
+2
@@ -128,6 +128,8 @@ function convertItems(items: NativeStackHeaderItem[], prefix: string): HeaderIte
128
axisBehavior: item.axisBehavior,
129
icon: convertIcon(item.icon),
130
onPress: item.disabled ? undefined : item.onPress,
131
+ visibilityPriority:
132
+ item.visibilityPriority === "default" ? "standard" : item.visibilityPriority,
133
variant: item.variant,
134
tintColor: item.tintColor,
135
hidesSharedBackground: item.hidesSharedBackground,
apps/mobile/src/native/createV5StackNavigator.ios.tsx
+1
@@ -369,6 +369,7 @@ export function V5SheetStackView(props: V5StackViewProps) {
369
initialDetentIndex={options.sheetInitialDetentIndex}
370
largestUndimmedDetentIndex={options.sheetLargestUndimmedDetentIndex}
371
prefersGrabberVisible={options.sheetGrabberVisible}
372
+ prefersHorizontalBars={options.sheetPrefersHorizontalBars}
373
preferredCornerRadius={options.sheetCornerRadius}
374
prefersScrollingExpandsWhenScrolledToEdge={options.sheetExpandsWhenScrolledToEdge}
375
nativeContainerStyle={{
apps/mobile/src/native/sheet-surface.ts
+9
-1
@@ -1,3 +1,11 @@
1
-export const FORM_SHEET_PRESENTATION_OPTIONS = {
1
+import { Platform } from "react-native";
2
+
3
+export const HORIZONTAL_FORM_SHEET_OPTIONS = {
4
presentation: "formSheet" as const,
5
+ sheetPrefersHorizontalBars: true,
6
};
7
+
8
+export function formSheetDetents(initialDetent: number, androidExpandedDetent = 0.92) {
9
+ // Duo moves the status bar above the sheet only at the maximum native detent.
10
+ return [initialDetent, Platform.OS === "ios" ? 1 : androidExpandedDetent];
11
+}
patches/@react-navigation%2Fnative-stack@7.21.0.patch
+67
-17
@@ -1,5 +1,5 @@
1
diff --git a/lib/module/views/NativeStackView.native.js b/lib/module/views/NativeStackView.native.js
2
-index 6882090..011ad0e 100644
2
+index 6882090..f1e14e1 100644
3
--- a/lib/module/views/NativeStackView.native.js
4
+++ b/lib/module/views/NativeStackView.native.js
5
@@ -17,8 +17,12 @@ const ANDROID_DEFAULT_HEADER_HEIGHT = 56;
@@ -15,7 +15,15 @@ index 6882090..011ad0e 100644
15
index,
16
focused,
17
shouldFreeze,
18
-@@ -305,7 +309,8 @@ const SceneView = /*#__PURE__*/React.memo(function SceneView({
18
+@@ -144,6 +148,7 @@ const SceneView = /*#__PURE__*/React.memo(function SceneView({
19
+ sheetAllowedDetents = [1.0],
20
+ sheetLargestUndimmedDetentIndex = -1,
21
+ sheetGrabberVisible = false,
22
++ sheetPrefersHorizontalBars = false,
23
+ sheetCornerRadius = -1.0,
24
+ sheetElevation = 24,
25
+ sheetExpandsWhenScrolledToEdge = true,
26
+@@ -305,7 +310,8 @@ const SceneView = /*#__PURE__*/React.memo(function SceneView({
27
}
28
}
29
});
@@ -25,7 +33,15 @@ index 6882090..011ad0e 100644
33
route: route,
34
navigation: navigation,
35
children: /*#__PURE__*/_jsx(ScreenStackItem, {
28
-@@ -427,6 +432,7 @@ const SceneView = /*#__PURE__*/React.memo(function SceneView({
36
+@@ -333,6 +339,7 @@ const SceneView = /*#__PURE__*/React.memo(function SceneView({
37
+ sheetAllowedDetents: sheetAllowedDetents,
38
+ sheetLargestUndimmedDetentIndex: sheetLargestUndimmedDetentIndex,
39
+ sheetGrabberVisible: sheetGrabberVisible,
40
++ sheetPrefersHorizontalBars: sheetPrefersHorizontalBars,
41
+ sheetInitialDetentIndex: sheetInitialDetentIndex,
42
+ sheetCornerRadius: sheetCornerRadius,
43
+ sheetElevation: sheetElevation,
44
+@@ -427,6 +434,7 @@ const SceneView = /*#__PURE__*/React.memo(function SceneView({
45
});
46
});
47
export function NativeStackView({
@@ -33,7 +49,7 @@ index 6882090..011ad0e 100644
49
state,
50
navigation,
51
descriptors,
36
-@@ -444,6 +450,17 @@ export function NativeStackView({
52
+@@ -444,6 +452,17 @@ export function NativeStackView({
53
return /*#__PURE__*/_jsx(SafeAreaProviderCompat, {
54
children: /*#__PURE__*/_jsx(ScreenStack, {
55
style: styles.container,
@@ -51,7 +67,7 @@ index 6882090..011ad0e 100644
67
children: state.routes.concat(state.preloadedRoutes).map((route, index) => {
68
const descriptor = descriptors[route.key] ?? preloadedDescriptors[route.key];
69
const isFocused = state.index === index;
54
-@@ -460,6 +477,7 @@ export function NativeStackView({
70
+@@ -460,6 +479,7 @@ export function NativeStackView({
71
// due to component being unmounted. To avoid this, we don't freeze the previous screen there
72
const shouldFreeze = isFabric() ? !isPreloaded && !isFocused && !isBelowFocused && !isModalOnIos : !isPreloaded && !isFocused && !isModalOnIos;
73
return /*#__PURE__*/_jsx(SceneView, {
@@ -60,7 +76,7 @@ index 6882090..011ad0e 100644
76
focused: isFocused,
77
shouldFreeze: shouldFreeze,
78
diff --git a/lib/module/views/useHeaderConfigProps.js b/lib/module/views/useHeaderConfigProps.js
63
-index 08055b2..8718847 100644
79
+index 08055b2..ccf1fde 100644
80
--- a/lib/module/views/useHeaderConfigProps.js
81
+++ b/lib/module/views/useHeaderConfigProps.js
82
@@ -18,6 +18,12 @@ const processBarButtonItems = (items, colors, fonts) => {
@@ -174,10 +190,19 @@ index 08055b2..8718847 100644
190
headerRightBarButtonItems: processBarButtonItems(rightItems, colors, fonts),
191
experimental_userInterfaceStyle: dark ? 'dark' : 'light'
192
diff --git a/lib/typescript/src/types.d.ts b/lib/typescript/src/types.d.ts
177
-index 27a3d8e..3adf86e 100644
193
+index 27a3d8e..7312e4e 100644
194
--- a/lib/typescript/src/types.d.ts
195
+++ b/lib/typescript/src/types.d.ts
180
-@@ -903,6 +903,8 @@ type SharedHeaderItem = {
196
+@@ -694,6 +694,8 @@ export type NativeStackNavigationOptions = {
197
+ * @platform ios
198
+ */
199
+ sheetGrabberVisible?: boolean;
200
++ /** Requests horizontal bars on iOS 27.1+. Defaults to UIKit automatic placement. */
201
++ sheetPrefersHorizontalBars?: boolean;
202
+ /**
203
+ * The largest sheet detent for which a view underneath won't be dimmed.
204
+ * Works only when `presentation` is set to `formSheet`.
205
+@@ -903,6 +905,8 @@ type SharedHeaderItem = {
206
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground
207
*/
208
sharesBackground?: boolean;
@@ -186,7 +211,7 @@ index 27a3d8e..3adf86e 100644
211
/**
212
* An identifier used to match items across transitions.
213
* Only available from iOS 26.0 and later.
189
-@@ -1148,6 +1150,13 @@ export type NativeStackHeaderItemSpacing = {
214
+@@ -1148,6 +1152,13 @@ export type NativeStackHeaderItemSpacing = {
215
*/
216
export type NativeStackHeaderItemCustom = {
217
type: 'custom';
@@ -232,10 +257,19 @@ index d533cd9..857b7ad 100644
257
//# sourceMappingURL=NativeStackView.native.d.ts.map
258
\ No newline at end of file
259
diff --git a/src/types.tsx b/src/types.tsx
235
-index 5d63f41..e9c53ee 100644
260
+index 5d63f41..f949a11 100644
261
--- a/src/types.tsx
262
+++ b/src/types.tsx
238
-@@ -959,6 +959,8 @@ type SharedHeaderItem = {
263
+@@ -746,6 +746,8 @@ export type NativeStackNavigationOptions = {
264
+ * @platform ios
265
+ */
266
+ sheetGrabberVisible?: boolean;
267
++ /** Requests horizontal bars on iOS 27.1+. Defaults to UIKit automatic placement. */
268
++ sheetPrefersHorizontalBars?: boolean;
269
+ /**
270
+ * The largest sheet detent for which a view underneath won't be dimmed.
271
+ * Works only when `presentation` is set to `formSheet`.
272
+@@ -959,6 +961,8 @@ type SharedHeaderItem = {
273
* Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground
274
*/
275
sharesBackground?: boolean;
@@ -244,7 +278,7 @@ index 5d63f41..e9c53ee 100644
278
/**
279
* An identifier used to match items across transitions.
280
* Only available from iOS 26.0 and later.
247
-@@ -1213,6 +1215,13 @@ export type NativeStackHeaderItemSpacing = {
281
+@@ -1213,6 +1217,13 @@ export type NativeStackHeaderItemSpacing = {
282
*/
283
export type NativeStackHeaderItemCustom = {
284
type: 'custom';
@@ -259,7 +293,7 @@ index 5d63f41..e9c53ee 100644
293
* A React Element to display as the item.
294
*/
295
diff --git a/src/views/NativeStackView.native.tsx b/src/views/NativeStackView.native.tsx
262
-index aa13bc7..ab4a9d1 100644
296
+index aa13bc7..225daf9 100644
297
--- a/src/views/NativeStackView.native.tsx
298
+++ b/src/views/NativeStackView.native.tsx
299
@@ -52,7 +52,14 @@ function isFabric() {
@@ -285,7 +319,15 @@ index aa13bc7..ab4a9d1 100644
319
index,
320
focused,
321
shouldFreeze,
288
-@@ -434,7 +442,7 @@ const SceneView = React.memo(function SceneView({
322
+@@ -199,6 +207,7 @@ const SceneView = React.memo(function SceneView({
323
+ sheetAllowedDetents = [1.0],
324
+ sheetLargestUndimmedDetentIndex = -1,
325
+ sheetGrabberVisible = false,
326
++ sheetPrefersHorizontalBars = false,
327
+ sheetCornerRadius = -1.0,
328
+ sheetElevation = 24,
329
+ sheetExpandsWhenScrolledToEdge = true,
330
+@@ -434,7 +443,7 @@ const SceneView = React.memo(function SceneView({
331
);
332
333
return (
@@ -294,7 +336,15 @@ index aa13bc7..ab4a9d1 100644
336
<ScreenStackItem
337
screenId={route.key}
338
activityState={isPreloaded ? 0 : 2}
297
-@@ -571,11 +579,12 @@ const SceneView = React.memo(function SceneView({
339
+@@ -463,6 +472,7 @@ const SceneView = React.memo(function SceneView({
340
+ sheetAllowedDetents={sheetAllowedDetents}
341
+ sheetLargestUndimmedDetentIndex={sheetLargestUndimmedDetentIndex}
342
+ sheetGrabberVisible={sheetGrabberVisible}
343
++ sheetPrefersHorizontalBars={sheetPrefersHorizontalBars}
344
+ sheetInitialDetentIndex={sheetInitialDetentIndex}
345
+ sheetCornerRadius={sheetCornerRadius}
346
+ sheetElevation={sheetElevation}
347
+@@ -571,11 +581,12 @@ const SceneView = React.memo(function SceneView({
348
</HeaderHeightContext.Provider>
349
</AnimatedHeaderHeightContext.Provider>
350
</ScreenStackItem>
@@ -308,7 +358,7 @@ index aa13bc7..ab4a9d1 100644
358
state: StackNavigationState<ParamListBase>;
359
navigation: NativeStackNavigationHelpers;
360
descriptors: NativeStackDescriptorMap;
311
-@@ -586,6 +595,7 @@ type Props = {
361
+@@ -586,6 +597,7 @@ type Props = {
362
};
363
364
export function NativeStackView({
@@ -316,7 +366,7 @@ index aa13bc7..ab4a9d1 100644
366
state,
367
navigation,
368
descriptors,
319
-@@ -633,6 +643,7 @@ export function NativeStackView({
369
+@@ -633,6 +645,7 @@ export function NativeStackView({
370
371
return (
372
<SceneView
pnpm-lock.yaml
+3
-3
@@ -337,7 +337,7 @@ patchedDependencies:
337
'@pierre/diffs@1.5.2': 2ec81ba1e8ce4681095a3473c2bf78e630417740c622720ef624febb467c25fc
338
'@react-native-ai/apple@0.12.0': 2d09870c2848d185cb05b53ed823a46e12dba519324d8dd8e584e28731990f9d
339
'@react-native-menu/menu@2.0.0': a4866ecfcd44f318043de839d20110c17e14909004900f002ffe12050376f2ba
340
- '@react-navigation/native-stack@7.21.0': caae6552051bce91a85f567f3a08f9c8d25ce4c53f65a9391a67f016bb1d798e
340
+ '@react-navigation/native-stack@7.21.0': 990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42
341
alchemy@2.0.0-beta.80: bea1b6c0c0b23157fd5f439a1d7feff430f28ac1621ba135d8a13eeec60ccacd
342
app-builder-lib@26.16.1: a28c2dfcfc2b90d6c6247e199e6537391db9ecd941854c650910d607442512d3
343
dbus-next@0.10.2: cfff57561b0ee59b5addb3b2e6c6f20906e967507a530ab67e8db8108e520ba4
@@ -542,7 +542,7 @@ importers:
542
version: 7.5.1(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)
543
'@react-navigation/native-stack':
544
specifier: 7.21.0
545
- version: 7.21.0(patch_hash=caae6552051bce91a85f567f3a08f9c8d25ce4c53f65a9391a67f016bb1d798e)(45e036a3bd680d99803578d5030f7a06)
545
+ version: 7.21.0(patch_hash=990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42)(45e036a3bd680d99803578d5030f7a06)
546
'@shikijs/core':
547
specifier: 4.2.0
548
version: 4.2.0
@@ -15967,7 +15967,7 @@ snapshots:
15967
optionalDependencies:
15968
'@react-native-masked-view/masked-view': 0.3.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)
15969
15970
- '@react-navigation/native-stack@7.21.0(patch_hash=caae6552051bce91a85f567f3a08f9c8d25ce4c53f65a9391a67f016bb1d798e)(45e036a3bd680d99803578d5030f7a06)':
15970
+ '@react-navigation/native-stack@7.21.0(patch_hash=990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42)(45e036a3bd680d99803578d5030f7a06)':
15971
dependencies:
15972
'@react-navigation/elements': 2.9.45(d8845bac868f4d8a58c8a8f12ad0d4a5)
15973
'@react-navigation/native': 7.5.1(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)