The best way to control Claude Code, Codex and more from any computer or phone
fix(mobile): Settings split view keeps its selection and its header matches the page (#24644)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 24, 2026 at 20:32 UTC
8fdaf3479cbac39443492386313da7e4680ae3a3
3 files changed
+37
-15
apps/mobile/src/components/ui/ScreenScrollView.tsx
+8
@@ -1,14 +1,22 @@
1
import { createContext, use, type ComponentProps } from "react";
2
import { Platform } from "react-native";
3
+import { cn } from "../../lib/cn";
4
import { NativeScrollView as ScrollView } from "../../native/NativeScrollViewMarker";
5
6
export const ScreenScrollViewBottomInset = createContext(0);
7
+/**
8
+ * The screen's surface class. UIKit's scroll-edge material under the header takes the scroll
9
+ * view's own color; a clear scroll view gets the system's near-white bar over the screen's surface.
10
+ */
11
+export const ScreenScrollViewSurface = createContext<string | undefined>(undefined);
12
13
export function ScreenScrollView(props: ComponentProps<typeof ScrollView>) {
14
const bottomInset = use(ScreenScrollViewBottomInset);
15
+ const surface = use(ScreenScrollViewSurface);
16
return (
17
<ScrollView
18
{...props}
19
+ className={Platform.OS === "ios" && surface ? cn(surface, props.className) : props.className}
20
contentInset={
21
Platform.OS === "ios" && bottomInset > 0
22
? { ...props.contentInset, bottom: (props.contentInset?.bottom ?? 0) + bottomInset }
apps/mobile/src/features/settings/SettingsRouteScreen.tsx
+13
-5
@@ -8,6 +8,8 @@ import {
8
useNavigationTabOrder,
9
useHiddenNavigationTabs,
10
} from "../workspace/navigation-tabs";
11
+import { currentWorkspaceSelections } from "../workspace/workspace-selection-store";
12
+import { rememberedSettingsPage } from "../workspace/workspace-tab-navigation";
13
import { useSelectWorkspaceTab } from "../workspace/useSelectWorkspaceTab";
14
import {
15
ScreenScrollView as ScrollView,
@@ -42,10 +44,14 @@ export function SettingsRouteScreen() {
44
const compactTabs = useCompactWorkspaceTabs();
45
const { layout } = useAdaptiveWorkspaceLayout();
46
const inSidebar = use(NativePrimaryColumnContext) !== null && layout.usesSplitView;
45
- // The page open beside the list: the route right above the Settings tab's route.
47
+ // The page open beside the list: the route right above the Settings tab's route. While
48
+ // another tab is open this list stays mounted, hidden, and must keep showing the page Settings
49
+ // reopens on; otherwise returning shows it unselected for a frame before the page arrives.
50
const selected = useNavigationState((state) => {
51
const list = state.routes.findIndex((route) => route.name === "Settings");
48
- return list < 0 ? null : (state.routes[list + 1]?.name ?? null);
52
+ return list < 0
53
+ ? rememberedSettingsPage(currentWorkspaceSelections())
54
+ : (state.routes[list + 1]?.name ?? null);
55
});
56
const sidebar = useMemo(() => (inSidebar ? { selected } : null), [inSidebar, selected]);
57
const content = hasCloudPublicConfig() ? (
@@ -56,7 +62,7 @@ export function SettingsRouteScreen() {
62
63
return (
64
<SettingsSidebarContext value={sidebar}>
59
- <View className={`flex-1 ${surface.className}`}>
65
+ <View className={`flex-1 ${inSidebar ? surface.className : "bg-screen"}`}>
66
<SettingsEnvironmentFilterHeader />
67
<ScreenScrollViewBottomInset value={deviceType === "pad" || compactTabs ? 80 : 0}>
68
{Platform.OS === "android" ? (
@@ -75,7 +81,8 @@ export function SettingsRouteScreen() {
81
function ConfiguredSettingsRouteScreen() {
82
// UIKit's scroll-edge material takes the scroll view's own color; like the chat list, match
83
// the sidebar's surface so the bar doesn't darken over content at rest.
78
- const listSurface = use(NativePrimaryColumnContext) ? "bg-drawer" : "bg-screen";
84
+ // Grouped cards only lift off the screen surface; the drawer is as dark as they are.
85
+ const listSurface = use(SettingsSidebarContext) ? "bg-drawer" : "bg-screen";
86
const insets = useSafeAreaInsets();
87
const navigation = useNavigation();
88
const { isLoaded, isSignedIn } = useAuth({ treatPendingAsSignedOut: false });
@@ -124,7 +131,8 @@ function ConfiguredSettingsRouteScreen() {
131
function LocalSettingsRouteScreen() {
132
// UIKit's scroll-edge material takes the scroll view's own color; like the chat list, match
133
// the sidebar's surface so the bar doesn't darken over content at rest.
127
- const listSurface = use(NativePrimaryColumnContext) ? "bg-drawer" : "bg-screen";
134
+ // Grouped cards only lift off the screen surface; the drawer is as dark as they are.
135
+ const listSurface = use(SettingsSidebarContext) ? "bg-drawer" : "bg-screen";
136
const insets = useSafeAreaInsets();
137
const { savedConnectionsById } = useSavedRemoteConnections();
138
const environmentCount = Object.keys(savedConnectionsById).length;
apps/mobile/src/features/settings/components/SettingsScreen.tsx
+16
-10
@@ -9,7 +9,10 @@ import { useWorkspaceTabs } from "../../workspace/WorkspaceTabsContext";
9
import { useWorkspaceSurface } from "../../workspace/useWorkspaceSurface";
10
import { useDeviceType } from "../../../native/native-layout-metrics";
11
import { useCompactWorkspaceTabs } from "../../workspace/useSystemWorkspaceTabBar";
12
-import { ScreenScrollViewBottomInset } from "../../../components/ui/ScreenScrollView";
12
+import {
13
+ ScreenScrollViewBottomInset,
14
+ ScreenScrollViewSurface,
15
+} from "../../../components/ui/ScreenScrollView";
16
17
export { SettingsScreenContent };
18
@@ -32,11 +35,12 @@ export function SettingsScreen(
35
props.workspaceRoot ||
36
(Platform.OS === "android" && workspace !== null && route.name === "Settings");
37
38
+ // Settings' grouped cards only lift off the screen surface, so the folded Duo doesn't take
39
+ // the workspace's drawer surface here.
40
+ const surfaceClassName = cover ? "bg-screen" : workspaceRoot ? surface.className : "bg-sheet";
41
+
42
return (
36
- <View
37
- collapsable={false}
38
- className={`flex-1 ${workspaceRoot || cover ? surface.className : "bg-sheet"}`}
39
- >
43
+ <View collapsable={false} className={`flex-1 ${surfaceClassName}`}>
44
<AppBar
45
title={props.title}
46
actions={props.actions}
@@ -46,11 +50,13 @@ export function SettingsScreen(
50
hideBottomBorder={!props.formSheet}
51
/>
52
<ScreenScrollViewBottomInset value={deviceType === "pad" || compactTabs ? 80 : 0}>
49
- {props.formSheet ? (
50
- props.children
51
- ) : (
52
- <SettingsScreenContent>{props.children}</SettingsScreenContent>
53
- )}
53
+ <ScreenScrollViewSurface value={surfaceClassName}>
54
+ {props.formSheet ? (
55
+ props.children
56
+ ) : (
57
+ <SettingsScreenContent>{props.children}</SettingsScreenContent>
58
+ )}
59
+ </ScreenScrollViewSurface>
60
</ScreenScrollViewBottomInset>
61
</View>
62
);