Skip to content

feat: add per-icon hover motion map and keyframes - #4944

Merged
mxschll merged 6 commits into
mainfrom
dev-v3-schomax-motion-9
Aug 28, 2026
Merged

feat: add per-icon hover motion map and keyframes #4944
mxschll merged 6 commits into
mainfrom
dev-v3-schomax-motion-9

Conversation

@mxschll

@mxschll mxschll commented Aug 27, 2026

Copy link
Copy Markdown
Member

Description

Adds more icon-specific motions and updates some of the existing ones. Icon motion is not enabled yet, so this PR does not introduce any visual changes except some anti aliasing because SVG strokes have been split up. Hence the failing regression tests.

Also adds necessary icon-part tags to three icons as a follow up to #4919

Related links, issue #, if available: b9VcPdMJ5zRn

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.66%. Comparing base (e20adf7) to head (3d71b7f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4944   +/-   ##
=======================================
  Coverage   97.66%   97.66%           
=======================================
  Files         958      959    +1     
  Lines       31326    31342   +16     
  Branches    11573    11577    +4     
=======================================
+ Hits        30594    30610   +16     
- Misses        686      725   +39     
+ Partials       46        7   -39     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

];

function getIcon(iconName, content) {
// Dash-animated icons (see hover-motion.scss) carry pathLength/stroke-dash*

@mxschll mxschll Aug 28, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The default optimization merges SVG paths and strips attributes which now are required for animating single parts of an icon. We need to keep these when present in Cloudscape SVGs.

Comment thread src/icon/mixins.scss
> svg {
// Exposed for hover motion that compensates stroke width while scaling
// parts (see hover-motion.scss).
--awsui-internal-style-icon-stroke-width: calc(#{$stroke} / #{$scaleFactor});

@mxschll mxschll Aug 28, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Exposed, so the var can be re-used in hover-motion.scss and animations can adapt to different stroke widths of icons. E.g. VR uses thicker stroke width for icons than One Theme, and animations must adapt accordingly (VR does not get animations, but still, this keeps things flexible)

@mxschll
mxschll requested a review from amanabiy August 28, 2026 08:37
'y2',
'width',
'height',
'overflow',

@mxschll mxschll Aug 28, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These attributes are a requirement for some SVG animations to work. E.g. a moving part should be able to move "out" of a box without showing outside of it, hence we require "overflow: hidden" on parts of an SVG.

// stylelint-disable @cloudscape-design/no-implicit-descendant

$_ease-out: ease-out;
$_ease-symmetric: cubic-bezier(0.33, 0, 0.67, 1);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Simplified to use native ease-in-out

@mxschll
mxschll marked this pull request as ready for review August 28, 2026 08:50
@mxschll
mxschll requested a review from a team as a code owner August 28, 2026 08:50
@mxschll
mxschll removed the request for review from a team August 28, 2026 08:51
@mxschll
mxschll enabled auto-merge August 28, 2026 08:57
@mxschll
mxschll marked this pull request as draft August 28, 2026 09:05
auto-merge was automatically disabled August 28, 2026 09:05

Pull request was converted to draft

class: 'className',
'stroke-dasharray': 'strokeDasharray',
'stroke-dashoffset': 'strokeDashoffset',
};

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SVGs get transformed to components. We need to rename attributes to jsx compatible names, otherwise we'll get these errors:

Invalid DOM property `%s`. Did you mean `%s`?%s\" \"stroke-dasharray\" \"strokeDasharray\" \"\\n    in path\\n    in svg

@mxschll
mxschll added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit 6ecc94b Aug 28, 2026
61 of 66 checks passed
@mxschll
mxschll deleted the dev-v3-schomax-motion-9 branch August 28, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants