@devries-cameron20 / t3code Mirror · read-only / commits / 85d5dc84b3
Fork 0

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, 23:15 UTC

feat(mobile): put Duo thread filtering beside compose in the rail (#18324)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Alex committed Oct 19, 2026 at 21:11 UTC 85d5dc84b38104ecabd4051899a2d1ee6b0231b2
6 files changed +60 -20
apps/mobile/src/features/home/HomeHeader.tsx
+17 -2
@@ -13,7 +13,10 @@ import { createNativeMailSearchToolbarItem } from "../layout/native-mail-search-
13 import { useNativeMailSearchToolbar } from "../../native/use-native-mail-search-toolbar";
14 import { useDeviceType } from "../../native/native-layout-metrics";
15 import { buildHomeListFilterMenu } from "./home-list-filter-menu";
16 -import { createSidebarHeaderItems } from "../threads/sidebar-native-header-items";
16 +import {
17 + createSidebarFilterHeaderItem,
18 + createSidebarHeaderItems,
19 +} from "../threads/sidebar-native-header-items";
20 import type { HomeHeaderProps } from "./HomeHeader.types";
21 import { useAdaptiveWorkspaceLayout } from "../layout/AdaptiveWorkspaceLayout";
22
@@ -58,7 +61,19 @@ export function HomeHeader(props: HomeHeaderProps) {
61 const filterMenu = buildHomeListFilterMenu(props);
62
63 if (props.usesWorkspaceToolbar) {
61 - return null;
64 + return deviceType === "duo-unfolded" ? (
65 + <NativeStackScreenOptions
66 + optionsVersion={filterMenu.items}
67 + options={{
68 + nativeSidebarFilter: createSidebarFilterHeaderItem({
69 + filterIcon: hasCustomListOptions
70 + ? "line.3.horizontal.decrease.circle.fill"
71 + : "line.3.horizontal.decrease.circle",
72 + filterMenu,
73 + }),
74 + }}
75 + />
76 + ) : null;
77 }
78
79 return (
apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
+6
@@ -14,6 +14,7 @@ import {
14 } from "@react-navigation/native";
15 import {
16 NativeStackView,
17 + type NativeStackHeaderItemMenu,
18 type NativeStackNavigationEventMap,
19 type NativeStackNavigationOptions,
20 type NativeStackNavigatorProps,
@@ -62,6 +63,7 @@ function ColumnScreen(props: {
63 readonly primary?: boolean;
64 readonly selectedThreadKey?: string | null;
65 readonly selectedPullRequestKey?: string | null;
66 + readonly sidebarFilter?: NativeStackHeaderItemMenu;
67 readonly onDismiss: (routeKey: string) => void;
68 readonly navigation: ViewProps["navigation"];
69 }) {
@@ -102,6 +104,7 @@ function ColumnScreen(props: {
104 options={descriptor.options}
105 canGoBack={!props.primary}
106 primary={props.primary}
107 + sidebarFilter={props.sidebarFilter}
108 />
109 <ColumnContent
110 primary={props.primary}
@@ -175,6 +178,7 @@ function WorkspaceColumns(
178
179 const primary = props.descriptors[props.primary.key];
180 if (!primary) return null;
181 + const sidebarFilter = (primary.options as AppNativeStackNavigationOptions).nativeSidebarFilter;
182 return (
183 <Split.Host
184 ref={hostRef}
@@ -231,6 +235,7 @@ function WorkspaceColumns(
235 ],
236 }}
237 canGoBack={false}
238 + sidebarFilter={sidebarFilter}
239 />
240 <ColumnContent>
241 <WorkspaceEmptyDetail
@@ -248,6 +253,7 @@ function WorkspaceColumns(
253 descriptor={descriptor}
254 onDismiss={handleNativeDismiss}
255 navigation={props.navigation}
256 + sidebarFilter={sidebarFilter}
257 />
258 ) : null;
259 })}
apps/mobile/src/features/threads/sidebar-native-header-items.ts
+18 -11
@@ -31,23 +31,30 @@ function toNativeHeaderMenuItems(items: HomeListFilterMenu["items"]): NativeHead
31 );
32 }
33
34 +export function createSidebarFilterHeaderItem(input: {
35 + readonly filterIcon: string;
36 + readonly filterMenu: HomeListFilterMenu;
37 +}): NativeStackHeaderItemMenu {
38 + return withNativeGlassHeaderItem({
39 + type: "menu",
40 + axisBehavior: "horizontalOnly",
41 + label: "",
42 + accessibilityLabel: "Filter threads",
43 + icon: sfSymbolIcon(input.filterIcon),
44 + menu: {
45 + title: input.filterMenu.title,
46 + items: toNativeHeaderMenuItems(input.filterMenu.items),
47 + },
48 + });
49 +}
50 +
51 export function createSidebarHeaderItems(input: {
52 readonly filterIcon: string;
53 readonly filterMenu: HomeListFilterMenu;
54 readonly onOpenSettings: () => void;
55 }): NativeStackHeaderItem[] {
56 return [
40 - withNativeGlassHeaderItem({
41 - type: "menu",
42 - axisBehavior: "horizontalOnly",
43 - label: "",
44 - accessibilityLabel: "Filter threads",
45 - icon: sfSymbolIcon(input.filterIcon),
46 - menu: {
47 - title: input.filterMenu.title,
48 - items: toNativeHeaderMenuItems(input.filterMenu.items),
49 - },
50 - }),
57 + createSidebarFilterHeaderItem(input),
58 withNativeGlassHeaderItem({
59 type: "button",
60 axisBehavior: "horizontalOnly",
apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx
+1
@@ -112,6 +112,7 @@ function WorkspaceRootContent() {
112 headerShown: true,
113 unstable_headerLeftItems: () => [],
114 headerTitle: renderHeaderTitle,
115 + ...(state.selectedTab === "threads" ? {} : { nativeSidebarFilter: undefined }),
116 }}
117 />
118 ) : (
apps/mobile/src/native/StackHeader.tsx
+2
@@ -1,5 +1,6 @@
1 import { useNavigation, type ParamListBase } from "@react-navigation/native";
2 import type {
3 + NativeStackHeaderItemMenu,
4 NativeStackNavigationOptions,
5 NativeStackNavigationProp,
6 } from "@react-navigation/native-stack";
@@ -19,6 +20,7 @@ export type AppNativeStackNavigationOptions = Omit<
20 "headerTintColor" | "unstable_headerLeftItems" | "unstable_headerRightItems"
21 > & {
22 readonly nativeContentInsetHorizontally?: boolean;
23 + readonly nativeSidebarFilter?: NativeStackHeaderItemMenu;
24 readonly headerTintColor?: string | ColorValue;
25 readonly unstable_headerCenterItems?: unknown;
26 readonly unstable_headerLeftItems?: unknown;
apps/mobile/src/native/V5StackHeader.ios.tsx
+16 -7
@@ -140,21 +140,30 @@ export function V5StackHeader(props: {
140 readonly options: Options;
141 readonly canGoBack: boolean;
142 readonly primary?: boolean;
143 + readonly sidebarFilter?: NativeStackHeaderItemMenu;
144 }) {
145 const { options } = props;
146 const theme = useMobileNavigationTheme();
147 const nativeMetrics = useNativeLayoutMetrics();
148 const deviceType = useDeviceType();
149 const searchRef = useRef<SearchBarCommands>(null);
150 + const usesDuoToolbarRail =
151 + deviceType === "duo-unfolded" && (nativeMetrics?.verticalBarEdge ?? "none") !== "none";
152 const itemProps = { tintColor: options.headerTintColor, canGoBack: props.canGoBack };
153 const leading = convertItems(options.unstable_headerLeftItems?.(itemProps) ?? [], "leading");
151 - const trailing = convertItems(
152 - [
153 - ...(options.unstable_headerCenterItems?.() ?? []),
154 - ...(options.unstable_headerRightItems?.(itemProps) ?? []),
155 - ],
156 - "trailing",
157 - );
154 + const trailingItems = [
155 + ...(options.unstable_headerCenterItems?.() ?? []),
156 + ...(options.unstable_headerRightItems?.(itemProps) ?? []),
157 + ];
158 + // Keep the sidebar's filter actions when UIKit moves the menu to the detail rail.
159 + if (usesDuoToolbarRail && !props.primary && props.sidebarFilter) {
160 + trailingItems.push({
161 + ...props.sidebarFilter,
162 + identifier: "home-filter",
163 + axisBehavior: "verticalPreferred",
164 + });
165 + }
166 + const trailing = convertItems(trailingItems, "trailing");
167 const toolbar = options.unstable_headerToolbarItems?.() ?? [];
168 const mailSearch = toolbar.find(
169 (item): item is HeaderBarButtonMailSearchToolbarItem => item.type === "mailSearchToolbar",