Skip to content
TypeScript

fix(mobile): stabilize Duo search and portrait navigation (#24206)

Alex940e3fafd28a
diff --git a/apps/mobile/deps/react-native-screens-5.0.0-t3.37.tgz b/apps/mobile/deps/react-native-screens-5.0.0-t3.37.tgz
deleted file mode 100644
index 0d0076c8a3c..00000000000
Binary files a/apps/mobile/deps/react-native-screens-5.0.0-t3.37.tgz and /dev/null differ
diff --git a/apps/mobile/deps/react-native-screens-5.0.0-t3.43.tgz b/apps/mobile/deps/react-native-screens-5.0.0-t3.43.tgz
new file mode 100644
index 00000000000..9406a8d7fcf
Binary files /dev/null and b/apps/mobile/deps/react-native-screens-5.0.0-t3.43.tgz differ
diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index b94b8fc0e8d..2225adf5273 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -134,7 +134,7 @@
"react-native-pdf-jsi": "5.0.0",
"react-native-reanimated": "4.7.1",
"react-native-safe-area-context": "~5.10.1",
- "react-native-screens": "file:deps/react-native-screens-5.0.0-t3.37.tgz",
+ "react-native-screens": "file:deps/react-native-screens-5.0.0-t3.43.tgz",
"react-native-shiki-engine": "^0.3.12",
"react-native-svg": "15.16.0",
"react-native-webview": "14.0.1",
diff --git a/apps/mobile/src/features/home/home-thread-navigation.ts b/apps/mobile/src/features/home/home-thread-navigation.ts
index 94948bb8f5a..3d750260d6f 100644
--- a/apps/mobile/src/features/home/home-thread-navigation.ts
+++ b/apps/mobile/src/features/home/home-thread-navigation.ts
@@ -8,6 +8,7 @@ import {
import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
import { useCallback, useEffect, useRef } from "react";
import { Platform } from "react-native";
+import { useAdaptiveWorkspaceLayout } from "../layout/adaptive-workspace-context";
import { useAndroidWorkspaceSelection } from "../workspace/useAndroidWorkspaceSelection";
type ThreadSelection = Pick<EnvironmentThreadShell, "environmentId" | "id">;
@@ -53,6 +54,7 @@ export function useHomeThreadRouteSelection() {
const navigation =
useNavigation<NativeStackNavigationProp<ReactNavigation.RootParamList, "Home">>();
const dismissingRouteKey = useRef<string | null>(null);
+ const { layout, setPrimarySidebarVisible } = useAdaptiveWorkspaceLayout();
const selectAndroidWorkspace = useAndroidWorkspaceSelection();
useEffect(() => {
@@ -85,6 +87,7 @@ export function useHomeThreadRouteSelection() {
});
return;
}
+ if (layout.primarySidebarOverlaysContent) setPrimarySidebarVisible(false);
navigation.dispatch((state) =>
createHomeThreadRouteAction({
state,
@@ -93,7 +96,12 @@ export function useHomeThreadRouteSelection() {
}),
);
},
- [navigation, selectAndroidWorkspace],
+ [
+ layout.primarySidebarOverlaysContent,
+ navigation,
+ selectAndroidWorkspace,
+ setPrimarySidebarVisible,
+ ],
);
}
diff --git a/apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx b/apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
index 5ef3fd3bf28..3cfeff980e5 100644
--- a/apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
+++ b/apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
@@ -233,6 +233,24 @@ function AdaptiveWorkspaceLayoutContent(
() => deriveLayout({ width: viewportWidth, height, nativeMetrics, nativeWorkspace }),
[height, viewportWidth, nativeMetrics, nativeWorkspace],
);
+ const [overlaySidebar, setOverlaySidebar] = useState({
+ active: baseLayout.primarySidebarOverlaysContent,
+ pathname,
+ visible: pathname === "/",
+ });
+ if (
+ overlaySidebar.active !== baseLayout.primarySidebarOverlaysContent ||
+ (overlaySidebar.active && overlaySidebar.pathname !== pathname)
+ ) {
+ setOverlaySidebar({
+ active: baseLayout.primarySidebarOverlaysContent,
+ pathname,
+ visible: pathname === "/",
+ });
+ }
+ const preferredSidebarVisible = baseLayout.primarySidebarOverlaysContent
+ ? overlaySidebar.visible
+ : primarySidebarPreferredVisible;
const primarySidebarPinned = isPrimarySidebarPinned({
pathname,
nativeWorkspace,
@@ -250,7 +268,7 @@ function AdaptiveWorkspaceLayoutContent(
);
const showPrimarySidebar =
!workspacePage &&
- (primarySidebarPinned || (primarySidebarPreferredVisible && !composerKeyboardActive));
+ (primarySidebarPinned || (preferredSidebarVisible && !composerKeyboardActive));
const shouldRenderNavigationRail = Platform.OS === "android" && baseLayout.usesSplitView;
const navigationRailWidth =
shouldRenderNavigationRail && (showPrimarySidebar || workspacePage)
@@ -282,7 +300,7 @@ function AdaptiveWorkspaceLayoutContent(
viewportWidth: width,
preferredWidth: fileInspectorPreferredWidth ?? undefined,
reservedLeadingWidth:
- shouldRenderPrimarySidebar && showPrimarySidebar
+ shouldRenderPrimarySidebar && showPrimarySidebar && !layout.primarySidebarOverlaysContent
? (layout.listPaneWidth ?? 0) + (layout.listPaneGap ?? 0)
: 0,
}),
@@ -366,6 +384,13 @@ function AdaptiveWorkspaceLayoutContent(
setFocusedAuxiliaryPaneRole(null);
};
};
+ const setPrimarySidebarVisible = (visible: boolean) => {
+ if (layout.primarySidebarOverlaysContent) {
+ setOverlaySidebar((current) => ({ ...current, visible }));
+ } else {
+ setPrimarySidebarPreferredVisible(visible);
+ }
+ };
const togglePrimarySidebar = () => {
if (primarySidebarPinned) {
return;
@@ -381,14 +406,14 @@ function AdaptiveWorkspaceLayoutContent(
setPrimarySidebarPreferredVisible(true);
return;
}
- setPrimarySidebarPreferredVisible((current) => !current);
+ setPrimarySidebarVisible(!preferredSidebarVisible);
};
const revealPrimarySidebar = () => {
if (composerKeyboardActive) void KeyboardController.dismiss();
if (panes.primarySidebarSuppressedByAuxiliary) {
setFileInspectorPreferredVisible(false);
}
- setPrimarySidebarPreferredVisible(true);
+ setPrimarySidebarVisible(true);
};
const handleToggleSidebarCommand = () => {
togglePrimarySidebar();
@@ -745,6 +770,7 @@ function AdaptiveWorkspaceLayoutContent(
showAuxiliaryPane,
toggleAuxiliaryPane,
togglePrimarySidebar,
+ setPrimarySidebarVisible,
setAuxiliaryPaneWidth,
composerKeyboardActive,
setComposerEditing,
diff --git a/apps/mobile/src/features/layout/adaptive-workspace-context.ts b/apps/mobile/src/features/layout/adaptive-workspace-context.ts
index cb64e3cfa3f..122248db589 100644
--- a/apps/mobile/src/features/layout/adaptive-workspace-context.ts
+++ b/apps/mobile/src/features/layout/adaptive-workspace-context.ts
@@ -25,6 +25,7 @@ interface AdaptiveWorkspaceContextValue {
readonly showAuxiliaryPane: (role: WorkspaceAuxiliaryPaneRole) => void;
readonly toggleAuxiliaryPane: () => void;
readonly togglePrimarySidebar: () => void;
+ readonly setPrimarySidebarVisible: (visible: boolean) => void;
readonly setAuxiliaryPaneWidth: (width: number) => void;
/**
* Android split view while the thread composer has the soft keyboard: the
@@ -61,6 +62,7 @@ export const AdaptiveWorkspaceContext = createContext<AdaptiveWorkspaceContextVa
showAuxiliaryPane: () => undefined,
toggleAuxiliaryPane: () => undefined,
togglePrimarySidebar: () => undefined,
+ setPrimarySidebarVisible: () => undefined,
setAuxiliaryPaneWidth: () => undefined,
composerKeyboardActive: false,
setComposerEditing: () => undefined,
diff --git a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
index 7e4a4057f21..bfa5ebf03f1 100644
--- a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
+++ b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
@@ -78,15 +78,17 @@ function ColumnScreen(props: {
readonly navigation: ViewProps["navigation"];
}) {
const { descriptor } = props;
+ const [presented, setPresented] = useState(false);
const primaryColumn = useMemo(
() =>
props.primary
? {
+ presented,
selectedThreadKey: props.selectedThreadKey ?? null,
selectedPullRequestKey: props.selectedPullRequestKey ?? null,
}
: null,
- [props.primary, props.selectedThreadKey, props.selectedPullRequestKey],
+ [props.primary, props.selectedThreadKey, props.selectedPullRequestKey, presented],
);
const key = descriptor.route.key;
return (
@@ -101,10 +103,12 @@ function ColumnScreen(props: {
props.navigation.emit({ type: "transitionStart", target: key, data: { closing: false } });
}}
onDidAppear={() => {
+ setPresented(true);
props.onAppearance("didAppear", key);
props.navigation.emit({ type: "transitionEnd", target: key, data: { closing: false } });
}}
onWillDisappear={() => {
+ setPresented(false);
props.onAppearance("willDisappear", key);
props.navigation.emit({ type: "transitionStart", target: key, data: { closing: true } });
}}
@@ -145,8 +149,14 @@ function ColumnScreen(props: {
function WorkspaceColumns(
props: ViewProps & { readonly primary: Route; readonly detail: Route[] },
) {
- const { layout, panes, togglePrimarySidebar, toggleAuxiliaryPane, startNewTask } =
- useAdaptiveWorkspaceLayout();
+ const {
+ layout,
+ panes,
+ togglePrimarySidebar,
+ setPrimarySidebarVisible,
+ toggleAuxiliaryPane,
+ startNewTask,
+ } = useAdaptiveWorkspaceLayout();
const deviceType = useDeviceType();
// Split screens must remain mounted while UIKit animates a detached route away.
const [screens, setScreens] = useState({
@@ -179,7 +189,7 @@ function WorkspaceColumns(
const selectedTab = useWorkspaceTabs()?.state.selectedTab;
const openNewTask = startNewTask;
// The cover detail rail needs room for thread tools above the fixed tabs.
- // The unfolded Duo keeps compose beside its sidebar control.
+ // The unfolded Duo keeps compose in its detail bar.
const detailCompose =
deviceType === "duo-unfolded" && selectedTab !== "pullRequests" ? openNewTask : undefined;
const inspector = use(NativeWorkspaceInspectorContext);
@@ -255,7 +265,7 @@ function WorkspaceColumns(
<Split.Host
ref={hostRef}
testID="adaptive-workspace-layout"
- preferredSplitBehavior="tile"
+ preferredSplitBehavior={layout.primarySidebarOverlaysContent ? "overlay" : "tile"}
primaryBackgroundStyle={deviceType === "pad" ? "none" : "default"}
topColumnForCollapsing={compactColumn}
onCollapse={() => {
@@ -270,9 +280,16 @@ function WorkspaceColumns(
// collapsed split already carries the sidebar the expanded one will show.
(layout.usesSplitView ? panes.primarySidebarVisible : panes.primarySidebarWhenExpanded) ||
(!layout.usesSplitView && !activeDetailKey)
- ? "oneBesideSecondary"
+ ? layout.primarySidebarOverlaysContent
+ ? "oneOverSecondary"
+ : "oneBesideSecondary"
: "secondaryOnly"
}
+ onDisplayModeWillChange={({ nativeEvent }) => {
+ if (!layout.primarySidebarOverlaysContent) return;
+ if (nativeEvent.nextDisplayMode === "oneOverSecondary") setPrimarySidebarVisible(true);
+ else if (nativeEvent.nextDisplayMode === "secondaryOnly") setPrimarySidebarVisible(false);
+ }}
displayModeButtonVisibility="never"
presentsWithGesture
showInspector={inspector.visible}
diff --git a/apps/mobile/src/features/layout/useWorkspaceSidebarHeaderItem.ts b/apps/mobile/src/features/layout/useWorkspaceSidebarHeaderItem.ts
index f1304ed2766..6f7627ca677 100644
--- a/apps/mobile/src/features/layout/useWorkspaceSidebarHeaderItem.ts
+++ b/apps/mobile/src/features/layout/useWorkspaceSidebarHeaderItem.ts
@@ -5,23 +5,35 @@ import { withNativeGlassHeaderItem } from "./native-glass-header-items";
export function useWorkspaceSidebarHeaderItem() {
const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
- const { panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();
+ const { layout, panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();
+ const label = panes.primarySidebarVisible
+ ? layout.primarySidebarOverlaysContent
+ ? "Hide thread sidebar"
+ : "Maximize content"
+ : "Show thread sidebar";
return useMemo(
() =>
withNativeGlassHeaderItem({
axisBehavior: usesNativeWorkspaceColumns ? "horizontalOnly" : undefined,
- accessibilityLabel: panes.primarySidebarVisible
- ? "Maximize content"
- : "Show thread sidebar",
+ accessibilityLabel: label,
icon: {
- name: panes.primarySidebarVisible ? "arrow.up.left.and.arrow.down.right" : "sidebar.left",
+ name:
+ panes.primarySidebarVisible && !layout.primarySidebarOverlaysContent
+ ? "arrow.up.left.and.arrow.down.right"
+ : "sidebar.left",
type: "sfSymbol" as const,
},
identifier: "thread-left-sidebar",
- label: panes.primarySidebarVisible ? "Maximize content" : "Show thread sidebar",
+ label,
onPress: togglePrimarySidebar,
type: "button" as const,
}),
- [panes.primarySidebarVisible, togglePrimarySidebar, usesNativeWorkspaceColumns],
+ [
+ label,
+ layout.primarySidebarOverlaysContent,
+ panes.primarySidebarVisible,
+ togglePrimarySidebar,
+ usesNativeWorkspaceColumns,
+ ],
);
}
diff --git a/apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx b/apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
index 84f9ea16f4b..f83ef07eb15 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
@@ -63,6 +63,7 @@ import { AndroidScreenHeader } from "../../components/ui/AndroidScreenHeader";
import { useAndroidControlSizing } from "../../components/ui/useAndroidControlSizing";
import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
import { AndroidWorkspaceSidebarButton } from "../layout/workspace-sidebar-toolbar";
+import { useWorkspaceSidebarHeaderItem } from "../layout/useWorkspaceSidebarHeaderItem";
import { useAndroidWorkspaceBack } from "../workspace/useAndroidWorkspaceNavigation";
import { EmptyState } from "../../components/ui/EmptyState";
import { SegmentedControl } from "../../components/ui/SegmentedControl";
@@ -273,6 +274,7 @@ function usePullRequestToolbarHeight(bottomInset: number) {
export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestParams>) {
const returnToList = useAndroidWorkspaceBack("pullRequests");
const { layout } = useAdaptiveWorkspaceLayout();
+ const sidebarHeaderItem = useWorkspaceSidebarHeaderItem();
const navigation = useNavigation();
const insets = useSafeAreaInsets();
const [toolbarHeight, setToolbarHeight] = usePullRequestToolbarHeight(insets.bottom);
@@ -397,7 +399,9 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
unstable_headerSubtitle: connected
? params.repository
: `${params.repository} · Offline`,
+ unstable_headerLeftItems: layout.usesSplitView ? () => [sidebarHeaderItem] : undefined,
}}
+ optionsVersion={[layout.usesSplitView, sidebarHeaderItem]}
/>
{Platform.OS === "android" ? (
<AndroidScreenHeader
diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx
index df0c9bc1a51..ad29dfe5c6e 100644
--- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx
@@ -1,4 +1,5 @@
import { useSidebarWorkspaceTabs } from "../workspace/useSystemWorkspaceTabBar";
+import { useWorkspaceTabs } from "../workspace/WorkspaceTabsContext";
import {
isAtomCommandInterrupted,
settlePromise,
@@ -106,6 +107,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
import { useWorkspaceContentWidth } from "../layout/workspace-content-width";
import { useNativeWorkspaceColumnsSupported } from "../../native/NativeWorkspaceColumns";
import {
+ useDeviceType,
useDuoBottomBarInset,
useNativeColumnLayoutMetrics,
useNativeLayoutMetrics,
@@ -455,6 +457,15 @@ function ThreadVisitWatermark(props: {
export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetailScreenProps) {
const usesNativeWorkspaceColumns = useNativeWorkspaceColumnsSupported();
+ const deviceType = useDeviceType();
+ const workspace = useWorkspaceTabs();
+ const sidebarSearchActive =
+ deviceType === "duo-unfolded" &&
+ workspace?.state.tabs[workspace.state.selectedTab].searchMode === "active";
+ // Keep the last input owner through keyboard dismissal, so closing sidebar
+ // search cannot briefly lift the composer into the keyboard's closing frame.
+ const [composerOwnsKeyboard, setComposerOwnsKeyboard] = useState(false);
+ if (sidebarSearchActive && composerOwnsKeyboard) setComposerOwnsKeyboard(false);
const navigation = useNavigation();
const { session: voiceInputSession } = useGlobalVoiceInput();
const reportedModelSelection = useThreadReportedModelSelection(props.selectedThreadDetailRef);
@@ -514,6 +525,8 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
const handleOwnedInputFocusChange = (focused: boolean) => {
ownedInputFocusedRef.current = focused;
if (focused) {
+ if (deviceType === "duo-folded" || deviceType === "duo-unfolded")
+ setComposerOwnsKeyboard(true);
setKeyboardStateSuspect(false);
}
};
@@ -566,10 +579,13 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
(Platform.OS === "ios" && Platform.isPad
? Math.max(bottomSafeArea, 12) - (hasSidebarTabBar ? 5 : 0)
: undefined);
- const composerBottomInset =
- alignedBottomInset !== undefined
- ? Math.max(0, alignedBottomInset - THREAD_COMPOSER_BOTTOM_GUTTER)
- : Math.max(bottomSafeArea, 12);
+ // The Duo's floating sidebar pill ends three points below the composer's usual gutter.
+ const composerBottomInset = Math.max(
+ 0,
+ (alignedBottomInset !== undefined
+ ? alignedBottomInset - THREAD_COMPOSER_BOTTOM_GUTTER
+ : Math.max(bottomSafeArea, 12)) - (hasSidebarTabBar ? 3 : 0),
+ );
const composerKeyboardOffset = composerBottomInset;
const contentPresentationKind = props.contentPresentation.kind;
const realThreadSyncLabel = (() => {
@@ -1441,7 +1457,11 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
{showContent ? (
<KeyboardStickyView
// Waiting for a visibility render misses the first keyboard frames.
- enabled={Platform.OS === "ios" || !keyboardStateSuspect}
+ enabled={
+ Platform.OS === "ios"
+ ? deviceType !== "duo-unfolded" || (composerOwnsKeyboard && !sidebarSearchActive)
+ : !keyboardStateSuspect
+ }
pointerEvents="box-none"
style={{ position: "absolute", bottom: 0, left: 0, right: 0, top: 0 }}
offset={{ closed: 0, opened: composerKeyboardOffset }}
diff --git a/apps/mobile/src/features/workspace/WorkspaceNativeTabs.ios.tsx b/apps/mobile/src/features/workspace/WorkspaceNativeTabs.ios.tsx
index 5c1fc78f95d..7bc9ebacea8 100644
--- a/apps/mobile/src/features/workspace/WorkspaceNativeTabs.ios.tsx
+++ b/apps/mobile/src/features/workspace/WorkspaceNativeTabs.ios.tsx
@@ -17,6 +17,7 @@ import { WorkspaceTabsContext, useWorkspaceTabs } from "./WorkspaceTabsContext";
import {
NATIVE_WORKSPACE_TAB_SLOTS,
workspaceTabForNativeSlot,
+ workspaceUsesColumns,
type WorkspaceTab,
} from "./workspace-tabs-state";
import { NativeWorkspaceTabActivityContext } from "../../native/v5-workspace-context";
@@ -162,7 +163,11 @@ export function WorkspaceNativeTabs(props: {
);
})}
</Tabs.Host>
- {(deviceType === "pad" || compactTabs) && !props.hidden ? (
+ {(deviceType === "pad" ||
+ compactTabs ||
+ (layout.primarySidebarOverlaysContent &&
+ (workspace.settingsOpen || !workspaceUsesColumns(selectedTab)))) &&
+ !props.hidden ? (
<View
pointerEvents="box-none"
style={{
diff --git a/apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx b/apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx
index 2e226f80014..4e9c0d1d137 100644
--- a/apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx
+++ b/apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx
@@ -110,24 +110,26 @@ function WorkspaceRootContent() {
);
const tab = state.tabs[state.selectedTab];
const bottomClearance =
- Platform.OS === "ios" && isDuoDevice(deviceType)
- ? workspaceSearchBottomClearance({
- bottomInset: insets.bottom,
- bottomBarInset,
- keyboardHeight,
- })
- : compactTabs || deviceType === "pad"
- ? workspaceDockBottomClearance({ bottomInset: insets.bottom, keyboardHeight })
- : Platform.OS === "ios"
- ? Math.max(insets.bottom, keyboardHeight) +
- (systemTabBar || sidebarTabs || tab.searchMode !== "resting"
- ? sidebarPicker
- ? 80
- : 16
- : WORKSPACE_DOCK.height + WORKSPACE_DOCK.bottomGap + 16)
- : keyboardHeight > 0 && tab.searchMode !== "resting"
- ? keyboardHeight + 64
- : Math.max(insets.bottom, 12) + workspaceToolbarHeight(tab.searchMode) + 16;
+ layout.primarySidebarOverlaysContent && state.selectedTab === "usage"
+ ? workspaceDockBottomClearance({ bottomInset: insets.bottom, keyboardHeight })
+ : Platform.OS === "ios" && isDuoDevice(deviceType)
+ ? workspaceSearchBottomClearance({
+ bottomInset: insets.bottom,
+ bottomBarInset,
+ keyboardHeight,
+ })
+ : compactTabs || deviceType === "pad"
+ ? workspaceDockBottomClearance({ bottomInset: insets.bottom, keyboardHeight })
+ : Platform.OS === "ios"
+ ? Math.max(insets.bottom, keyboardHeight) +
+ (systemTabBar || sidebarTabs || tab.searchMode !== "resting"
+ ? sidebarPicker
+ ? 80
+ : 16
+ : WORKSPACE_DOCK.height + WORKSPACE_DOCK.bottomGap + 16)
+ : keyboardHeight > 0 && tab.searchMode !== "resting"
+ ? keyboardHeight + 64
+ : Math.max(insets.bottom, 12) + workspaceToolbarHeight(tab.searchMode) + 16;
const context = useMemo(() => ({ ...workspace, bottomClearance }), [workspace, bottomClearance]);
return (
diff --git a/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx b/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx
index c45f7d30117..17fff053258 100644
--- a/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx
+++ b/apps/mobile/src/features/workspace/WorkspaceToolbar.ios.tsx
@@ -1,56 +1,24 @@
import { useActiveNewTask } from "../../state/active-new-task";
import { Toolbar } from "../../components/ui/Toolbar";
-import { useFocusEffect } from "@react-navigation/native";
-import { use, useCallback, useEffect, useRef, type ReactNode } from "react";
-import { Platform, Pressable, type TextInputInstance } from "react-native";
-import { useReanimatedKeyboardAnimation } from "react-native-keyboard-controller";
-import Animated, { useAnimatedStyle } from "react-native-reanimated";
-import { useSafeAreaInsets } from "react-native-safe-area-context";
+import { useFocusEffect, useIsFocused } from "@react-navigation/native";
+import { use, useCallback, useEffect, useRef } from "react";
+import { Platform } from "react-native";
import { isDuoDevice } from "../../lib/device-type";
-import { useDeviceType, useDuoBottomBarInset } from "../../native/native-layout-metrics";
+import { useDeviceType } from "../../native/native-layout-metrics";
import type { SearchBarCommands } from "react-native-screens";
-import { SymbolView } from "../../components/ui/AppSymbol";
-import { GlassSurface } from "../../components/ui/GlassSurface";
import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass";
import { NativeStackScreenOptions } from "../../native/StackHeader";
-import { NativeWorkspaceTabActivityContext } from "../../native/v5-workspace-context";
+import {
+ NativePrimaryColumnContext,
+ NativeWorkspaceTabActivityContext,
+} from "../../native/v5-workspace-context";
import { useHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";
import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
import { useWorkspaceTabs } from "./WorkspaceTabsContext";
-import { WorkspaceSearchField } from "./WorkspaceSearchField";
-import { WORKSPACE_TOOLBAR } from "./workspace-tabs-state";
import { useCompactWorkspaceTabs, useSidebarWorkspaceTabs } from "./useSystemWorkspaceTabBar";
import { WorkspaceTabToolbarButtons } from "./WorkspaceSectionToolbar";
-/**
- * Rises once the keyboard reaches its content. UIKit also reports keyboards without height, with a
- * hardware keyboard and around a fold, and those must not move it.
- */
-function AboveKeyboard(props: { readonly bottom: number; readonly children: ReactNode }) {
- const keyboard = useReanimatedKeyboardAnimation();
- const { bottom } = props;
- const lift = useAnimatedStyle(() => ({
- transform: [{ translateY: Math.min(0, keyboard.height.value + bottom - 8) }],
- }));
- return (
- <Animated.View
- pointerEvents="box-none"
- className="absolute inset-x-0 bottom-0 flex-row items-center"
- style={[
- {
- gap: WORKSPACE_TOOLBAR.gap,
- paddingHorizontal: WORKSPACE_TOOLBAR.edge,
- paddingBottom: bottom,
- },
- lift,
- ]}
- >
- {props.children}
- </Animated.View>
- );
-}
-
export function WorkspaceToolbar(props: {
readonly onNewTask: () => void;
readonly sidebar?: boolean;
@@ -60,25 +28,28 @@ export function WorkspaceToolbar(props: {
const deviceType = useDeviceType();
const sidebarTabs = useSidebarWorkspaceTabs();
const compactTabs = useCompactWorkspaceTabs();
+ const duoSearch = NATIVE_LIQUID_GLASS_SUPPORTED && isDuoDevice(deviceType);
+ const bottomSearch = duoSearch && sidebarTabs !== "picker";
// On the Duo, compose belongs to the threads tab, in the detail column's bar when unfolded.
const nativeToolbarCompose =
Platform.OS === "ios" &&
deviceType === "duo-folded" &&
workspace.state.selectedTab === "threads" &&
activeNewTask === null;
- // The Duo searches from a field at the bottom of the list in every pose. UIKit has no such
- // placement once the vertical bar holds the toolbar, and re-placing its search controller on
- // each fold replaces the search field.
- const listSearch = isDuoDevice(deviceType);
- const insets = useSafeAreaInsets();
- const bottomBarInset = useDuoBottomBarInset();
const { isTabActive } = workspace;
const tabActive = use(NativeWorkspaceTabActivityContext)?.active ?? true;
+ const focused = useIsFocused();
const { panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();
const searchRef = useRef<SearchBarCommands>(null);
- const fieldRef = useRef<TextInputInstance>(null);
const tab = workspace.state.tabs[workspace.state.selectedTab];
const selectedTab = workspace.state.selectedTab;
+ const foldedSearch = deviceType === "duo-folded";
+ const primaryColumn = use(NativePrimaryColumnContext);
+ // UIKit hosts integrated search outside the sidebar's sliding content.
+ // Mount it after native appearance so it cannot precede the pane's reveal.
+ const searchVisible = foldedSearch
+ ? tab.searchMode !== "resting"
+ : deviceType !== "duo-unfolded" || primaryColumn?.presented !== false;
const enterSearch = useCallback(() => {
workspace.dispatch({
type: "scroll",
@@ -90,14 +61,10 @@ export function WorkspaceToolbar(props: {
}, [workspace, selectedTab, props.sidebar, panes.primarySidebarVisible, togglePrimarySidebar]);
const focusSearch = useCallback(() => {
if (!workspace.isTabActive(selectedTab)) return false;
- if (listSearch) {
- fieldRef.current?.focus();
- return true;
- }
- if (!NATIVE_LIQUID_GLASS_SUPPORTED) enterSearch();
+ if (duoSearch || !NATIVE_LIQUID_GLASS_SUPPORTED) enterSearch();
searchRef.current?.focus();
return true;
- }, [workspace, selectedTab, listSearch, enterSearch]);
+ }, [workspace, selectedTab, enterSearch, duoSearch]);
const cancelSearch = useCallback(() => {
workspace.recordScrollOffset(selectedTab, tab.searchEntryOffset);
workspace.dispatch({ type: "cancel", tab: selectedTab });
@@ -110,10 +77,30 @@ export function WorkspaceToolbar(props: {
[tab.searchMode, enterSearch, workspace, selectedTab],
);
useHardwareKeyboardCommand("focusSearch", focusSearch);
+ // The sidebar remains visible while its detail owns navigation focus.
+ const searchHostVisible = focused || primaryColumn?.presented === true;
const restoreSearch = useCallback(() => {
- if (isTabActive(selectedTab) && tab.searchMode !== "resting")
+ if (
+ searchHostVisible &&
+ searchVisible &&
+ isTabActive(selectedTab) &&
+ tab.searchMode !== "resting"
+ ) {
searchRef.current?.setText(tab.query);
- }, [isTabActive, selectedTab, tab.searchMode, tab.query]);
+ if (duoSearch) {
+ searchRef.current?.setActive(true);
+ if (tab.searchMode === "active") searchRef.current?.focus();
+ }
+ }
+ }, [
+ searchHostVisible,
+ duoSearch,
+ isTabActive,
+ selectedTab,
+ tab.searchMode,
+ tab.query,
+ searchVisible,
+ ]);
useFocusEffect(
useCallback(() => {
const frame = requestAnimationFrame(restoreSearch);
@@ -124,16 +111,39 @@ export function WorkspaceToolbar(props: {
if (!tabActive) return;
const frame = requestAnimationFrame(restoreSearch);
return () => cancelAnimationFrame(frame);
- }, [restoreSearch, tabActive]);
+ }, [restoreSearch, tabActive, bottomSearch]);
+ const composeButton = nativeToolbarCompose ? (
+ <Toolbar.Button
+ identifier="workspace-compose"
+ accessibilityLabel="New chat"
+ icon="square.and.pencil"
+ onPress={props.onNewTask}
+ separateBackground
+ />
+ ) : null;
+ const searchButton = foldedSearch ? (
+ <Toolbar.Button
+ identifier="workspace-search"
+ accessibilityLabel={
+ searchVisible
+ ? "Close search"
+ : selectedTab === "pullRequests"
+ ? "Search pull requests"
+ : "Search threads"
+ }
+ icon={searchVisible ? "xmark" : "magnifyingglass"}
+ onPress={searchVisible ? () => searchRef.current?.cancelSearch() : focusSearch}
+ separateBackground
+ />
+ ) : null;
return (
<>
<NativeStackScreenOptions
optionsVersion={[selectedTab, tab.searchMode]}
+ listeners={{ transitionEnd: restoreSearch }}
options={{
- // Liquid Glass keeps search mounted as UIKit's own header button, which
- // morphs into the field; swapping a stacked bar in and out cannot animate.
headerSearchBarOptions:
- !listSearch && (NATIVE_LIQUID_GLASS_SUPPORTED || tab.searchMode !== "resting")
+ (NATIVE_LIQUID_GLASS_SUPPORTED || tab.searchMode !== "resting") && searchVisible
? {
ref: searchRef,
autoFocus: tab.searchMode === "active",
@@ -141,11 +151,18 @@ export function WorkspaceToolbar(props: {
hideNavigationBar: false,
hideWhenScrolling: false,
obscureBackground: false,
- placement: NATIVE_LIQUID_GLASS_SUPPORTED ? "integratedButton" : "stacked",
- allowToolbarIntegration: NATIVE_LIQUID_GLASS_SUPPORTED,
+ placement: NATIVE_LIQUID_GLASS_SUPPORTED
+ ? bottomSearch
+ ? "integrated"
+ : "integratedButton"
+ : "stacked",
+ allowToolbarIntegration:
+ NATIVE_LIQUID_GLASS_SUPPORTED &&
+ deviceType !== "phone" &&
+ sidebarTabs !== "picker",
placeholder:
selectedTab === "pullRequests" ? "Search pull requests" : "Search threads",
- cancelButtonText: "✕",
+ cancelButtonHidden: foldedSearch,
onFocus: searchFocused,
onBlur: () => workspace.dispatch({ type: "expand", tab: selectedTab }),
onSearchButtonPress: () => searchRef.current?.blur(),
@@ -162,6 +179,9 @@ export function WorkspaceToolbar(props: {
/>
{/* UIKit lays trailing items out from the edge inward. */}
<Toolbar placement="right">
+ {searchButton}
+ {nativeToolbarCompose && foldedSearch ? <Toolbar.Spacer width={8} /> : null}
+ {composeButton}
{selectedTab !== "threads" ||
isDuoDevice(deviceType) ||
deviceType === "pad" ||
@@ -185,56 +205,8 @@ export function WorkspaceToolbar(props: {
</Toolbar>
<Toolbar placement="bottom">
{sidebarTabs === "toolbar" ? <WorkspaceTabToolbarButtons /> : null}
- {nativeToolbarCompose ? <Toolbar.Spacer flexible /> : null}
- {nativeToolbarCompose ? (
- <Toolbar.Button
- identifier="workspace-compose"
- accessibilityLabel="New chat"
- icon="square.and.pencil"
- onPress={props.onNewTask}
- separateBackground
- />
- ) : null}
+ {bottomSearch && searchVisible ? <Toolbar.SearchBarSlot /> : null}
</Toolbar>
- {listSearch ? (
- <AboveKeyboard bottom={bottomBarInset ?? Math.max(insets.bottom, 12)}>
- <WorkspaceSearchField
- ref={fieldRef}
- tab={selectedTab}
- query={tab.query}
- onChangeQuery={(query) =>
- workspace.dispatch({ type: "query", query, tab: selectedTab })
- }
- onFocus={searchFocused}
- onBlur={() => workspace.dispatch({ type: "expand", tab: selectedTab })}
- onClear={() => {
- workspace.dispatch({ type: "query", query: "", tab: selectedTab });
- fieldRef.current?.focus();
- }}
- />
- {tab.searchMode === "resting" ? null : (
- <GlassSurface
- style={{
- width: WORKSPACE_TOOLBAR.height,
- height: WORKSPACE_TOOLBAR.height,
- borderRadius: WORKSPACE_TOOLBAR.height / 2,
- }}
- >
- <Pressable
- accessibilityRole="button"
- accessibilityLabel="Cancel search"
- onPress={() => {
- cancelSearch();
- fieldRef.current?.blur();
- }}
- className="flex-1 items-center justify-center"
- >
- <SymbolView name="xmark" size={20} tintColorClassName="accent-icon" />
- </Pressable>
- </GlassSurface>
- )}
- </AboveKeyboard>
- ) : null}
</>
);
}
diff --git a/apps/mobile/src/features/workspace/useSystemWorkspaceTabBar.ts b/apps/mobile/src/features/workspace/useSystemWorkspaceTabBar.ts
index 461b2ddae06..35c41afb339 100644
--- a/apps/mobile/src/features/workspace/useSystemWorkspaceTabBar.ts
+++ b/apps/mobile/src/features/workspace/useSystemWorkspaceTabBar.ts
@@ -41,7 +41,14 @@ export function useCompactWorkspaceTabs() {
export function useSystemWorkspaceTabBar() {
const deviceType = useDeviceType();
+ const { layout } = useAdaptiveWorkspaceLayout();
const sidebarTabs = useSidebarWorkspaceTabs();
const compactTabs = useCompactWorkspaceTabs();
- return Platform.OS === "ios" && deviceType !== "pad" && sidebarTabs === null && !compactTabs;
+ return (
+ Platform.OS === "ios" &&
+ deviceType !== "pad" &&
+ !layout.primarySidebarOverlaysContent &&
+ sidebarTabs === null &&
+ !compactTabs
+ );
}
diff --git a/apps/mobile/src/lib/layout.test.ts b/apps/mobile/src/lib/layout.test.ts
index 8babd468199..c4c0f73ae3d 100644
--- a/apps/mobile/src/lib/layout.test.ts
+++ b/apps/mobile/src/lib/layout.test.ts
@@ -50,6 +50,40 @@ describe("deriveThreadFeedInitialContentInset", () => {
});
describe("native workspace sizing", () => {
+ it.each([
+ { width: 669, height: 951, hasHinge: true, nativeWorkspace: true, overlay: true },
+ { width: 951, height: 669, hasHinge: true, nativeWorkspace: true, overlay: false },
+ { width: 669, height: 951, hasHinge: false, nativeWorkspace: true, overlay: false },
+ { width: 669, height: 951, hasHinge: true, nativeWorkspace: false, overlay: false },
+ ])(
+ "overlays only a native unfolded portrait Duo sidebar: %j",
+ ({ overlay, nativeWorkspace, ...size }) => {
+ const nativeMetrics = {
+ ...size,
+ horizontalSizeClass: "regular" as const,
+ verticalBarEdge: "none" as const,
+ safeArea: { top: 24, bottom: 20, left: 0, right: 0 },
+ reservedRegions: [],
+ };
+ const layout = deriveLayout({ ...size, nativeMetrics, nativeWorkspace });
+ expect(layout.primarySidebarOverlaysContent).toBe(overlay);
+ for (const primarySidebarPreferredVisible of [true, false]) {
+ expect(
+ deriveWorkspacePaneLayout({
+ layout,
+ viewportWidth: size.width,
+ primarySidebarPreferredVisible,
+ auxiliaryPanePreferredVisible: false,
+ }).contentPaneWidth,
+ ).toBe(
+ !overlay && primarySidebarPreferredVisible
+ ? size.width - (layout.listPaneWidth ?? 0)
+ : size.width,
+ );
+ }
+ },
+ );
+
it("keeps the detail mounted in a narrow iPad window while UIKit still has two columns", () => {
const nativeMetrics = {
width: 715,
diff --git a/apps/mobile/src/lib/layout.ts b/apps/mobile/src/lib/layout.ts
index 5cff4509a51..5993d7897b4 100644
--- a/apps/mobile/src/lib/layout.ts
+++ b/apps/mobile/src/lib/layout.ts
@@ -51,6 +51,7 @@ export type LayoutVariant = "compact" | "split";
export interface Layout {
readonly variant: LayoutVariant;
readonly usesSplitView: boolean;
+ readonly primarySidebarOverlaysContent: boolean;
readonly listPaneWidth: number | null;
readonly listPaneGap?: number;
readonly shellPadding: number;
@@ -115,6 +116,7 @@ export function deriveLayout(input: {
return {
variant: "compact",
usesSplitView: false,
+ primarySidebarOverlaysContent: false,
listPaneWidth: null,
shellPadding: 0,
};
@@ -130,6 +132,8 @@ export function deriveLayout(input: {
return {
variant: "split",
usesSplitView: true,
+ primarySidebarOverlaysContent:
+ input.nativeWorkspace === true && metrics?.hasHinge === true && width < height,
listPaneWidth:
division?.x ??
clamp(Math.round(width * 0.32), SPLIT_SIDEBAR_MIN_WIDTH, SPLIT_SIDEBAR_DEFAULT_MAX_WIDTH),
@@ -191,9 +195,10 @@ export function deriveWorkspacePaneLayout(input: {
const auxiliaryPaneRole = input.auxiliaryPaneRole ?? "supplementary";
const preferredPrimarySidebarVisible =
input.layout.usesSplitView && input.primarySidebarPreferredVisible;
- const preferredPrimarySidebarWidth = preferredPrimarySidebarVisible
- ? (input.layout.listPaneWidth ?? 0) + (input.layout.listPaneGap ?? 0)
- : 0;
+ const preferredPrimarySidebarWidth =
+ preferredPrimarySidebarVisible && !input.layout.primarySidebarOverlaysContent
+ ? (input.layout.listPaneWidth ?? 0) + (input.layout.listPaneGap ?? 0)
+ : 0;
if (auxiliaryPaneRole === "inspector") {
const fileInspector = deriveFileInspectorPaneLayout({
@@ -205,6 +210,7 @@ export function deriveWorkspacePaneLayout(input: {
const auxiliaryPaneVisible = fileInspector.supported && input.auxiliaryPanePreferredVisible;
const primarySidebarSuppressedByAuxiliary =
preferredPrimarySidebarVisible &&
+ !input.layout.primarySidebarOverlaysContent &&
auxiliaryPaneVisible &&
fileInspector.width !== null &&
input.layout.listPaneWidth !== null &&
diff --git a/apps/mobile/src/lib/reserved-regions.test.ts b/apps/mobile/src/lib/reserved-regions.test.ts
index b95ec5ea8ad..69734226390 100644
--- a/apps/mobile/src/lib/reserved-regions.test.ts
+++ b/apps/mobile/src/lib/reserved-regions.test.ts
@@ -21,6 +21,28 @@ describe("bottom controls around reserved regions", () => {
expect(innerDisplay.width - insets.left - insets.right).toBeGreaterThan(320);
});
+ it("does not reserve a hinge twice when a native column starts at the division", () => {
+ expect(
+ deriveBottomControlInsets({
+ ...innerDisplay,
+ width: 412,
+ safeArea: { top: 82, bottom: 34, left: 0, right: 0 },
+ reservedRegions: [{ kind: "division", x: 0, y: 0, width: 40, height: 560 }],
+ }),
+ ).toEqual({ left: 0, right: 0, bottom: 0 });
+ });
+
+ it("keeps a native column's trailing division at its existing edge", () => {
+ expect(
+ deriveBottomControlInsets({
+ ...innerDisplay,
+ width: 456,
+ safeArea: { top: 82, bottom: 34, left: 0, right: 0 },
+ reservedRegions: [{ kind: "division", x: 455.75, y: 0, width: 0.25, height: 560 }],
+ }),
+ ).toEqual({ left: 0, right: 0, bottom: 0 });
+ });
+
it("keeps controls below a horizontal fold in a hands-free pose", () => {
expect(
deriveBottomControlInsets({
diff --git a/apps/mobile/src/lib/reserved-regions.ts b/apps/mobile/src/lib/reserved-regions.ts
index f88af9239c3..bb8ff981a6d 100644
--- a/apps/mobile/src/lib/reserved-regions.ts
+++ b/apps/mobile/src/lib/reserved-regions.ts
@@ -35,6 +35,9 @@ export function deriveBottomControlInsets(metrics: NativeLayoutMetrics | null) {
const endY = Math.min(bottom, region.y + region.height);
if (endX <= x || endY <= y) continue;
if (region.kind === "division" && region.height >= metrics.height / 2) {
+ // A native column ending at a division is already split there. Only an
+ // interior division needs to move these controls into one side of the view.
+ if (x <= left || endX >= right) continue;
if (right - endX >= x - left) left = endX;
else right = x;
} else if (endY >= bottom - metrics.safeArea.bottom) {
diff --git a/apps/mobile/src/native/V5StackHeader.ios.tsx b/apps/mobile/src/native/V5StackHeader.ios.tsx
index b4f1c1c9a03..8812fcfe968 100644
--- a/apps/mobile/src/native/V5StackHeader.ios.tsx
+++ b/apps/mobile/src/native/V5StackHeader.ios.tsx
@@ -205,12 +205,14 @@ export function V5StackHeader(props: {
}
// UIKit doesn't stack a column's toolbar against the workspace tab bar, which owns the
// bottom of the vertical bar and draws over it. Those columns keep the group in their
- // navigation items. An expanded sidebar's toolbar stays horizontal, outside the bar.
+ // navigation items. Integrated search stays in the column's horizontal bottom toolbar.
if (
props.column &&
nativeMetrics &&
nativeMetrics.verticalBarEdge !== "none" &&
- (props.column === "detail" || nativeMetrics.horizontalSizeClass === "compact")
+ (props.column === "detail" ||
+ (nativeMetrics.horizontalSizeClass === "compact" &&
+ !toolbar.some((item) => item.type === "searchBarPlacement")))
) {
if (trailing.length && bottom.length)
trailing.push({ type: "spacer", id: "toolbar-group", sizing: "fixed", width: 8 });
@@ -225,15 +227,9 @@ export function V5StackHeader(props: {
icon: { type: "sfSymbol", name: "square.and.pencil" },
onPress: props.onCompose,
};
- if (deviceType === "duo-unfolded") {
- if (leading.length)
- leading.unshift({ type: "spacer", id: "compose-group", sizing: "fixed", width: 8 });
- leading.unshift(compose);
- } else {
- if (trailing.length)
- trailing.push({ type: "spacer", id: "compose-group", sizing: "fixed", width: 8 });
- trailing.push(compose);
- }
+ if (trailing.length)
+ trailing.push({ type: "spacer", id: "compose-group", sizing: "fixed", width: 8 });
+ trailing.push(compose);
}
const left = options.headerLeft?.(itemProps);
const right = options.headerRight?.(itemProps);
@@ -248,20 +244,9 @@ export function V5StackHeader(props: {
: undefined;
const searchOptions = options.headerSearchBarOptions;
const autofocusRef = searchOptions?.ref ?? searchRef;
- const searchHasFocus = useRef(false);
useEffect(() => {
- searchHasFocus.current = false;
if (!searchOptions?.autoFocus) return;
- // UIKit attaches integrated search during the toolbar transition. Native
- // onFocus acknowledges readiness; a single frame can reach it too early.
- const deadline = Date.now() + 500;
- let frame = 0;
- const focusWhenAttached = () => {
- if (searchHasFocus.current) return;
- autofocusRef.current?.focus();
- if (Date.now() < deadline) frame = requestAnimationFrame(focusWhenAttached);
- };
- frame = requestAnimationFrame(focusWhenAttached);
+ const frame = requestAnimationFrame(() => autofocusRef.current?.focus());
return () => cancelAnimationFrame(frame);
}, [searchOptions?.autoFocus, autofocusRef]);
const titleStyle = StyleSheet.flatten(options.headerTitleStyle);
@@ -305,7 +290,6 @@ export function V5StackHeader(props: {
placement={bottomSearch ? "integrated" : (searchOptions?.placement ?? "automatic")}
placeholder={mailSearch?.placeholder ?? searchOptions?.placeholder ?? "Search"}
onFocus={(event) => {
- searchHasFocus.current = true;
searchOptions?.onFocus?.(event);
}}
onChangeText={(event) => {
diff --git a/apps/mobile/src/native/v5-workspace-context.tsx b/apps/mobile/src/native/v5-workspace-context.tsx
index c5d2a45923b..5ecbad35c36 100644
--- a/apps/mobile/src/native/v5-workspace-context.tsx
+++ b/apps/mobile/src/native/v5-workspace-context.tsx
@@ -7,6 +7,7 @@ export const NativeWorkspaceTabActivityContext = createContext<{
readonly isActive: () => boolean;
} | null>(null);
export const NativePrimaryColumnContext = createContext<{
+ readonly presented: boolean;
readonly selectedThreadKey: string | null;
readonly selectedPullRequestKey: string | null;
} | null>(null);
diff --git a/docs/operations/mobile-screens-fork.md b/docs/operations/mobile-screens-fork.md
index 3a2b1adf952..23ad1387b78 100644
--- a/docs/operations/mobile-screens-fork.md
+++ b/docs/operations/mobile-screens-fork.md
@@ -1,7 +1,7 @@
# Building the mobile Screens dependency
The mobile v5 stack uses a committed tarball from the
-[T3 Screens fork](https://github.com/pingdotgg/react-native-screens/tree/t3-v5.0.0-t3.37).
+[T3 Screens fork](https://github.com/PixPMusic/react-native-screens/tree/t3-v5.0.0-t3.43).
The fork owns the integration changes; the app does not patch this package.
Each archive includes compiled JavaScript, declarations, native source and
`t3-fork.json` recording its version, source commit and upstream base.
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 5125b6af46c..0ac02861696 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -553,7 +553,7 @@ importers:
'@react-navigation/native-stack':
specifier: 7.21.0
- version: 7.21.0(patch_hash=990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42)(110925a0d7a34aa12f32b4b743079ccc)
+ version: 7.21.0(patch_hash=990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42)(52d9b4ccdf06285c715244e02709d347)
'@shikijs/core':
specifier: 4.2.0
version: 4.2.0
@@ -765,8 +765,8 @@ importers:
specifier: ~5.10.1
react-native-screens:
- specifier: file:deps/react-native-screens-5.0.0-t3.37.tgz
+ specifier: file:deps/react-native-screens-5.0.0-t3.43.tgz
react-native-shiki-engine:
specifier: ^0.3.12
@@ -10675,9 +10675,9 @@ packages:
react: '*'
react-native: '*'
- react-native-screens@file:apps/mobile/deps/react-native-screens-5.0.0-t3.37.tgz:
- resolution: {integrity: sha512-LMm9e8lHseFaUYKF4tFkGkqpJFu36uwp6ZGQgBYksn+pmcx0voaSMkK0tGaZ59LFXXD2TGoBR3K9kAX++72Xig==, tarball: file:apps/mobile/deps/react-native-screens-5.0.0-t3.37.tgz}
- version: 5.0.0-t3.37
+ react-native-screens@file:apps/mobile/deps/react-native-screens-5.0.0-t3.43.tgz:
+ resolution: {integrity: sha512-kknkDmA26Vygu00QP5bThYHiSdbjJNxLncFSLEKC22lCZ7LAzuQJkC44ra53b1VEcP9TPKsQHKK8ateJNvNE2Q==, tarball: file:apps/mobile/deps/react-native-screens-5.0.0-t3.43.tgz}
+ version: 5.0.0-t3.43
peerDependencies:
react: '*'
react-native: '*'
@@ -15618,7 +15618,7 @@ snapshots:
optionalDependencies:
- '@react-navigation/[email protected](patch_hash=990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42)(110925a0d7a34aa12f32b4b743079ccc)':
+ '@react-navigation/[email protected](patch_hash=990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42)(52d9b4ccdf06285c715244e02709d347)':
dependencies:
'@react-navigation/elements': 2.9.45(d8845bac868f4d8a58c8a8f12ad0d4a5)
@@ -15626,7 +15626,7 @@ snapshots:
react: 19.3.0
sf-symbols-typescript: 2.2.0
warn-once: 0.1.1
transitivePeerDependencies:
@@ -21212,7 +21212,7 @@ snapshots:
react: 19.3.0
dependencies:
react: 19.3.0
react-freeze: 1.0.4([email protected])