diff --git a/apps/mobile/src/app/_layout.tsx b/apps/mobile/src/app/_layout.tsx index 045489e389..7a19cecff1 100644 --- a/apps/mobile/src/app/_layout.tsx +++ b/apps/mobile/src/app/_layout.tsx @@ -8,7 +8,7 @@ import { import { usePathname } from "expo-router"; import Stack from "expo-router/stack"; import { useCallback } from "react"; -import { StatusBar, useColorScheme } from "react-native"; +import { Platform, StatusBar, useColorScheme } from "react-native"; import { GestureHandlerRootView } from "react-native-gesture-handler"; import { KeyboardProvider } from "react-native-keyboard-controller"; import { SafeAreaProvider } from "react-native-safe-area-context"; @@ -26,6 +26,7 @@ import { useClerkSettingsSheetDetent, } from "../features/cloud/ClerkSettingsSheetDetent"; import { useAgentNotificationNavigation } from "../features/agent-awareness/notificationNavigation"; +import { useHeaderBlurEffect } from "../lib/useHeaderBlurEffect"; import { useThemeColor } from "../lib/useThemeColor"; function AppNavigator() { @@ -45,7 +46,9 @@ function AppNavigatorContent() { const { collapse, isExpanded } = useClerkSettingsSheetDetent(); const colorScheme = useColorScheme(); const statusBarBg = useThemeColor("--color-status-bar"); + const screenColor = useThemeColor("--color-screen"); const sheetStyle = useResolveClassNames("bg-sheet"); + const headerBlurEffect = useHeaderBlurEffect(); useAgentNotificationNavigation(); useThreadOutboxDrain(); @@ -96,12 +99,10 @@ function AppNavigatorContent() { @@ -115,8 +116,11 @@ function AppNavigatorContent() { void; readonly onStartNewTask: () => void; }) { + const headerBlurEffect = useHeaderBlurEffect(); const iconColor = useThemeColor("--color-icon"); const mutedColor = useThemeColor("--color-foreground-muted"); const subtleColor = useThemeColor("--color-subtle"); @@ -88,9 +90,7 @@ export function HomeHeader(props: { headerShown: true, headerTransparent: true, headerStyle: { backgroundColor: "transparent" }, - // Recent iOS betas no longer draw an implicit blur behind - // transparent navigation bars, so request one explicitly. - headerBlurEffect: "systemChromeMaterial", + headerBlurEffect, headerShadowVisible: false, headerTintColor: iconColor, headerTitle: "", diff --git a/apps/mobile/src/features/threads/ThreadRouteScreen.tsx b/apps/mobile/src/features/threads/ThreadRouteScreen.tsx index 390fa9bef3..c16460731b 100644 --- a/apps/mobile/src/features/threads/ThreadRouteScreen.tsx +++ b/apps/mobile/src/features/threads/ThreadRouteScreen.tsx @@ -5,6 +5,7 @@ import { EnvironmentId, type ProjectScript } from "@t3tools/contracts"; import { projectScriptCwd, projectScriptRuntimeEnv } from "@t3tools/shared/projectScripts"; import { Pressable, ScrollView, Text as RNText, View } from "react-native"; import { useWorkspaceState } from "../../state/workspace"; +import { useHeaderBlurEffect } from "../../lib/useHeaderBlurEffect"; import { useThemeColor } from "../../lib/useThemeColor"; import { useEnvironmentQuery } from "../../state/query"; import { dismissGitActionResult, useGitActionProgress } from "../../state/use-vcs-action-state"; @@ -104,6 +105,7 @@ export function ThreadRouteScreen() { const iconColor = String(useThemeColor("--color-icon")); const foregroundColor = String(useThemeColor("--color-foreground")); const secondaryFg = String(useThemeColor("--color-foreground-secondary")); + const headerBlurEffect = useHeaderBlurEffect(); /* ─── Git status for native header trigger ───────────────────────── */ const gitStatus = useEnvironmentQuery( @@ -326,9 +328,7 @@ export function ThreadRouteScreen() { headerShown: true, headerTransparent: true, headerStyle: { backgroundColor: "transparent" }, - // Recent iOS betas no longer draw an implicit blur behind - // transparent navigation bars, so request one explicitly. - headerBlurEffect: "systemChromeMaterial", + headerBlurEffect, headerShadowVisible: false, headerTintColor: iconColor, headerBackTitle: "", diff --git a/apps/mobile/src/lib/useHeaderBlurEffect.ts b/apps/mobile/src/lib/useHeaderBlurEffect.ts new file mode 100644 index 0000000000..94d091479d --- /dev/null +++ b/apps/mobile/src/lib/useHeaderBlurEffect.ts @@ -0,0 +1,15 @@ +import { useColorScheme } from "react-native"; + +/** + * Blur effect for transparent navigation headers. + * + * Recent iOS betas stopped drawing the implicit material behind transparent + * navigation bars, and the trait-adaptive `systemChromeMaterial` resolves to + * its light variant there even while the app renders in dark mode — so pick + * the light/dark variant explicitly from the app color scheme. + */ +export function useHeaderBlurEffect() { + return useColorScheme() === "dark" + ? ("systemChromeMaterialDark" as const) + : ("systemChromeMaterialLight" as const); +}