Migrate animated to reanimated Tooltip and Switch#53298
Conversation
blazejkustra
left a comment
There was a problem hiding this comment.
Smoothness incoming ❤️ LGTM
|
@shubham1206agra 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] |
|
@shubham1206agra kicked off the build, when do you think you can get around to this review? |
|
🚧 @mountiny has triggered a test build. You can view the workflow run here. |
|
Very exciting! |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
@mountiny Doing this now. Works well on my Android device. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-11-30.at.8.24.23.PM.movAndroid: mWeb ChromeScreen.Recording.2024-11-30.at.7.35.22.PM.moviOS: NativeScreen.Recording.2024-11-30.at.8.09.07.PM.moviOS: mWeb SafariScreen.Recording.2024-11-30.at.7.28.36.PM.movMacOS: Chrome / SafariScreen.Recording.2024-11-30.at.7.21.31.PM.movMacOS: DesktopScreen.Recording.2024-11-30.at.7.47.15.PM.mov |
|
✋ 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.70-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.0.70-9 🚀
|
| disabledAction?.(); | ||
| return; | ||
| } | ||
| offsetX.set(withTiming(isOn ? OFFSET_X.OFF : OFFSET_X.ON, {duration: 300})); |
There was a problem hiding this comment.
Sorry, missed this implementation bug which caused #53447
| const tooltipHorizontalPadding = spacing.ph2.paddingHorizontal * 2; | ||
| const tooltipWidth = props.tooltipContentWidth && props.tooltipContentWidth + tooltipHorizontalPadding + 1; | ||
| const isTooltipSizeReady = tooltipWidth !== undefined && props.tooltipWrapperHeight !== undefined; | ||
| let scale = 1; |
There was a problem hiding this comment.
✋ Hey, coming from #55848 (comment)
This has caused an issue with tooltip flickering before showing fully
scale here defaults to 1 when isTooltipSizeReady is false, which displays the tooltip even before it's size was calculated. This was resolved by changing this line to let scale = 0, so the tooltip is hidden until the size is calculated
More details: #55848 (comment)
Explanation of Change
Swap use animated from react-native to react-native-reanimated so we have big performance gains in animations
Fixed Issues
$ #52920
PROPOSAL:
here
Tests
expected behavior:
expected behavior:
every time the swithch is clicked, there is a smooth on and off animation
Verify that no errors appear in the JS console
Offline tests
Are not needed
QA Steps
expected behavior:
expected behavior:
every time the swithch is clicked, there is a smooth on and off animation
Verify that no errors appear in the JS console
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.2024-11-29.at.11.16.07.mov
Android: mWeb Chrome
Screen.Recording.2024-11-29.at.12.12.29.mov
iOS: Native
Screen.Recording.2024-11-29.at.08.27.07.mov
iOS: mWeb Safari
Screen.Recording.2024-11-29.at.12.02.26.mov
MacOS: Chrome / Safari
Screen.Recording.2024-11-29.at.08.13.22.mov
MacOS: Desktop
Screen.Recording.2024-11-29.at.08.17.10.mov