-
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
fix: ProfileAvatar (modal) page has no slide in animation #53475
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 |
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.
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
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InteractionManager.runAfterInteractions
should work there as well.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
@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
ProfileAvatar
screen. 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-navigation
modal screens.Fixed Issues
$ #53362
PROPOSAL:
Tests
Offline tests
QA Steps
Same as in Tests.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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_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