-
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
feat: Implement to use a 👍icon next to approved report preview. #53373
base: main
Are you sure you want to change the base?
feat: Implement to use a 👍icon next to approved report preview. #53373
Conversation
Signed-off-by: krishna2323 <[email protected]>
Signed-off-by: krishna2323 <[email protected]>
Signed-off-by: krishna2323 <[email protected]>
@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 <[email protected]>
Signed-off-by: krishna2323 <[email protected]>
const thumbsUpScale = useSharedValue(isApproved ? 1 : 0); | ||
const thumbsUpStyle = useAnimatedStyle(() => ({ | ||
...styles.defaultCheckmarkWrapper, | ||
transform: [{scale: thumbsUpScale.get()}], |
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -149,14 +155,20 @@ function ReportPreview({ | |||
const previewMessageStyle = useAnimatedStyle(() => ({ | |||
opacity: previewMessageOpacity.get(), | |||
})); | |||
const checkMarkScale = useSharedValue(iouSettled ? 1 : 0); | |||
const checkMarkScale = useSharedValue(iouSettled ? 1 : 0.25); |
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.
@Krishna2323 Is this changed?
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.
hmm, sorry, the values are swapped between checkMarkScale
& thumbsUpScale
. Now updated.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Krishna2323 Is this changed?
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.
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 <[email protected]>
Signed-off-by: krishna2323 <[email protected]>
Signed-off-by: krishna2323 <[email protected]>
Signed-off-by: krishna2323 <[email protected]>
return; | ||
} | ||
|
||
thumbsUpScale.set(isApprovedAnimationRunning ? withDelay(CONST.ANIMATION_THUMBSUP_DELAY, withSpring(1, {duration: CONST.ANIMATION_THUMBSUP_DURATION})) : 1); |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Krishna2323 It caused the regression on the previous PR or did you add it for safer?
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.
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. |
Explanation of Change
Fixed Issues
$ #49847
PROPOSAL: #49847 (comment)
Tests
Offline tests
QA Steps
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
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