feat: Implement to use a 👍icon next to approved report preview.#53373
feat: Implement to use a 👍icon next to approved report preview.#53373youssef-lr merged 14 commits intoExpensify:mainfrom
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@Krishna2323 Please help to confirm
|
Its mostly the same with some minor changes.
I tried reproducing the regression bug on a physical device, but I wasn't able to reproduce it. It would be great if you can also test it on a physical device. WhatsApp.Video.2024-12-02.at.16.25.37.mp4 |
|
Can't reproduce on this branch with Pixel 4a: Screen.Recording.2024-12-04.at.16.11.28.mov |
@Krishna2323 Could you detail changes? |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
| const thumbsUpScale = useSharedValue(isApproved ? 1 : 0); | ||
| const thumbsUpStyle = useAnimatedStyle(() => ({ | ||
| ...styles.defaultCheckmarkWrapper, | ||
| transform: [{scale: thumbsUpScale.get()}], |
There was a problem hiding this comment.
@DylanDylann, previously we were using .value property to get the value, now it is updated to .get() method.
| return; | ||
| } | ||
|
|
||
| thumbsUpScale.set(withSpring(1, {duration: CONST.ANIMATION_PAID_DURATION})); |
There was a problem hiding this comment.
@DylanDylann, in the previous PR the duration was set to 200, I updated it to ANIMATION_PAID_DURATION constant which is also 200. its better to use the constant everywhere for consistency.
There was a problem hiding this comment.
these are the only changes which are different from the previous PR.
|
@DylanDylann 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] |
|
@Krishna2323 Could you also explain why the regression bug is resolved on this PR? |
I'm not sure why it was happening in the previous PR, as you can see that there is no major differences between this and the previous PR. |
|
Hmmm, So weird, I also don't understand why this bug happen in the previous PR |
| opacity: previewMessageOpacity.get(), | ||
| })); | ||
| const checkMarkScale = useSharedValue(iouSettled ? 1 : 0); | ||
| const checkMarkScale = useSharedValue(iouSettled ? 1 : 0.25); |
There was a problem hiding this comment.
hmm, sorry, the values are swapped between checkMarkScale & thumbsUpScale. Now updated.
There was a problem hiding this comment.
Actually, we need 0 as the initial value for thumbsUpScale also, because on mWeb, it can be visible at .25 scale before it is updated to 1 with animation.
| const checkMarkScale = useSharedValue(iouSettled ? 1 : 0.25); | ||
|
|
||
| const isApproved = ReportUtils.isReportApproved(iouReport, action); | ||
| const thumbsUpScale = useSharedValue(isApproved ? 1 : 0); |
There was a problem hiding this comment.
hmm, sorry, the values are swapped between checkMarkScale & thumbsUpScale. Now updated.
|
@Krishna2323 Please test again this PR and upload videos again. |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
| return; | ||
| } | ||
|
|
||
| thumbsUpScale.set(isApprovedAnimationRunning ? withDelay(CONST.ANIMATION_THUMBSUP_DELAY, withSpring(1, {duration: CONST.ANIMATION_THUMBSUP_DURATION})) : 1); |
There was a problem hiding this comment.
Updated this to add some delay because the animation can seem frozen if the button and icon animations run together at the same time. Same approach is also used for checkmark icon animation.
There was a problem hiding this comment.
@Krishna2323 It caused the regression on the previous PR or did you add it for safer?
There was a problem hiding this comment.
It caused the regression
No, its just for fixing animation lag.
|
@DylanDylann, recordings updated. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-12-09.at.14.22.35.movAndroid: mWeb ChromeScreen.Recording.2024-12-09.at.14.17.00.moviOS: NativeScreen.Recording.2024-12-09.at.14.18.39.moviOS: mWeb SafariScreen.Recording.2024-12-09.at.14.15.04.movMacOS: Chrome / SafariScreen.Recording.2024-12-09.at.14.01.18.movMacOS: DesktopScreen.Recording.2024-12-09.at.14.12.56.mov |
|
Just FYI the Reanimated library version has changed since the previous PR, so that may have contributed to the fix as well. |
I also think the same, this PR has no additional changes comparing to the previous PR which could have been the reason for the regression. |
|
@youssef-lr Friendly bump |
|
I've started testing this one today and got caught up with a bug. I'm on it again today. |
|
@youssef-lr Is it ready to merge? |
|
✋ 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/youssef-lr in version: 9.0.76-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.0.76-12 🚀
|
Explanation of Change
Fixed Issues
$ #49847
PROPOSAL: #49847 (comment)
Tests
Offline tests
QA Steps
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
android_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: Native
android_native.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
web_chrome.mp4
MacOS: Desktop
desktop_app.mp4