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
Bug 1923721: Handle pipeline svg icon spin using a wrapped <g> element #8007
Bug 1923721: Handle pipeline svg icon spin using a wrapped <g> element #8007
Conversation
@rottencandy: This pull request references Bugzilla bug 1923721, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Thanks @rottencandy for this fix. works fine now |
&--icon-spin { | ||
transform-origin: 3.5% 14%; | ||
} |
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.
Sorry for the late reply. I was yesterday already confused by this "magic numbers" here. It looks like this are the % width and height of the parent container of the icon.
You can set this also to the width and height (-0.8, don't know why 😕 ) if you want.
I tested this in the dev tools with this changes and it looks good for me.
PipelineVisualizationTask.scss:
&--icon-spin { | |
transform-origin: 3.5% 14%; | |
} | |
&--icon-spin { | |
transform-origin: 16.61px 16.61px; | |
} |
When I also changed the viewBox in PipelineVisualizationTask.tsx
to viewBox="-5 -5 20 21"
to vertical align the Icon a little bit, I need to change this to this values:
&--icon-spin { | |
transform-origin: 3.5% 14%; | |
} | |
&--icon-spin { | |
transform-origin: 16.61px 15.61px; | |
} |
Wdyt?
I tested this because I'm interested into this magic number. If Andrew gives an approval here I'm also fine with that.
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 transform-origin
to 16.61px
. I think values in px
would be better than percentages. It's confusing, I thought that it would be calculated for the element that gets the animation, and not it's parent.
And fa-spin
seems to animate simply using rotate
.
/assign @andrewballantyne |
cfb85ca
to
6c77af2
Compare
verified the changes locally |
<svg | ||
width={30} | ||
height={30} | ||
viewBox="-5 -5 20 20" |
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.
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. Had to also change transform-origin
to re center the icon spin.
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.
transform-origin could be more into the direction of 16.7px 15.1px
. But don't want block the PR.
Still a confusing solution we have here. 😕
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.
6c77af2
to
745db1f
Compare
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.
/lgtm
745db1f
to
6f4861b
Compare
/lgtm |
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 fine. Thanks for the extra rounds 😄
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne, jerolimov, karthikjeeyar, nemesis09, rottencandy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@rottencandy please create an issue on PF to add support for embedding react icons inside an existing SVG without PF nesting a new |
/retest Please review the full test history for this PR and help us cut down flakes. |
@rottencandy: All pull requests linked via external trackers have merged: Bugzilla bug 1923721 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@rottencandy: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Fixes:
https://issues.redhat.com/browse/ODC-5452
Analysis / Root cause:
Chromium does not animate nested SVGs.
Solution Description:
Wrap the SVG in a
<g>
element and animate that instead.Screen shots / Gifs for design review:
tmp.mp4
Browser conformance:
/kind bug