Skip to content
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

Upgrade react-navigation to 6.x #3078

Merged
merged 18 commits into from
Jun 8, 2021
Merged

Upgrade react-navigation to 6.x #3078

merged 18 commits into from
Jun 8, 2021

Conversation

tugbadogan
Copy link
Contributor

@tugbadogan tugbadogan commented May 22, 2021

@marcaaron @parasharrajat

Details

Upgrade react-navigation to 6.x and reanimated library to 2.x to resolve issues caused by legacy drawer and animation implementations.

Fixed Issues

Fixes #2180 and #2447

Tests

Tested navigating between chats and other pages like settings, search and made sure they work as expected.

On mobile devices changed device orientation and observed that the components are positioned properly.

QA Steps

  • Login to expensify.cash
  • Navigate between chats and access all other pages (Search, settings, user profiles)
  • Check if chats are visible on the background when modal pages are opened
  • Verify that navigation and page animations are the same as the production

Try to reproduce these issues as instructed in the issue descriptions

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screen.Recording.2021-06-06.at.22.52.33-3.mov

Mobile Web

Screen.Recording.2021-06-06.at.22.56.58.mov

Desktop

Untitled.mp4

iOS

Screen.Recording.2021-05-22.at.17.06.10-2.mov

Android

Screen.Recording.2021-05-22.at.17.34.32-3.mov

@tugbadogan tugbadogan requested a review from a team as a code owner May 22, 2021 15:13
@MelvinBot MelvinBot requested review from Jag96 and removed request for a team May 22, 2021 15:14
@tugbadogan tugbadogan changed the title [DRAFT] 00Upgrade react-navigation to 6.x [DRAFT] Upgrade react-navigation to 6.x May 22, 2021
@tugbadogan
Copy link
Contributor Author

Only problem we have right now is that opening modals in web and desktop hides chat window in the background. It shows gray background instead. I'm trying to resolve it now.

@tugbadogan tugbadogan changed the title [DRAFT] Upgrade react-navigation to 6.x Upgrade react-navigation to 6.x May 25, 2021
Copy link
Contributor

@Jag96 Jag96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are conflicts, any luck fixing the backgrounds on web and desktop?

@tugbadogan
Copy link
Contributor Author

Yes @Jag96 after couple of hours of debugging, I was finally able to resolve that issue by adding detachInactiveScreens={false} to RootStack.Navigator. I'm going to update the screen recordings soon.

@Jag96 Jag96 requested a review from marcaaron May 27, 2021 00:19
Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have only tested web so far but it looks kind of broken

2021-05-26_14-51-14

2021-05-26_14-51-20

@@ -178,6 +178,7 @@ class AuthScreens extends React.Component {
// a header will briefly open and close the keyboard and crash Android.
// eslint-disable-next-line react/jsx-props-no-multi-spaces
keyboardHandlingEnabled={false}
detachInactiveScreens={false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I am not sure if we want this. Doesn't this mean that we are missing out on memory savings?

https://reactnavigation.org/docs/stack-navigator/#detachinactivescreens

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I don't set this prop, chat window view in the background doesn't work for modal views on web. We just have gray background.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, @tugbadogan how did you determine that setting that prop to false would fix the issue? Just wondering if there are alternate solutions since this has the side effect @marcaaron mentioned above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this by accident while looking at the documentation. But, we don't need this anymore as I fixed the issue by upgrading react-native-screens package version to >3.0.0 as required by react-navigation 6.x and used presentation: 'transparentModal' for modal screen options.

src/libs/Navigation/AppNavigator/MainDrawerNavigator.js Outdated Show resolved Hide resolved
@marcaaron
Copy link
Contributor

Screen Shot 2021-05-26 at 2 47 01 PM

there are also warnings in the console

@tugbadogan
Copy link
Contributor Author

Hey @marcaaron , I fixed the lint errors and empty chat issue on web, can you do another review?

@tugbadogan
Copy link
Contributor Author

I updated screen recordings for web, desktop and mobile web. I also added QA steps.

marcaaron
marcaaron previously approved these changes Jun 7, 2021
Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is testing good for me on web now.

Although, the animations look slightly different on web. I'm not sure if we want to roll with them or make sure they stay the same as they are on production/staging? Any thoughts on this @Jag96 @shawnborton?

After / New
https://user-images.githubusercontent.com/32969087/121085080-232e2c00-c77d-11eb-8679-2e52d29d287f.mp4

Before / Old
https://user-images.githubusercontent.com/32969087/121085092-25908600-c77d-11eb-8fd9-372417b7fe5a.mp4

@@ -166,6 +166,7 @@ class AuthScreens extends React.Component {
animationEnabled: true,
gestureDirection: 'horizontal',
cardOverlayEnabled: true,
presentation: 'transparentModal',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this? Can we add some comment maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option is required to make previous screen visible underneath the modal screen
https://reactnavigation.org/docs/6.x/stack-navigator#transparent-modals

Adding a comment to the code now 👍

borderColor: themeColors.border,
}
: {
height: '100%',
height: windowHeight,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about this change. Why does this not work with 100% but does work with an absolute value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know TBH. This might be related to some components we're using for layout management (maybe ScreenWrapper)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok cool no worries I just like to understand the changes, but if they work they work.

Copy link
Contributor

@Jag96 Jag96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, the animations look slightly different on web. I'm not sure if we want to roll with them or make sure they stay the same as they are on production/staging?

I see the difference as well, it looks like it now behaves the same way as iOS does. I don't see any issue with using the updated animations. @shawnborton is OOO this week so going to tag @michelle-thompson to weigh in here in case there's some context I'm missing.

Otherwise, this looks good and works well for me 👍

@marcaaron
Copy link
Contributor

I see the difference as well, it looks like it now behaves the same way as iOS does. I don't see any issue with using the updated animations.

Nice I feel the same. They look more consistent so it's a net positive just unexpected 🙃

@marcaaron marcaaron self-requested a review June 8, 2021 00:42
@michelle-thompson
Copy link
Contributor

Looks good to me as well 👍

Copy link
Contributor

@Jag96 Jag96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jag96 Jag96 merged commit b115b43 into Expensify:main Jun 8, 2021
@OSBotify
Copy link
Contributor

OSBotify commented Jun 9, 2021

🚀 Deployed to staging in version: 1.0.65-2🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.68-4🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@tugbadogan tugbadogan deleted the tugbadogan-upgrade-react-navigation-drawer branch July 10, 2021 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS- 1.0.2-51- Left menu shown in the center and need to reload App to fix it
6 participants