-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
base: main
Are you sure you want to change the base?
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 |
Just found the reason for the white flash in dark mode and dark flash in light mode. For some reason the I fixed the background color, but i still think the current going back animation is not optimal. The screen content should stay rendered until the screen is unmounted:
|
Definitely agree. That 1 second of blankness is scary haha. |
Yea, UX-wise not really nice... The problem is mostly about how we display modals on top of multiple screens. We want to be able to display any modal outside of the screens, so that they can continue rendering and animating out of the viewport, while the underlying screen is unmounting. I'm working on a solution to get the same/similar behaviour as on
|
@chrispader Ping me when this ready for testing again |
Thanks for digging, we are getting there 🤞 |
Ok so here's broader overview of the problem with modals under I created a simple reproducer repo using the same environment as in E/App in this PR. (RN 0.75.2, NativeStack, RNModal, etc.) The flow i was testing is the following: The user clicks on the "Confirm delete" button inside a modal in a nested screen. Once the button is clicked, that modal ( I tested whether the flicker/content disappearing during the screen unmount animation only occurs on new arch or also old arch. Additionally i tested the same flow with modal screens from I can now verify, that the screen content disappears only under new architecture. I'm now also pretty certain, that this must be caused by These videos show the results of my testing (to see the issue in detail, you might want to slowly go through the video manually)
Also tagging @WoLewicki and @satya164 here, since you might have a better understanding of the (native) cause of this issue under new architecture :) |
We can already see the problem with My general suggestion would be to completely ditch Also the way forward with modal libraries has been discussed recently in this thread, and i think we decided on keeping A fix for the issue in the context of this PR would be to replace only the modals in screens that are currently affected by this simultaneous dismissal of screen and modal. E.g.
|
@WoLewicki @satya164 do you guys know what could be causing this issue natively (on new arch)? I feel like this is a more low-level issue, since the screen content disappearing is also easily reproduible in a simple repro app. |
Started a thread on slack to have a real time conversation https://expensify.enterprise.slack.com/archives/C01GTK53T8Q/p1730730136540929 |
Thanks, bumped the thread |
Ok I think I got to the root of the issue. It consists of 2 things.
|
@WoLewicki Amazing, thanks for fixing this! 🚀❤️
I thought this one might be tricker. I think the optimal solution would be to use modal screens ( @mountiny if it's not possible to make the second issue work, i think we might have to adapt the modal change in a separate PR - at least if we want migrate consistently for the whole app. We could also just switch to modal screens for the screens that are currently affected by this problem (only modals that get dismissed at the same time as the screen) |
I agree let's just explore this for a bit but we can look into this in a follow up if its too complex |
After testing and thinking about it a little more, I think the problem is kinda impossible to solve in sensible way with new architecture. Navigating back just removes one of
Because of all of this, there is simply no way to have the animation of modal from The possible solutions I see is either not using |
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.
A new release of react-native-screens
was just released: https://github.com/software-mansion/react-native-screens/releases/tag/4.0.0
I'll leave comments which patches can be removed after upgrade (@chrispader I think it would be good to update now and remove patches?)
This patch is not present in this PR, but also can be removed: https://github.com/Expensify/App/blob/main/patches/react-native-screens%2B3.34.0%2B002%2Bios_from_left_animation.patch
startTransitionRecursive(child.toolbar) | ||
} | ||
if (child is ViewGroup) { | ||
+ // a combination of https://github.com/software-mansion/react-native-screens/pull/2307/files and https://github.com/software-mansion/react-native-screens/pull/2383/files |
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 patch can be removed if we switch to RNS 4.0
-static const float RNSSlideCloseTransitionDurationProportion = 0.25 / 0.35; | ||
-static const float RNSFadeCloseTransitionDurationProportion = 0.15 / 0.35; | ||
-static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35; | ||
+static const float RNSFadeOpenTransitionDurationProportion = 0.2 / 0.5; |
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 patch can be removed if we switch to RNS 4.0
simple_push
animation curve transition has been fixed, so this patch is not needed anymore
Thanks for looking into this, i think we will try not to hold on this and get this merged. Lets do a final check over, update the screens version and remove patches - then merge main and i will make a new build and test it some. Also lets verify one last time after those changes it works in hybrid app (and no specific changes are required there) and we can ship it |
Are you sure you want to bump |
Oh, then you are probably right - I didn't know v4 is compatible only with |
+1 actually, this will be better to handle in a separate PR as this is already quite large |
@mountiny @ishpaul777 @chiragsalian
Details
This PR migrates the App to use
PlatformStackNavigation
types and navigator components implemented in #37891Fixed Issues
$ #37891
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop