refactor(test): Add scenario for Stack v5 preventNativeDismiss with nested stack#4279
Merged
LKuchno merged 11 commits intoJul 17, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Stack v5 manual-test scenario screen to the example app for validating preventNativeDismiss behavior in a nested stack setup on Android, and wires it into the Stack v5 single-feature test registry.
Changes:
- Added a new Stack v5 scenario screen implementing an outer stack + nested stack configuration with toasts and a runtime toggle for
preventNativeDismiss. - Added a comprehensive manual test
scenario.mddescribing expected behavior and step-by-step validation across nested stack levels. - Updated the Stack v5 scenario registry import/export to point at the renamed
test-stack-prevent-native-dismiss-nested-stackdirectory.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/src/tests/single-feature-tests/stack-v5/test-stack-prevent-native-dismiss-nested-stack/scenario.md | Adds a detailed manual test scenario for nested-stack native dismiss prevention behavior. |
| apps/src/tests/single-feature-tests/stack-v5/test-stack-prevent-native-dismiss-nested-stack/scenario-description.ts | Introduces scenario metadata (name/key/platforms/e2eCoverage). |
| apps/src/tests/single-feature-tests/stack-v5/test-stack-prevent-native-dismiss-nested-stack/index.tsx | Implements the nested-stack test UI and behaviors (toasts + toggling). |
| apps/src/tests/single-feature-tests/stack-v5/index.ts | Updates scenario registry imports/exports to the renamed scenario directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LKuchno
marked this pull request as ready for review
July 7, 2026 07:49
…610e Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LKuchno
marked this pull request as draft
July 7, 2026 08:57
…id for back gesture and back button options
LKuchno
marked this pull request as ready for review
July 7, 2026 12:38
… dont relay on Key route format - just check number relations
…ns into @lkuchno/test-stack-prevent-native-dismiss-nested-stack
kkafar
approved these changes
Jul 17, 2026
…ns into @lkuchno/test-stack-prevent-native-dismiss-nested-stack
LKuchno
deleted the
@lkuchno/test-stack-prevent-native-dismiss-nested-stack
branch
July 17, 2026 14:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1603
Adds a comprehensive manual test scenario for the
test-stack-prevent-native-dismiss-nested-stackgamma/v5 Stack test screen, which exercisespreventNativeDismissacross a Stack nested inside another Stack. It also renames the test directory to follow the repo'stest-*naming convention.The scenario documents the Android-only behavior across both flag states:
Native dismiss prevented - B/- NestedHome/- NestedB), and the screen stays put — including at the root of the nested stack, where interception blocks exiting back into the parent stack.BbelowNestedStack→NestedHome), only the current top screen intercepts, confirmed by which toast appears.To exercise the native-back / gesture-back flows on Android, the scenario uses the direct launch: the screen is rendered as the root component via
apps/App.tsx(TestStackPreventNativeDismissNestedStack as Example). With the gammaStackContainerat the root, native back and gesture-back interact with the stack directly, which works around #1459 (where, when nested inside the example app's own navigation, native back navigates out to the system menu instead of popping). This replaces the earlier limitation where disabled-flag native-back steps had to be deferred — they are now covered.Android-only feature; the scenario is not runnable on iOS.
Changes
prevent-native-dismiss-nested-stack/totest-stack-prevent-native-dismiss-nested-stack/(aligns with thetest-*convention) and updated its registration/import paths inapps/src/tests/single-feature-tests/stack-v5/index.ts.scenario.mdforpreventNativeDismissacross nested Stack containers: direct-launch Android setup, enabled-state interception (header chevron + gesture-back) at outer, nested-root, and nested non-root screens, disabled-state native-back pop (within-stack and nested-root bubbling), the always-works on-screen Pop, runtime flag toggling, and a layered-prevention edge case across nesting levels. The #1459 direct-launch workaround is documented in the scenario's Note.