fix: ProfileAvatar (modal) page has no slide in animation#53475
Conversation
|
@jasperhuangg 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] |
|
Assigning reviewers from the issue |
|
@chrispader Would this work the same using Otherwise, if we keep the
and also make sure to clear the timeout on component unmount. Everything else looks good, will start working on the checklist shortly! |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.mp4Android: mWeb ChromeUploading android-mweb.mp4… iOS: Nativeios.mp4iOS: mWeb Safariios-mweb.mp4MacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
You're right, for the slide in animation we can use the
For the slide out animation, we'll still need to use the timeout with |
ikevin127
left a comment
There was a problem hiding this comment.
ios.mp4
There seems to be a UI artifact when closing the modal, right before getting off the screen it seems to get stuck for a second, it's like a frame drop right before going away which causes the out animation to not qualify as smooth as required in Tests steps.
I checked this on current staging / dev code and the issue is not present there because there's no animation when closing the modal so I'm not sure whether the issue was there before the "no slide animation" issue surfaced.
I'm not sure if we're supposed to deal with the issue in this PR or we're good to move forward the way it is.
cc @mountiny for take on this
mountiny
left a comment
There was a problem hiding this comment.
I agree that the bug that @ikevin127 found should be addressed
| source={UserUtils.getFullSizeAvatar(avatarURL, accountID)} | ||
| onModalClose={() => { | ||
| Navigation.goBack(); | ||
| setTimeout(() => { |
There was a problem hiding this comment.
@chrispader I know this is tough, but we are trying not to use setTimeout in the App as its a fragile workaround usually, could you think of any other way to achieve this?
There was a problem hiding this comment.
InteractionManager.runAfterInteractions should work there as well.
There was a problem hiding this comment.
i tried but it didn't work. There are no interactions to run this after. Rather we essentially want to run it "before" interactions such as the navigation back (screen unmount)
There was a problem hiding this comment.
Since react-native-modal also doesn't have a callback for when the close animation is completed, i don't think we can implement this differently without yet again patching the library.
mountiny
left a comment
There was a problem hiding this comment.
@chrispader Can you please add this to the issue to migrate to react-navigation modal so we do not forget to remove this once we migrate over?
yes, will do! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.73-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.73-8 🚀
|
|
This issue can potentially be fixed by #53493 |
@mountiny
Explanation of Change
This PR includes a temporary fix for the slide in animations of modal screens like the
ProfileAvatarscreen. The reason the animation was not visible is because the screens with NativeStack only get mounted once we navigate there and the screen has not finished rendering/mounting when the modal animates in.Similarly, when we animate the modal out, we'll have to delay the back navigation by the modal animation duration.
Ultimately, we should think about migrating
react-native-modal/RN Modal screens to@react-navigationmodal screens.Fixed Issues
$ #53362
PROPOSAL:
Tests
Offline tests
QA Steps
Same as in Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen_Recording_20241203_211213_New.Expensify.Dev.mp4
Android: mWeb Chrome
iOS: Native
Uploading Simulator Screen Recording - iPhone 16 Pro - 2024-12-03 at 20.54.28.mp4…
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2024-12-03.at.21.14.39.mov
MacOS: Desktop