-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
[JENKINS-72845]: Fix status icon animation display on Safari #9123
[JENKINS-72845]: Fix status icon animation display on Safari #9123
Conversation
Yay, your first pull request towards Jenkins core was created successfully! Thank you so much! |
Thanks! Does this mean jenkins/war/src/main/scss/base/_style.scss Lines 871 to 900 in bb45b87
|
Hi! I didn't notice |
Solved by a new method, please take a look :). In the new solution, I am still using the css properties to animate, so no need to remove the original css. The new solution also supports reduced motion mode. |
@timja @daniel-beck Please take a look when you have time. |
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.
Looking at the "Icon legend" view/popup, this seems to work well in Safari, Chrome and Firefox now. I don't know enough about SVG to judge the technical quality of the fix or predict other problems this might cause.
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.
#9123 (review)
Same, but this fix has been sitting here long enough and if it works lets go for it.
/label ready-for-merge
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.
Thanks!
Thank you for both of your responses. Here is a little more explanation of this change. This animation is a rotating around one pivot. Specifically, a part of the svg image is rotating around that pivot. I noticed that if we zoom in/out in safari, the new pivot position will not be re-calculated. Therefore, it will still rotate around the old position. This seems to be a bug with Safari since many years ago. To fix this problem, I mapped all the coordinates of the original svg to a new coordinate system, which centered at (0, 0). Therefore, if we zoom in/out, the position of the pivot will not be changed. Without re-calculating the new coordinate, this animation will not shift. |
Congratulations on getting your very first Jenkins core pull request merged 🎉🥳 |
See JENKINS-72845.
The status icon animations are not properly shown on Safari if the user zooms in/out (
Command + "+" or "-"
). Some bugs related to the Safari browser were reported a few years ago, and it seems this is still not fixed. The main issue is that Safari cannot properly calculate thecenter
value of the propertytransform-origin
, it behaves differently between Safari and Chrome.By refactoring the structure of SVG icons and using SVG animations instead of CSS animations, this display problem is solved.I re-made these icon SVGs and centerized every SVG component to an enlarged view window. Therefore, we can directly set
transform-origin: 0 0;
to make sure the origin pivot is not changing in any cases, so Safari can properly locate the animation.PS: This is my first time contributing to Jenkins. If I am doing something wrong, please bear with me. Any advice is truly appreciated. :)
Screenshot before:
This is just an example of one status icon. All other animations are similar.
It also happens in the build history section and the timeline section.
Screenshot after:
All occurrences of this are fixed.
Testing done
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Before the changes are marked as
ready-for-merge
:Maintainer checklist