-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Migrate E/App to use PlatformStackNavigation
#49937
Migrate E/App to use PlatformStackNavigation
#49937
Conversation
@srikarparsi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
PlatformStackNavigation
in E/App (introduce native-stack
navigation on native)PlatformStackNavigation
in E/App (introduce native-stack
navigation on mobile)
PlatformStackNavigation
in E/App (introduce native-stack
navigation on mobile)PlatformStackNavigation
PlatformStackNavigation
PlatformStackNavigation
3b921d3
to
5701c46
Compare
Re-assigning to @chiragsalian and @mountiny for review since it looks like they have more context. |
@mountiny or @chiragsalian please from now on create ad-hoc builds from here. I fixed all remaining reported errors yesterday, so we can probably trigger a new build already. |
This comment has been minimized.
This comment has been minimized.
The ad-hoc iOS build fail is also going to be related to the patch from #49936 |
@mountiny Please run adhoc builds here when you have a moment, i plan to work on testing this fully today |
Running |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
The PR didn't have the changes to the |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
@chrispader Looking great! I think there are two things I have noticed:
|
package-lock.json
Outdated
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.
commenting so this shows on my k2 for easy access
@mountiny Both bugs are fixed! I couldn't really see a difference between Stack navigator and Native-Stack while testing in this PR: (you meant when clicking on an item in the Sidebar right?) StackSimulator.Screen.Recording.-.iPhone.15.Pro.-.2024-10-06.at.17.38.30.mp4Native StackSimulator.Screen.Recording.-.iPhone.15.Pro.-.2024-10-06.at.20.09.51.mp4 |
I will be OOO the next week, but i will hand this over to one of our other Margelo engineers. If there are any urgent issues i can also help with that, but i'm not gonna be on my Macbook unfortunately |
I am now available for around ~2 hours i'll pull and start testing this locally |
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.
Changes look good to me, its a massive pr and effort that spanned many months.
The latest changes been thoroughly tested by @ishpaul777 and @c3024 and also by @staszekscp in the Hybrid app and no issues been found so I dont think we should prolong this further and we should pull the trigger.
The ELint is expected to fail with no migration to useOnyx |
@kirillzyusko @hannojg @chrispader can you please fix the prettier and lint (other than the useOnyx) |
@mountiny looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Eslint failing because of the useOnyx migration |
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.69-1 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.0.69-4 🚀
|
}, | ||
onboardingModalNavigator: { | ||
web: { | ||
presentation: Presentation.TRANSPARENT_MODAL, |
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.
This line caused #53342 as the setting should be applied on all platform not just web.
@@ -190,7 190,7 @@ function TagSettingsPage({route, navigation}: TagSettingsPageProps) { | |||
/> | |||
{approverDisabled && ( | |||
<Text style={[styles.flexRow, styles.alignItemsCenter, styles.mv2, styles.mh5]}> | |||
<Text style={[styles.textLabel, styles.colorMuted]}>{translate('workspace.rules.categoryRules.goTo')}</Text>{' '} | |||
<Text style={[styles.textLabel, styles.colorMuted]}>{translate('workspace.rules.categoryRules.goTo')}</Text> |
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.
Coming from the checklist in #53358, we need to add spacing in this case
// We need to separately reset state of this navigator to trigger getRehydratedState. | ||
navigation.reset(navigation.getState()); | ||
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps | ||
navigationRef.resetRoot(navigationRef.getRootState()); |
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.
Coming from #53395, after this change, the FullScreenNavigator
state could not be reset because this navigator is nested in rootState
, so we revert this change and introduce a new useNavigationResetRootOnLayoutChange
// Whether the active workspace or the "Everything" page is loaded | ||
const isWorkspaceOrEverythingLoaded = !!activeWorkspace || activeWorkspaceID === undefined; | ||
|
||
// If we are currently switching workspaces, we don't want to do anything until the target workspace is loaded | ||
if (isSwitchingWorkspace.current) { | ||
if (isWorkspaceOrEverythingLoaded) { | ||
isSwitchingWorkspace.current = false; | ||
} | ||
return; | ||
} | ||
|
||
// Otherwise, if the workspace is already loaded, we don't need to do anything | ||
if (isWorkspaceOrEverythingLoaded) { | ||
return; | ||
} | ||
|
||
isSwitchingWorkspace.current = true; |
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.
This change caused issue App is closed when switching workspace and using device back button.. This changed was reverted and the fix #54030 runs dispatching the navigation action in InteractionManager.runAfterInteractions.
@mountiny @ishpaul777 @chiragsalian
Details
This PR migrates the App to use
PlatformStackNavigation
types and navigator components implemented in #37891Fixed Issues
$ #29948
PROPOSAL: #37891 (comment)
Tests
Open app
press on search filed
be sure that:
close screen
open any chat
tap on composer
go to previous screen
be sure there is no keyboard jumps on previous screen -> [HOLD for payment 2024-10-17] [HOLD for payment 2024-06-06] [HOLD #37891] Keyboard jumps around when swiping back from chat to LHN with gesture #37923
open chat again
tap on task
tap on Assignee
be sure there is no infinite loading for the screen -> [HOLD for payment 2024-03-07] Android - Task-Tapping assignee shows infinite loading page #37252
go back to task
tap on Title
be sure keyboard is opened automatically -> [HOLD for payment 2024-03-07] [$500] Android - Task - Keyboard does not open after selecting task title #37273
go back to main page
tap on user avatar (to open Account settings)
tap on wallet, tap on "Add bank account"
tap on "Debit card"
be sure keyboard gets opened automatically -> [HOLD for payment 2024-03-07] [$500] Android - Wallet - The keyboard does not open automatically when the debit card is opened #37325
go back to main page
press " " in TabBar
tap Request Money
enter any amount
press "Next"
be sure that on participant screen keyboard appears from the bottom -> [HOLD for payment 2024-03-07] [$500] IOU - Keyboard comes out from right to left on participant screen #37257
Verify that no errors appear in the JS console
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.Nov.26.2024.Expensify.Dev.mp4
Android: mWeb Chrome
android.web.webm
iOS: Native
ScreenRecording_11-26-2024.15-56-14_1.MP4
iOS: mWeb Safari
Running mWeb in iOS simulator is currently not possible due to this issue:
MacOS: Chrome / Safari
Screen.Recording.2024-11-26.at.15.32.29.mov
MacOS: Desktop
Screen.Recording.2024-11-26.at.15.43.23.mov