-
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
Fix animation of fill prop of the svg element #33224
Fix animation of fill prop of the svg element #33224
Conversation
@hayata-suenaga 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] |
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.
Thanks for the changes! Left one suggestion.
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.
Looks good to me!
do you have any idea on why the unit test is failing ? https://github.com/Expensify/App/actions/runs/7248895066/job/19745729356 |
@rayane-djouah let's figure out the tests after all platforms are working |
we need to figure out how to fix the failing test |
@rayane-djouah we have an error on android |
|
@rayane-djouah This was actually my code review suggestion (#33224 (comment)) but it looks like I got it wrong, sorry about that. 😢 If it works inside the component then I think we're good to go. |
hey, it sounds like the final issues will be resolved shortly? If yes I won't revert the PR. |
Do you mean it fixed the original error (the one with |
@Julesssss the crash on android bug is fixed now, but we have a failing ui test remaining. |
As unit test is still failing and not found solution yet, I think we should still go revert approach as QA team is not able to test staging android at all. Expecting fix much earlier than deploy time as QA time required. |
@tomekzaw calling createAnimatedPropAdapter is causing the test to fail: Recording.2023-12-19.172301.mp4any ideas on this? |
not too familiar but could we mock |
Thank you @rushatgabhane the test is passing now |
@rayane-djouah Staging has white color |
// eslint-disable-next-line rulesdir/prefer-underscore-method | ||
if (Object.keys(props).includes('fill')) { | ||
// eslint-disable-next-line no-param-reassign | ||
props.fill = {type: 0, payload: processColor(props.fill)}; |
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.
@rayane-djouah Bug: On web, the Fab icon
+
has black color.
I think that the bug cause is that we are not adapting properly the fill
property from react-native-svg here, The fill color defaults to black.
using the example from the docs is not working.
we should understand the expected color structure, and how we should set the props.fill
in this case. for this, we need more information from SWM on the ColorStruct
type declaration here, and what color format is expected by processColor
.
cc @tomekzaw
Is this ready to merge? If not, no need to hesitate revert as original issue is just function migration. |
we can either revert the PR or merge this PR and fix this bug in a follow up PR |
I went ahead and merged the revert @rayane-djouah |
@rayane-djouah Should we close this PR and handle the fix in the new attempt? |
Regarding the black color on web, actually const animatedProps = useAnimatedProps(
() => {
const fill = interpolateColor(sharedValue.value, [0, 1], [textLight, textDark]);
return {
fill,
};
},
- [],
- adapter
+ undefined,
+ Platform.OS === 'web' ? undefined : adapter,
); After applying this change, the initial color of the plus icon is white. However, the animation does not run on web. The root cause is that the component is unmounted and mounted again on each change of useEffect(() => {
console.log('mounted');
return () => console.log('unmounted');
}, []); |
Details
Fixed Issues
$ #33277
$ #26654 (comment)
Tests
FAB Animation test:
Offline tests
N/A
QA Steps
same as tests above.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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)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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop