Skip to content

Commit 89ec2bb

Browse files
fix(mobile): Settings pages no longer flicker when switching beside the list
Swapping pages in the shared Settings slot remounted the column wrapper, so each new page drew one frame before the column's safe-area insets and metrics were measured again, shifted sideways. The wrapper now stays mounted and only the page inside it remounts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 8c0670b commit 89ec2bb

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

‎apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ import {
1919
type NativeStackNavigatorProps,
2020
type NativeStackTypeBag,
2121
} from "@react-navigation/native-stack";
22-
import { use, useCallback, useEffect, useMemo, useRef, useState, type ComponentProps } from "react";
22+
import {
23+
Fragment,
24+
use,
25+
useCallback,
26+
useEffect,
27+
useMemo,
28+
useRef,
29+
useState,
30+
type ComponentProps,
31+
} from "react";
2332
import { View } from "react-native";
2433
import { Split, type SplitHostCommands } from "react-native-screens";
2534
import { EnvironmentId, ThreadId } from "@t3tools/contracts";
@@ -158,14 +167,14 @@ function ColumnScreen(props: {
158167
}
159168
/>
160169
<ColumnContent
161-
key={key}
162170
primary={props.primary}
163171
insetHorizontally={
164172
(options as AppNativeStackNavigationOptions).nativeContentInsetHorizontally
165173
}
166174
>
167175
<NativePrimaryColumnContext value={primaryColumn}>
168-
{descriptor.render()}
176+
{/* The Settings slot swaps pages here; its column keeps its measured insets. */}
177+
<Fragment key={key}>{descriptor.render()}</Fragment>
169178
</NativePrimaryColumnContext>
170179
</ColumnContent>
171180
</NavigationRouteContext>

0 commit comments

Comments
 (0)