Skip to content
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

Merged

Conversation

rottencandy
Copy link
Contributor

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:

  • Chrome
  • Firefox
  • Safari
  • Edge

/kind bug

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Feb 1, 2021
@openshift-ci-robot
Copy link
Contributor

@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
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1923721: Handle pipeline svg icon spin using a wrapped element

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
Copy link
Contributor Author

/cc @jerolimov @karthikjeeyar

@karthikjeeyar
Copy link
Contributor

Thanks @rottencandy for this fix. works fine now
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2021
Comment on lines 17 to 19
&--icon-spin {
transform-origin: 3.5% 14%;
}
Copy link
Member

@jerolimov jerolimov Feb 2, 2021

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.

image

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:

Suggested change
&--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:

Suggested change
&--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.

Copy link
Contributor Author

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.

@jerolimov
Copy link
Member

/assign @andrewballantyne

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2021
@nemesis09
Copy link
Contributor

verified the changes locally
works as expected.
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2021
<svg
width={30}
height={30}
viewBox="-5 -5 20 20"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
viewBox="-5 -5 20 20"
viewBox="-5 -4 20 20"

The icon sits a bit too low, let's bring it more to the center of the node.

eg:

-5 y value:
Screen Shot 2021-02-04 at 9 57 46 AM

-4 y value:
Screen Shot 2021-02-04 at 9 57 06 AM

Slight difference but more clean imo.

Copy link
Contributor Author

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.

Copy link
Member

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. 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 4, 2021
Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 4, 2021
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 4, 2021
@jerolimov
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 4, 2021
Copy link
Member

@jerolimov jerolimov left a 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

@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@christianvogt
Copy link
Contributor

@rottencandy please create an issue on PF to add support for embedding react icons inside an existing SVG without PF nesting a new <svg> element. For whatever reason, adding the css animation to the nested svg has no affect. It would be good if we can use PF icons and the animation without having to create this wrapper.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit a89f2a0 into openshift:master Feb 5, 2021
@openshift-ci-robot
Copy link
Contributor

@rottencandy: All pull requests linked via external trackers have merged:

Bugzilla bug 1923721 has been moved to the MODIFIED state.

In response to this:

Bug 1923721: Handle pipeline svg icon spin using a wrapped element

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 5, 2021

@rottencandy: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-gcp-console 6f4861b link /test e2e-gcp-console

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.

@spadgett spadgett added this to the v4.7 milestone Feb 5, 2021
@rottencandy rottencandy deleted the pipeline-icon-spin branch February 8, 2021 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants