Skip to content

Commit ce07f0b

Browse files
Merge main into fix/issue-8204
2 parents 7e37d9c + a50cd98 commit ce07f0b

67 files changed

Lines changed: 1748 additions & 929 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
-765 KB
Binary file not shown.
769 KB
Binary file not shown.

‎apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ final class T3LayoutMetricsView: ExpoView {
6969
}
7070
var verticalBarEdge = "none"
7171
var regions: [[String: Any]] = []
72+
var bottomBarInset: CGFloat?
7273
#if canImport(UIKit, _version: 9127.0.85)
7374
if #available(iOS 27.1, *) {
7475
let rtl = effectiveUserInterfaceLayoutDirection == .rightToLeft
@@ -77,6 +78,8 @@ final class T3LayoutMetricsView: ExpoView {
7778
case .trailing: verticalBarEdge = rtl ? "left" : "right"
7879
default: break
7980
}
81+
// Where UIKit floats a bar as tall as the app's bottom controls, level with its tab bar.
82+
bottomBarInset = edgeInsets(for: .bar(onEdge: UIRectEdge.bottom, extent: 48)).bottom
8083
for kind in [UIView.ReservedRegion.Kind.division, .occlusion] {
8184
for region in reservedRegions(kind: kind) where region.isActive {
8285
let frame = region.frame.intersection(bounds)
@@ -90,7 +93,7 @@ final class T3LayoutMetricsView: ExpoView {
9093
}
9194
}
9295
#endif
93-
let metrics: [String: Any] = [
96+
var metrics: [String: Any] = [
9497
"width": bounds.width, "height": bounds.height,
9598
"hasHinge": hasHinge,
9699
"horizontalSizeClass": traitCollection.horizontalSizeClass == .regular ? "regular" : "compact",
@@ -101,6 +104,7 @@ final class T3LayoutMetricsView: ExpoView {
101104
],
102105
"reservedRegions": regions,
103106
]
107+
metrics["bottomBarInset"] = bottomBarInset
104108
let next = metrics as NSDictionary
105109
guard lastMetrics?.isEqual(next) != true else { return }
106110
lastMetrics = next

‎apps/mobile/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
"react-native-pdf-jsi": "5.0.0",
135135
"react-native-reanimated": "4.7.1",
136136
"react-native-safe-area-context": "~5.10.1",
137-
"react-native-screens": "file:deps/react-native-screens-5.0.0-t3.30.tgz",
137+
"react-native-screens": "file:deps/react-native-screens-5.0.0-t3.36.tgz",
138138
"react-native-shiki-engine": "^0.3.12",
139139
"react-native-svg": "15.16.0",
140140
"react-native-webview": "14.0.1",

‎apps/mobile/src/Stack.tsx‎

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ import { NATIVE_LIQUID_GLASS_SUPPORTED } from "./native/native-glass";
149149
import { deriveLayout } from "./lib/layout";
150150
import { useNativeLayoutMetrics } from "./native/native-layout-metrics";
151151
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";
153153
import { useThreadOutboxDrain } from "./state/use-thread-outbox-drain";
154154
import { useComposerAttachmentUploadWorker } from "./state/composer-attachment-uploads";
155155

@@ -210,6 +210,15 @@ const LEGAL_DOCUMENT_HEADER_OPTIONS: AppScreenOptions = {
210210

211211
const NESTED_NAVIGATOR_OPTIONS = { nativeContentInsetHorizontally: false, headerShown: false };
212212

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+
213222
const SettingsContentStack = createV5SheetStackNavigator({
214223
initialRouteName: "Settings",
215224
screenOptions: {
@@ -368,9 +377,7 @@ const SettingsContentStack = createV5SheetStackNavigator({
368377
...(Platform.OS === "android"
369378
? { presentation: "card" as const }
370379
: {
371-
...FORM_SHEET_PRESENTATION_OPTIONS,
372-
sheetAllowedDetents: [1],
373-
sheetGrabberVisible: true,
380+
...THREAD_SETTINGS_SHEET_OPTIONS,
374381
}),
375382
},
376383
}),
@@ -513,9 +520,7 @@ const NewTaskSheetStack = createNativeStackNavigator({
513520
...(Platform.OS === "android"
514521
? { presentation: "card" as const }
515522
: {
516-
...FORM_SHEET_PRESENTATION_OPTIONS,
517-
sheetAllowedDetents: [1],
518-
sheetGrabberVisible: true,
523+
...THREAD_SETTINGS_SHEET_OPTIONS,
519524
}),
520525
},
521526
}),
@@ -734,8 +739,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
734739
screen: PullRequestFilesSheet,
735740
options: {
736741
...(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),
739744
sheetGrabberVisible: true,
740745
sheetCornerRadius: Platform.OS === "android" ? 28 : undefined,
741746
},
@@ -744,8 +749,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
744749
screen: PullRequestReviewersScreen,
745750
options: {
746751
...DETAIL_HEADER_OPTIONS,
747-
...FORM_SHEET_PRESENTATION_OPTIONS,
748-
sheetAllowedDetents: [0.75, 0.92],
752+
...HORIZONTAL_FORM_SHEET_OPTIONS,
753+
sheetAllowedDetents: formSheetDetents(0.75),
749754
sheetGrabberVisible: true,
750755
headerBackVisible: false,
751756
},
@@ -759,17 +764,17 @@ const RootStackConfig = createWorkspaceStackNavigator({
759764
options: {
760765
...(Platform.OS === "android"
761766
? { 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),
764769
sheetGrabberVisible: Platform.OS !== "android",
765770
},
766771
}),
767772
PullRequestReview: createNativeStackScreen({
768773
screen: PullRequestReviewSheet,
769774
options: {
770775
...(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),
773778
sheetGrabberVisible: true,
774779
},
775780
}),
@@ -816,8 +821,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
816821
// formSheet; use a full-screen modal there instead.
817822
...(Platform.OS === "android"
818823
? { 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),
821826
sheetGrabberVisible: Platform.OS !== "android",
822827
},
823828
}),
@@ -856,54 +861,54 @@ const RootStackConfig = createWorkspaceStackNavigator({
856861
...(Platform.OS === "android"
857862
? { presentation: "card" as const }
858863
: {
859-
...FORM_SHEET_PRESENTATION_OPTIONS,
860-
sheetAllowedDetents: [1],
861-
sheetGrabberVisible: true,
864+
...THREAD_SETTINGS_SHEET_OPTIONS,
862865
}),
863866
},
864867
}),
865868
ThreadQueue: createNativeStackScreen({
866869
screen: ThreadQueueSheet,
867870
options: {
868-
...FORM_SHEET_PRESENTATION_OPTIONS,
871+
...HORIZONTAL_FORM_SHEET_OPTIONS,
869872
headerShown: false,
870-
sheetAllowedDetents: [0.65, 0.95],
873+
sheetAllowedDetents: formSheetDetents(0.65, 0.95),
871874
sheetGrabberVisible: true,
872875
},
873876
}),
874877
ThreadBackgroundWork: createNativeStackScreen({
875878
screen: ThreadBackgroundWorkSheet,
876879
options: {
877-
...FORM_SHEET_PRESENTATION_OPTIONS,
880+
...HORIZONTAL_FORM_SHEET_OPTIONS,
878881
headerShown: false,
879-
sheetAllowedDetents: [0.5, 0.9],
882+
sheetAllowedDetents: formSheetDetents(0.5, 0.9),
880883
sheetGrabberVisible: true,
881884
},
882885
}),
883886
ThreadAgents: createNativeStackScreen({
884887
screen: ThreadAgentsSheet,
885888
options: {
886-
...FORM_SHEET_PRESENTATION_OPTIONS,
889+
...HORIZONTAL_FORM_SHEET_OPTIONS,
887890
headerShown: false,
888-
sheetAllowedDetents: [0.5, 0.9],
891+
sheetAllowedDetents: formSheetDetents(0.5, 0.9),
889892
sheetGrabberVisible: true,
890893
},
891894
}),
892895
GitOverview: createNativeStackScreen({
893896
screen: GitOverviewSheet,
894897
linking: `${THREAD_LINKING_PREFIX}/git`,
895898
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),
898902
sheetGrabberVisible: true,
899903
},
900904
}),
901905
ThreadPullRequests: createNativeStackScreen({
902906
screen: ThreadPullRequestsSheet,
903907
linking: `${THREAD_LINKING_PREFIX}/pull-requests`,
904908
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),
907912
sheetGrabberVisible: true,
908913
},
909914
}),
@@ -912,26 +917,27 @@ const RootStackConfig = createWorkspaceStackNavigator({
912917
linking: `${THREAD_LINKING_PREFIX}/git/commit`,
913918
options: {
914919
...(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),
917922
sheetGrabberVisible: true,
918923
},
919924
}),
920925
GitBranches: createNativeStackScreen({
921926
screen: GitBranchesSheet,
922927
linking: `${THREAD_LINKING_PREFIX}/git/branches`,
923928
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),
926932
sheetGrabberVisible: true,
927933
},
928934
}),
929935
GitConfirm: createNativeStackScreen({
930936
screen: GitConfirmSheet,
931937
linking: `${THREAD_LINKING_PREFIX}/git-confirm`,
932938
options: {
933-
...FORM_SHEET_PRESENTATION_OPTIONS,
934-
sheetAllowedDetents: [0.45, 0.7],
939+
...HORIZONTAL_FORM_SHEET_OPTIONS,
940+
sheetAllowedDetents: [0.55, 0.7],
935941
sheetGrabberVisible: true,
936942
},
937943
}),
@@ -964,8 +970,8 @@ const RootStackConfig = createWorkspaceStackNavigator({
964970
...(Platform.OS === "android" ? { headerShown: false } : SHEET_SOLID_HEADER_OPTIONS),
965971
title: "Set up T3 Connect",
966972
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),
969975
sheetGrabberVisible: true,
970976
},
971977
}),
@@ -977,7 +983,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
977983
...(Platform.OS === "android"
978984
? { presentation: "card" as const, headerShown: false }
979985
: {
980-
...FORM_SHEET_PRESENTATION_OPTIONS,
986+
...HORIZONTAL_FORM_SHEET_OPTIONS,
981987
sheetAllowedDetents: [0.55, 0.7],
982988
sheetGrabberVisible: true,
983989
}),
@@ -991,7 +997,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
991997
// native header stack mounts without remounting the pairing form.
992998
...(Platform.OS === "ios" ? SHEET_GLASS_HEADER_OPTIONS : undefined),
993999
title: "Add Environment",
994-
...FORM_SHEET_PRESENTATION_OPTIONS,
1000+
...HORIZONTAL_FORM_SHEET_OPTIONS,
9951001
sheetAllowedDetents: [0.55, 0.7],
9961002
sheetGrabberVisible: true,
9971003
},
@@ -1009,6 +1015,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
10091015
),
10101016
options: {
10111017
...NESTED_NAVIGATOR_OPTIONS,
1018+
sheetPrefersHorizontalBars: true,
10121019
gestureEnabled: true,
10131020
headerShown: false,
10141021
},
@@ -1066,8 +1073,8 @@ export const RootStack = RootStackConfig.with(function AdaptiveRootStack({ Navig
10661073
return usesWorkspaceFlowScreens
10671074
? { presentation: "card" }
10681075
: {
1069-
...FORM_SHEET_PRESENTATION_OPTIONS,
1070-
sheetAllowedDetents: [0.92],
1076+
presentation: "formSheet",
1077+
sheetAllowedDetents: [1],
10711078
sheetGrabberVisible: true,
10721079
};
10731080
}}

‎apps/mobile/src/components/ui/Sheet.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { FormSheet, ScreenStack } from "react-native-screens";
44
import { useResolveClassNames } from "uniwind";
55

66
import { nativeHeaderScrollEdgeEffects } from "../../native/StackHeader";
7+
import { formSheetDetents } from "../../native/sheet-surface";
78
import { NativeHeader, NativeScreen } from "../../native/ThemedScreenStack";
89

910
const HEADER_SCROLL_EDGE_EFFECTS = nativeHeaderScrollEdgeEffects(Platform.OS, Platform.Version);
@@ -21,8 +22,10 @@ export function Sheet(props: SheetProps) {
2122
return (
2223
<FormSheet
2324
isOpen={isOpen}
24-
detents={[0.5, 0.9]}
25+
detents={formSheetDetents(0.5, 0.9)}
2526
prefersGrabberVisible
27+
// The header holds the close button, so the Duo needs no rail inside this sheet.
28+
prefersHorizontalBars
2629
nativeContainerStyle={containerStyle}
2730
onDismiss={props.onClose}
2831
onNativeDismiss={props.onClose}

‎apps/mobile/src/components/ui/SheetHeader.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function NativeSheetHeader(props: SheetHeaderProps) {
7575
<Toolbar.Button
7676
icon="checkmark"
7777
variant="prominent"
78+
visibilityPriority="high"
7879
tintColor={colors["--color-prominent-action"]}
7980
accessibilityLabel={confirmation.label}
8081
disabled={confirmation.disabled}

‎apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import {
2727
findHeaderMenuAction,
2828
} from "../../components/ui/headerMenu.android";
2929
import type { AppBarMenuItem } from "../../components/ui/AppBar.types";
30+
import { deriveBottomControlInsets } from "../../lib/reserved-regions";
31+
import { useNativeColumnLayoutMetrics } from "../../native/native-layout-metrics";
3032
import { deviceEnvironment, refreshDeviceHubAccess, useDeviceHubAccess } from "../../state/device";
3133
import { useEnvironmentQuery } from "../../state/query";
3234
import { useAtomCommand } from "../../state/use-atom-command";
@@ -75,6 +77,8 @@ function DevicePreviewScreen({
7577
readonly onClose: () => void;
7678
}) {
7779
const insets = useSafeAreaInsets();
80+
// NativeColumnContent already insets the sides, so only a book fold moves the reveal handle.
81+
const handleBounds = deriveBottomControlInsets(useNativeColumnLayoutMetrics());
7882
const { themeVariables } = useAppearancePreferences();
7983
const focused = useIsFocused();
8084
const [foreground, setForeground] = useState(AppState.currentState !== "background");
@@ -318,7 +322,10 @@ function DevicePreviewScreen({
318322
accessibilityHint="Shaking the phone also shows them"
319323
hitSlop={12}
320324
className="absolute h-6 w-16 items-center justify-center self-center"
321-
style={{ top: Math.max(insets.top - 18, 4) }}
325+
style={{
326+
top: Math.max(insets.top - 18, 4),
327+
transform: [{ translateX: (handleBounds.left - handleBounds.right) / 2 }],
328+
}}
322329
onPress={() => setControlsVisible(true)}
323330
>
324331
<View className="h-1.5 w-10 rounded-full bg-white/40" />

‎apps/mobile/src/features/files/thread-file-navigator-pane.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { useEnvironmentQuery } from "../../state/query";
2121
import { useEnvironmentPresentation } from "../../state/presentation";
2222
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
2323
import { FileTreeBrowser } from "./FileTreeBrowser";
24+
import { NativeInspectorContent } from "../../native/NativeInspectorContent";
2425
import { useFileTreeEntries } from "./useFileTreeEntries";
2526
import { preloadWorkspaceFileContents } from "./preload-workspace-file";
2627
import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
@@ -120,7 +121,7 @@ export function ThreadFileNavigatorPane(props: {
120121
scrollEdgeEffects={headerScrollEdgeEffects}
121122
style={{ backgroundColor: sheetColor, flex: 1 }}
122123
>
123-
{fileTree}
124+
<NativeInspectorContent>{fileTree}</NativeInspectorContent>
124125
<ScreenStackHeaderConfig
125126
backgroundColor="rgba(0,0,0,0)"
126127
color={foregroundColor}

0 commit comments

Comments
 (0)