From 2f4fdfa03ec613d602974ef735882ad6fe1a26fa Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 29 Jun 2026 18:39:43 -0700 Subject: [PATCH] Align iPad thread controls with Mail --- .../features/threads/ThreadGitControls.tsx | 6 +++- .../features/threads/ThreadRouteScreen.tsx | 28 ++++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/apps/mobile/src/features/threads/ThreadGitControls.tsx b/apps/mobile/src/features/threads/ThreadGitControls.tsx index 0c7930eaca..428b560717 100644 --- a/apps/mobile/src/features/threads/ThreadGitControls.tsx +++ b/apps/mobile/src/features/threads/ThreadGitControls.tsx @@ -400,7 +400,11 @@ export function useThreadGitRightHeaderItems(props: ThreadGitControlsProps): Hea } export function useThreadGitCenterHeaderItems(props: ThreadGitControlsProps): HeaderItems { - return useThreadGitHeaderActionItems(props); + const actionItems = useThreadGitHeaderActionItems(props); + return useMemo( + () => [actionItems[1], actionItems[2], actionItems[0]].filter(Boolean) as HeaderItems, + [actionItems], + ); } export function ThreadGitControls(props: ThreadGitControlsProps) { diff --git a/apps/mobile/src/features/threads/ThreadRouteScreen.tsx b/apps/mobile/src/features/threads/ThreadRouteScreen.tsx index 85698b824a..79feffee7e 100644 --- a/apps/mobile/src/features/threads/ThreadRouteScreen.tsx +++ b/apps/mobile/src/features/threads/ThreadRouteScreen.tsx @@ -44,7 +44,7 @@ import { } from "../terminal/terminalLaunchContext"; import { terminalDebugLog } from "../terminal/terminalDebugLog"; import { ThreadDetailScreen } from "./ThreadDetailScreen"; -import { ThreadGitControls, useThreadGitRightHeaderItems } from "./ThreadGitControls"; +import { ThreadGitControls, useThreadGitCenterHeaderItems } from "./ThreadGitControls"; import { GitOverviewSheet } from "./git/GitOverviewSheet"; import { ThreadNavigationDrawer } from "./ThreadNavigationDrawer"; import { useAtomCommand } from "../../state/use-atom-command"; @@ -629,7 +629,7 @@ function ThreadRouteContent( onPull: gitActions.onPullSelectedThreadBranch, onRunAction: gitActions.onRunSelectedThreadGitAction, }; - const threadRightHeaderItems = useThreadGitRightHeaderItems(threadGitControlProps); + const threadCenterHeaderItems = useThreadGitCenterHeaderItems(threadGitControlProps); const splitLeftHeaderItems = useMemo( () => [ ...(props.onReturnToThread @@ -639,7 +639,7 @@ function ThreadRouteContent( icon: { name: "chevron.left", type: "sfSymbol" as const }, identifier: "thread-left-return", onPress: props.onReturnToThread, - sharesBackground: true, + sharesBackground: false, type: "button" as const, width: 58, }, @@ -655,7 +655,7 @@ function ThreadRouteContent( }, identifier: "thread-left-sidebar", onPress: togglePrimarySidebar, - sharesBackground: true, + sharesBackground: false, type: "button" as const, width: 58, }, @@ -664,12 +664,24 @@ function ThreadRouteContent( icon: { name: "square.and.pencil", type: "sfSymbol" as const }, identifier: "thread-left-new-task", onPress: () => router.push("/new"), - sharesBackground: true, + sharesBackground: false, type: "button" as const, width: 58, }, + { + flexible: true, + spacing: 0, + type: "spacing" as const, + }, + ...threadCenterHeaderItems, + ], + [ + panes.primarySidebarVisible, + props.onReturnToThread, + router, + threadCenterHeaderItems, + togglePrimarySidebar, ], - [panes.primarySidebarVisible, props.onReturnToThread, router, togglePrimarySidebar], ); if (!environmentId || !threadId) { @@ -731,10 +743,6 @@ function ThreadRouteContent( : undefined, unstable_headerLeftItems: layout.usesSplitView && Platform.OS === "ios" ? () => splitLeftHeaderItems : undefined, - unstable_headerRightItems: - layout.usesSplitView && Platform.OS === "ios" - ? () => threadRightHeaderItems - : undefined, unstable_navigationItemStyle: usesNativeHeaderGlass ? "editor" : undefined, }} />