-
-
Notifications
You must be signed in to change notification settings - Fork 638
feat(iOS, Stack v5): Align Stack implementation with RFC 753 #3774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
bc2274d
Create a separate folder for new implementation
kmichalikk aa39e1f
Add RNSStackOperation
kmichalikk bf9b68f
Simplify StackHost & add operation coordinator
kmichalikk a765d55
Use operation coordinator in host
kmichalikk 8be5479
Execute stack operations on navigation controller
kmichalikk 8ba3ed3
Rewrite screen controller to obj-c and integrate with new implementation
kmichalikk 341be5f
move stack-queue to stack
kmichalikk 37fe3c1
Make queue operations work
kmichalikk 5997ca6
refactor
kmichalikk 33951f7
add logs & refactor
kmichalikk d8f1fb1
Move isNativelyDismissed, refactor log
kmichalikk 83d0702
Revert App.tsx
kmichalikk 81446b4
Add asserts for correct screen type
kmichalikk 4f3ea97
Move RNSStackOperation implementation to correct dir
kmichalikk e69ed78
Fix Copilot catches
kmichalikk 7f15694
simplify sorting
kmichalikk 1e8d43e
fix nonull, noop and RNSLog
kmichalikk 2571b25
Change logged tags, remove unnecessary code
kmichalikk 83d747c
Add assertion in `reactAddControllerToClosestParent`
kkafar afdfc5d
Fix for the issue with pushing screens that are mid-dismissal
kkafar 1b0a8db
Add nonnill assertion
kkafar 86346d0
fix(ios): add assertion for unexpected activityMode in stack host
kkafar 69e32cf
refactor(ios): reorganize stack host methods into pragma sections
kkafar d62f256
refactor(ios): replace RNSStackOperation protocol with base class
kkafar 26d29e6
fix: prevent pop action on non-top attached screen
kkafar ce86bd2
Add simple navigation scenario to test the changes
kkafar 433bab4
refactor(ios): move isNativelyDismissed to public interface
kkafar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
97 changes: 97 additions & 0 deletions
97
apps/src/tests/single-feature-tests/stack-v5/test-stack-simple-nav/index.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| import React from 'react'; | ||
| import type { Scenario } from '@apps/tests/shared/helpers'; | ||
| import { StyleSheet, Text, View } from 'react-native'; | ||
| import { | ||
| StackContainer, | ||
| useStackNavigationContext, | ||
| } from '@apps/shared/gamma/containers/stack'; | ||
| import { CenteredLayoutView } from '@apps/shared/CenteredLayoutView'; | ||
| import Colors from '@apps/shared/styling/Colors'; | ||
| import { StackNavigationButtons } from '@apps/tests/shared/components/stack-v5/StackNavigationButtons'; | ||
|
|
||
| const SCENARIO: Scenario = { | ||
| name: 'Simple navigation scenario', | ||
| key: 'test-stack-simple-nav', | ||
| details: | ||
| 'Test simple push and pop operations', | ||
| platforms: ['android', 'ios'], | ||
| AppComponent: App, | ||
| }; | ||
|
|
||
| export default SCENARIO; | ||
|
|
||
| export function App() { | ||
| return ( | ||
| <StackSetup /> | ||
| ); | ||
| } | ||
|
|
||
| function StackSetup() { | ||
| return ( | ||
| <StackContainer | ||
| routeConfigs={[ | ||
| { | ||
| name: 'Home', | ||
| Component: HomeScreen, | ||
| options: {}, | ||
| }, | ||
| { | ||
| name: 'A', | ||
| Component: AScreen, | ||
| options: {}, | ||
| }, | ||
| { | ||
| name: 'B', | ||
| Component: BScreen, | ||
| options: {}, | ||
| }, | ||
| ]} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| function HomeScreen() { | ||
| return ( | ||
| <CenteredLayoutView style={{ backgroundColor: Colors.BlueLight40 }}> | ||
| <RouteInformation routeName="Home" /> | ||
| <StackNavigationButtons isPopEnabled={false} routeNames={['A', 'B']} /> | ||
| </CenteredLayoutView> | ||
| ); | ||
| } | ||
|
|
||
| function AScreen() { | ||
| return ( | ||
| <CenteredLayoutView style={{ backgroundColor: Colors.YellowLight40 }}> | ||
| <RouteInformation routeName="A" /> | ||
| <StackNavigationButtons isPopEnabled={true} routeNames={['A', 'B']} /> | ||
| </CenteredLayoutView> | ||
| ); | ||
| } | ||
|
|
||
| function BScreen() { | ||
| return ( | ||
| <CenteredLayoutView style={{ backgroundColor: Colors.GreenLight100 }}> | ||
| <RouteInformation routeName="B" /> | ||
| <StackNavigationButtons isPopEnabled={true} routeNames={['A', 'B']} /> | ||
| </CenteredLayoutView> | ||
| ); | ||
| } | ||
|
|
||
| function RouteInformation(props: { routeName: string }) { | ||
| const routeKey = useStackNavigationContext().routeKey; | ||
|
|
||
| return ( | ||
| <View> | ||
| <Text style={styles.routeInformation}>Name: {props.routeName}</Text> | ||
| <Text style={styles.routeInformation}>Key: {routeKey}</Text> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| routeInformation: { | ||
| color: 'black', | ||
| fontSize: 20, | ||
| fontWeight: 'bold', | ||
| }, | ||
| }); |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,12 @@ | ||
| #pragma once | ||
|
|
||
| #import "RNSReactBaseView.h" | ||
|
|
||
| @class RNSStackController; | ||
| @class RNSStackScreenComponentView; | ||
| #import "RNSStackScreenComponentView.h" | ||
|
|
||
| NS_ASSUME_NONNULL_BEGIN | ||
|
|
||
| @interface RNSStackHostComponentView : RNSReactBaseView | ||
|
|
||
| @property (nonatomic, nonnull, strong, readonly) RNSStackController *stackController; | ||
|
|
||
| - (nonnull NSMutableArray<RNSStackScreenComponentView *> *)reactSubviews; | ||
|
|
||
|
Comment on lines
-12
to
-15
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These weren't used outside the implementation or anywhere |
||
| @end | ||
|
|
||
| #pragma mark - Communication with StackScreen | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.