Skip to content

Commit e702f07

Browse files
fix(mobile): pin the Duo sidebar control and add it to pull request headers
Compose moves back to the trailing group on the unfolded Duo, so the sidebar toggle no longer shifts when compose is hidden. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3cde6a9 commit e702f07

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function WorkspaceColumns(
189189
const selectedTab = useWorkspaceTabs()?.state.selectedTab;
190190
const openNewTask = startNewTask;
191191
// The cover detail rail needs room for thread tools above the fixed tabs.
192-
// The unfolded Duo keeps compose beside its sidebar control.
192+
// The unfolded Duo keeps compose in its detail bar.
193193
const detailCompose =
194194
deviceType === "duo-unfolded" && selectedTab !== "pullRequests" ? openNewTask : undefined;
195195
const inspector = use(NativeWorkspaceInspectorContext);

‎apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import { AndroidScreenHeader } from "../../components/ui/AndroidScreenHeader";
6363
import { useAndroidControlSizing } from "../../components/ui/useAndroidControlSizing";
6464
import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
6565
import { AndroidWorkspaceSidebarButton } from "../layout/workspace-sidebar-toolbar";
66+
import { useWorkspaceSidebarHeaderItem } from "../layout/useWorkspaceSidebarHeaderItem";
6667
import { useAndroidWorkspaceBack } from "../workspace/useAndroidWorkspaceNavigation";
6768
import { EmptyState } from "../../components/ui/EmptyState";
6869
import { SegmentedControl } from "../../components/ui/SegmentedControl";
@@ -273,6 +274,7 @@ function usePullRequestToolbarHeight(bottomInset: number) {
273274
export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestParams>) {
274275
const returnToList = useAndroidWorkspaceBack("pullRequests");
275276
const { layout } = useAdaptiveWorkspaceLayout();
277+
const sidebarHeaderItem = useWorkspaceSidebarHeaderItem();
276278
const navigation = useNavigation();
277279
const insets = useSafeAreaInsets();
278280
const [toolbarHeight, setToolbarHeight] = usePullRequestToolbarHeight(insets.bottom);
@@ -397,7 +399,9 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
397399
unstable_headerSubtitle: connected
398400
? params.repository
399401
: `${params.repository} · Offline`,
402+
unstable_headerLeftItems: layout.usesSplitView ? () => [sidebarHeaderItem] : undefined,
400403
}}
404+
optionsVersion={[layout.usesSplitView, sidebarHeaderItem]}
401405
/>
402406
{Platform.OS === "android" ? (
403407
<AndroidScreenHeader

‎apps/mobile/src/native/V5StackHeader.ios.tsx‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,9 @@ export function V5StackHeader(props: {
227227
icon: { type: "sfSymbol", name: "square.and.pencil" },
228228
onPress: props.onCompose,
229229
};
230-
if (deviceType === "duo-unfolded") {
231-
if (leading.length)
232-
leading.unshift({ type: "spacer", id: "compose-group", sizing: "fixed", width: 8 });
233-
leading.unshift(compose);
234-
} else {
235-
if (trailing.length)
236-
trailing.push({ type: "spacer", id: "compose-group", sizing: "fixed", width: 8 });
237-
trailing.push(compose);
238-
}
230+
if (trailing.length)
231+
trailing.push({ type: "spacer", id: "compose-group", sizing: "fixed", width: 8 });
232+
trailing.push(compose);
239233
}
240234
const left = options.headerLeft?.(itemProps);
241235
const right = options.headerRight?.(itemProps);

0 commit comments

Comments
 (0)