Skip to content

MAPLE-4349: Progress icon in Safari - #3440

Merged
LinKCoding merged 4 commits into
mainfrom
MAPLE-4349
Oct 1, 2026
Merged

LinKCoding merged 4 commits into
mainfrom
MAPLE-4349

Conversation

@jybrownSkillsoft

@jybrownSkillsoft jybrownSkillsoft commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Update Spinner to avoid < animateTransform> component, in Safari it did not actually spin :(

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: https://skillsoftdev.atlassian.net/browse/MAPLE-4349
  • Version plan added/updated (or not needed)
  • I have run this code to verify it works
  • This PR includes unit tests for the code change - No unit tests for this component existed prior, so no new ones were added.
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

  1. Start up the storyboard
  2. Looking at the Spinner component at http://localhost:6006/?path=/docs/atoms-loaders-spinner--docs
  3. Open it in Safari, Edge, Firefox, Chrome and review that the spinner is still, in fact, spinning
  4. Play with the size prop to make sure you can still resize the spinner for whatever page you like
  5. Try it out in dark mode! I didn't do anything for that, but why not?
  6. IMPORTANT USE CASE: Spin in your chair with the spinner component 😵‍💫 🪑
  7. NOTE: If your chair doesn't spin, please make sure somebody else tests this PR

PR Links and Envs

Repository PR Link
Monolith Monolith PR
Mono Mono PR

Update Spinner to avoid < animateTransform> component, Safari did not actually spin :(
version plan created
@jybrownSkillsoft
jybrownSkillsoft requested a review from a team as a code owner October 1, 2026 13:35
@nx-cloud

nx-cloud Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 2b411d7


☁️ Nx Cloud last updated this comment at 2026-10-01 15:10:39 UTC

@CLAassistant

CLAassistant commented Oct 1, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.98%. Comparing base (8767ae7) to head (c8bdbb1).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3440      +/-   ##
==========================================
- Coverage   91.33%   90.98%   -0.35%     
==========================================
  Files         407      277     -130     
  Lines        6840     5910     -930     
  Branches     2226     1969     -257     
==========================================
- Hits         6247     5377     -870     
+ Misses        584      524      -60     
  Partials        9        9              
Flag Coverage Δ
main ?
pull-request 90.98% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LinKCoding LinKCoding left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gave it a twirl and it looks good to me, I left some nits, but lemme know your thoughts on the css() comment and we can disc if need be :)

Comment thread packages/gamut/src/Loading/Spinner.tsx Outdated
size?: number | string;
};

// keyframes used due to lack of support for <animateTransform> component for Safari browser

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just a nit - but when I was looking into this, MDN says it is supported
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/animateTransform#browser_compatibility

but it really didn't spin 😅. So maybe it's more accurate to say something like:

// Using keyframes since the <animationTransform> element doesn't animate in Safari

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated the comment, yours is definitely more accurate.

I was considering if it was even important enough to leave this as a comment, since doesn't get used anywhere else in the repo, no search results. But I figure it's at least clear this way to not re-implement it that way later.

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yea, I had the same thought, better to document it somewhere in case someone else working on animation comes across this edge case.

Comment thread packages/gamut/src/Loading/Spinner.tsx Outdated
to: { transform: 'rotate(360deg)' },
});

const SpinnerRing = styled.g({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Honestly, somewhat a nit, but for consistency's sake (and in case we ever want to use tokens that could reflect a theme) I'd recommend using css() to wrap around the raw style obj

e.g.

import { css } from '@codecademy/gamut-styles';
// ...
const SpinnerRing = styled.g(
  css({
    animation: `${rotate} 1s linear infinite`,
    transformBox: 'view-box',
    transformOrigin: 'center',
    '@media (prefers-reduced-motion: reduce)': {
      animationDuration: '3s',
    },
  })
);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated this & rechecked in Chrome and Safari, both worked great!

Thanks for the clear code on that, exactly as described.

Code Review comments
Using css gamut-styles to wrap applied spinner CSS
Update comment to better reflect the Safari Browser issue
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

@codecademydev

Copy link
Copy Markdown
Collaborator

📬 Published Alpha Packages:

Package Version npm Diff
@codecademy/gamut 73.6.2-alpha.981230.0 npm diff
@codecademy/gamut-icons 10.2.1-alpha.981230.0 npm diff
@codecademy/gamut-illustrations 1.1.1-alpha.981230.0 npm diff
@codecademy/gamut-kit 3.0.25-alpha.981230.0 npm diff
@codecademy/gamut-patterns 1.1.1-alpha.981230.0 npm diff
@codecademy/gamut-styles 21.2.1-alpha.981230.0 npm diff
@codecademy/gamut-tests 7.1.1-alpha.981230.0 npm diff
@codecademy/variance 1.1.1-alpha.981230.0 npm diff
eslint-plugin-gamut 3.1.1-alpha.981230.0 npm diff

@jybrownSkillsoft jybrownSkillsoft added the Ship It :shipit: Ready 2 ship label Oct 1, 2026
@LinKCoding
LinKCoding merged commit 1b31da1 into main Oct 1, 2026
17 checks passed
@LinKCoding
LinKCoding deleted the MAPLE-4349 branch October 1, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ship It :shipit: Ready 2 ship

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants