diff --git a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx index c8104f9f4b1a..e642754a013b 100644 --- a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx +++ b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx @@ -247,6 +247,7 @@ function WorkspaceStackView(props: ViewProps) { const routes = [baseRoute, ...overlays.map((group) => group[0]!)]; return ( { const descriptor = descriptors[route.key] ?? preloadedDescriptors[route.key]; const isFocused = state.index === index; +@@ -386,6 +403,7 @@ export function NativeStackView({ + // due to component being unmounted. To avoid this, we don't freeze the previous screen there + const shouldFreeze = isFabric() ? !isPreloaded && !isFocused && !isBelowFocused && !isModalOnIos : !isPreloaded && !isFocused && !isModalOnIos; + return /*#__PURE__*/_jsx(SceneView, { ++ presentationEnvelope, + index: index, + focused: isFocused, + shouldFreeze: shouldFreeze, diff --git a/lib/module/views/useHeaderConfigProps.js b/lib/module/views/useHeaderConfigProps.js index 9c21aa48cb580704aa17e59d9cdadcc612a1e4ff..a1b3a38368c5ef2257570f382e87df5d6f55b11e 100644 --- a/lib/module/views/useHeaderConfigProps.js @@ -189,3 +228,110 @@ index 3f3fff405048b3c2250afbe99dd7f35cecb9a6d5..bb062b898cfa77f8c02f951dc9d81b51 > {item.element} +diff --git a/lib/typescript/src/views/NativeStackView.native.d.ts b/lib/typescript/src/views/NativeStackView.native.d.ts +index c0d37db3b4a2a4e9340c76333821f44a87cd624b..eb3db8f511799b335a17edea31a2acd17627f909 100644 +--- a/lib/typescript/src/views/NativeStackView.native.d.ts ++++ b/lib/typescript/src/views/NativeStackView.native.d.ts +@@ -1,11 +1,12 @@ + import { type ParamListBase, type RouteProp, type StackNavigationState } from '@react-navigation/native'; + import type { NativeStackDescriptor, NativeStackDescriptorMap, NativeStackNavigationHelpers } from '../types.js'; + type Props = { ++ presentationEnvelope?: boolean; + state: StackNavigationState; + navigation: NativeStackNavigationHelpers; + descriptors: NativeStackDescriptorMap; + describe: (route: RouteProp, placeholder: boolean) => NativeStackDescriptor; + }; +-export declare function NativeStackView({ state, navigation, descriptors, describe, }: Props): import("react/jsx-runtime").JSX.Element; ++export declare function NativeStackView({ presentationEnvelope, state, navigation, descriptors, describe, }: Props): import("react/jsx-runtime").JSX.Element; + export {}; + //# sourceMappingURL=NativeStackView.native.d.ts.map +\ No newline at end of file +diff --git a/src/views/NativeStackView.native.tsx b/src/views/NativeStackView.native.tsx +index 416cd90057cea362371a4308dd9985b086c5ccaa..7188a3daf0af2004303b21f89d3c0c7073517ef8 100644 +--- a/src/views/NativeStackView.native.tsx ++++ b/src/views/NativeStackView.native.tsx +@@ -51,7 +51,14 @@ function isFabric() { + return 'nativeFabricUIManager' in global; + } + ++// A presentation envelope contains descriptors from its owning navigator. ++// Its synthetic route must not override those descriptors' focus state. ++function SceneNavigationProvider({ presentationEnvelope, ...props }: React.ComponentProps & { presentationEnvelope?: boolean }) { ++ return presentationEnvelope ? props.children : ; ++} ++ + type SceneViewProps = { ++ presentationEnvelope?: boolean; + index: number; + focused: boolean; + shouldFreeze: boolean; +@@ -74,6 +81,7 @@ type SceneViewProps = { + const useNativeDriver = Platform.OS !== 'web'; + + const SceneView = ({ ++ presentationEnvelope, + index, + focused, + shouldFreeze, +@@ -356,7 +364,7 @@ const SceneView = ({ + ); + + return ( +- ++ + + + +- ++ + ); + }; + + type Props = { ++ presentationEnvelope?: boolean; + state: StackNavigationState; + navigation: NativeStackNavigationHelpers; + descriptors: NativeStackDescriptorMap; +@@ -508,6 +517,7 @@ type Props = { + }; + + export function NativeStackView({ ++ presentationEnvelope, + state, + navigation, + descriptors, +@@ -555,6 +565,7 @@ export function NativeStackView({ + + return ( + ; + navigation: NativeStackNavigationHelpers; + descriptors: NativeStackDescriptorMap; +diff --git a/src/views/NativeStackView.tsx b/src/views/NativeStackView.tsx +--- a/src/views/NativeStackView.tsx ++++ b/src/views/NativeStackView.tsx +@@ -24,6 +24,7 @@ + import { AnimatedHeaderHeightContext } from '../utils/useAnimatedHeaderHeight'; + + type Props = { ++ presentationEnvelope?: boolean; + state: StackNavigationState; + // This is used for the native implementation of the stack. + navigation: NativeStackNavigationHelpers; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index edc6c3e9a99a..3efe8d3a8ffa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -139,7 +139,7 @@ patchedDependencies: '@pierre/diffs@1.5.2': b33a575eb1382270ed0df956307e4b6ffe4b8e4349cefeb43e14f648c0fdc3b0 '@react-native-ai/apple@0.12.0': 2d09870c2848d185cb05b53ed823a46e12dba519324d8dd8e584e28731990f9d '@react-native-menu/menu@2.0.0': a4866ecfcd44f318043de839d20110c17e14909004900f002ffe12050376f2ba - '@react-navigation/native-stack@7.17.6': e667c3cef8c78bb9ff4882ee5bd23a432247b843060a9499eb5f07e9e2295552 + '@react-navigation/native-stack@7.17.6': 3a53ec9b92f5db5f083f3ada585da75d62a13c82250c6ae47d92be91a828ad87 alchemy@2.0.0-beta.80: bea1b6c0c0b23157fd5f439a1d7feff430f28ac1621ba135d8a13eeec60ccacd dbus-next@0.10.2: cfff57561b0ee59b5addb3b2e6c6f20906e967507a530ab67e8db8108e520ba4 effect@4.0.1: a33cba07c41f32374c2aaa86ea4a84d3ab9a872a78c94b65e929b19f8361856f @@ -325,7 +325,7 @@ importers: version: 7.3.4(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0) '@react-navigation/native-stack': specifier: 7.17.6 - version: 7.17.6(patch_hash=e667c3cef8c78bb9ff4882ee5bd23a432247b843060a9499eb5f07e9e2295552)(141a742cd91f55378cde709a48a3af06) + version: 7.17.6(patch_hash=3a53ec9b92f5db5f083f3ada585da75d62a13c82250c6ae47d92be91a828ad87)(141a742cd91f55378cde709a48a3af06) '@shikijs/core': specifier: 4.2.0 version: 4.2.0 @@ -15374,7 +15374,7 @@ snapshots: optionalDependencies: '@react-native-masked-view/masked-view': 0.3.2(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0) - '@react-navigation/native-stack@7.17.6(patch_hash=e667c3cef8c78bb9ff4882ee5bd23a432247b843060a9499eb5f07e9e2295552)(141a742cd91f55378cde709a48a3af06)': + '@react-navigation/native-stack@7.17.6(patch_hash=3a53ec9b92f5db5f083f3ada585da75d62a13c82250c6ae47d92be91a828ad87)(141a742cd91f55378cde709a48a3af06)': dependencies: '@react-navigation/elements': 2.9.26(83de68753219ecf7f3321e065bd378be) '@react-navigation/native': 7.3.4(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)