| ... | @@ -19,13 +19,14 @@ export type { HomeHeaderEnvironment } from "./HomeHeader.types"; | ... | @@ -19,13 +19,14 @@ export type { HomeHeaderEnvironment } from "./HomeHeader.types"; |
| 19 | | 19 | |
| 20 | export function HomeHeader(props: HomeHeaderProps) { | 20 | export function HomeHeader(props: HomeHeaderProps) { |
| 21 | const navigation = useNavigation<NativeStackNavigationProp<ParamListBase>>(); | 21 | const navigation = useNavigation<NativeStackNavigationProp<ParamListBase>>(); |
| 22 | const { panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout(); | 22 | const { layout, panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout(); |
| 23 | const usesNativeMailSearchToolbar = useNativeMailSearchToolbar(); | 23 | const usesNativeMailSearchToolbar = useNativeMailSearchToolbar(); |
| 24 | const primaryColumn = use(NativePrimaryColumnContext); | 24 | const primaryColumn = use(NativePrimaryColumnContext); |
| 25 | const sidebarHeader = | 25 | const sidebarHeader = |
| 26 | Platform.OS === "ios" && | 26 | Platform.OS === "ios" && |
| 27 | primaryColumn !== null && | 27 | primaryColumn !== null && |
| 28 | (Platform.isPad || !usesNativeMailSearchToolbar); | 28 | (Platform.isPad || !usesNativeMailSearchToolbar); |
| | 29 | const showsCompactCompose = Platform.OS === "ios" && Platform.isPad && !layout.usesSplitView; |
| 29 | const searchBarRef = useRef<SearchBarCommands>(null); | 30 | const searchBarRef = useRef<SearchBarCommands>(null); |
| 30 | const focusAfterReveal = useRef(false); | 31 | const focusAfterReveal = useRef(false); |
| 31 | useEffect( | 32 | useEffect( |
| ... | @@ -59,20 +60,35 @@ export function HomeHeader(props: HomeHeaderProps) { | ... | @@ -59,20 +60,35 @@ export function HomeHeader(props: HomeHeaderProps) { |
| 59 | return ( | 60 | return ( |
| 60 | <> | 61 | <> |
| 61 | <NativeStackScreenOptions | 62 | <NativeStackScreenOptions |
| 62 | optionsVersion={filterMenu.items} | 63 | optionsVersion={[filterMenu.items, showsCompactCompose]} |
| 63 | options={{ | 64 | options={{ |
| 64 | // Static header config (glass, title, fonts) lives in Stack.tsx | 65 | // Static header config (glass, title, fonts) lives in Stack.tsx |
| 65 | // (GLASS_HEADER_OPTIONS). Only dynamic values are set here. | 66 | // (GLASS_HEADER_OPTIONS). Only dynamic values are set here. |
| 66 | headerTintColor: iconColor, | 67 | headerTintColor: iconColor, |
| 67 | unstable_headerRightItems: () => | 68 | unstable_headerRightItems: () => |
| 68 | sidebarHeader | 69 | sidebarHeader |
| 69 | ? createSidebarHeaderItems({ | 70 | ? [ |
| 70 | filterIcon: hasCustomListOptions | 71 | ...createSidebarHeaderItems({ |
| 71 | ? "line.3.horizontal.decrease.circle.fill" | 72 | filterIcon: hasCustomListOptions |
| 72 | : "line.3.horizontal.decrease.circle", | 73 | ? "line.3.horizontal.decrease.circle.fill" |
| 73 | filterMenu, | 74 | : "line.3.horizontal.decrease.circle", |
| 74 | onOpenSettings: props.onOpenSettings, | 75 | filterMenu, |
| 75 | }) | 76 | onOpenSettings: props.onOpenSettings, |
| | 77 | }), |
| | 78 | ...(showsCompactCompose |
| | 79 | ? [ |
| | 80 | withNativeGlassHeaderItem({ |
| | 81 | accessibilityLabel: "New task", |
| | 82 | axisBehavior: "horizontalOnly", |
| | 83 | icon: { name: "square.and.pencil", type: "sfSymbol" } as const, |
| | 84 | identifier: "home-new-task", |
| | 85 | label: "", |
| | 86 | onPress: props.onStartNewTask, |
| | 87 | type: "button", |
| | 88 | }), |
| | 89 | ] |
| | 90 | : []), |
| | 91 | ] |
| 76 | : [ | 92 | : [ |
| 77 | withNativeGlassHeaderItem({ | 93 | withNativeGlassHeaderItem({ |
| 78 | accessibilityLabel: "Open settings", | 94 | accessibilityLabel: "Open settings", |