Skip to content

feat: wire hover/focus motion trigger into components - #4941

Draft
mxschll wants to merge 18 commits into
mainfrom
dev-v3-schomax-motion-regions
Draft

feat: wire hover/focus motion trigger into components#4941
mxschll wants to merge 18 commits into
mainfrom
dev-v3-schomax-motion-regions

Conversation

@mxschll

@mxschll mxschll commented Aug 27, 2026

Copy link
Copy Markdown
Member

Description

Related links, issue #, if available: n/a

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.

…buttons and carets

Wires the existing data-awsui-motion-trigger / data-awsui-motion-target
selector mechanism (already in src/icon/hover-motion.scss) into real
components. The CSS engine itself was not changed.

- InternalButton (src/button/internal.tsx, icon-helper.tsx): every
  rendered button/anchor sets data-awsui-motion-trigger="hover"; every
  icon it renders (leading/trailing via IconWrapper, plus the appended
  external-link icon) sets data-awsui-motion-target. Covers Button,
  ButtonDropdown (all trigger shapes incl. split main-action), the
  ButtonGroup icon-button items, and ToggleButton, since they all share
  this one primitive.
- ExpandableSection caret (src/expandable-section/expandable-section-header.tsx):
  the shared caret <InternalIcon> always carries data-awsui-motion-target;
  data-awsui-motion-trigger="hover" is set on whichever element already
  owns the click handler (the standalone caret button, the deprecated
  role=button header, or whichever of headerButton/HeadingTag/wrapper
  currently receives the click listeners) so the hover surface always
  matches the real clickable area. SideNavigation's expandable link
  groups render through this same navigation-variant caret, so they are
  covered without a separate change.
- Tests: src/icon/__tests__/icon-hover-motion.test.ts gains a suite
  covering the descendant-target-under-hover case, the descendant-target-
  under-focus (nested trigger) case, the trigger-and-target-on-the-same-
  element case, an icon outside any target staying still, and
  disableMotion()/prefers-reduced-motion still neutralising the new
  selectors. New DOM-attribute assertions were added to
  button/__tests__/internal.test.tsx and
  expandable-section/__tests__/expandable-section.test.tsx.
@mxschll mxschll changed the title feat(motion): wire hover/focus motion trigger+target attributes into … feat: wire hover/focus motion trigger+target attributes into components Aug 27, 2026
@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 (8ca1360) to head (01b436b).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4941   +/-   ##
=======================================
  Coverage   97.66%   97.66%           
=======================================
  Files         958      959    +1     
  Lines       31326    31348   +22     
  Branches    11573    11582    +9     
=======================================
+ Hits        30594    30616   +22     
- 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.

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.

1 participant