Skip to content

feat: support prefers-reduced-motion across the library components#694

Merged
fateeand merged 2 commits into
masterfrom
664-support-prefers-reduced-motion-across-the-library-components
Jul 7, 2026
Merged

feat: support prefers-reduced-motion across the library components#694
fateeand merged 2 commits into
masterfrom
664-support-prefers-reduced-motion-across-the-library-components

Conversation

@fateeand

@fateeand fateeand commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Overview

Some users experience discomfort, dizziness, or motion sensitivity from UI animations. Supporting prefers-reduced-motion improves accessibility, aligns with WCAG guidance and platform accessibility settings, and ensures our components respect user preferences consistently across applications.

This PR adds support for the prefers-reduced-motion accessibility preference throughout the cps-ui-kit component library, so animations and transitions are reduced or removed for users who have this OS-level setting enabled.

Copilot AI review requested due to automatic review settings July 2, 2026 14:44
@fateeand fateeand linked an issue Jul 2, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Coverage report for library

St.
Category Percentage Covered / Total
🟡 Statements 62.57% 5050/8071
🔴 Branches 54.45% 2238/4110
🟡 Functions 62.98% 963/1529
🟡 Lines 63.42% 4714/7433

Test suite run success

1948 tests passing in 55 suites.

Report generated by 🧪jest coverage report action from d8db447

Copilot AI 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.

Pull request overview

This PR adds library-wide support for the prefers-reduced-motion user preference to reduce or eliminate UI motion for improved accessibility across cps-ui-kit.

Changes:

  • Adds global reduced-motion CSS overrides and slows (instead of freezes) key progress/loader animations under reduced motion.
  • Introduces a shared motion-utils helper and integrates reduced-motion timings into several Angular animation-based components (toast, dialog, tab group, sidebar menu, menu, expansion panel).
  • Adds/updates Jest setup and component/unit tests to validate reduced-motion behavior.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
projects/cps-ui-kit/styles/styles.scss Adds global @media (prefers-reduced-motion: reduce) overrides and zeroes motion CSS variables.
projects/cps-ui-kit/src/lib/utils/internal/motion-utils.ts Introduces prefersReducedMotion() helper and a reduced-motion duration constant.
projects/cps-ui-kit/src/lib/utils/internal/motion-utils.spec.ts Adds unit tests for the new motion utility.
projects/cps-ui-kit/src/lib/services/cps-notification/internal/components/cps-toast/cps-toast.component.ts Parameterizes toast animation timings and resolves them based on reduced motion.
projects/cps-ui-kit/src/lib/services/cps-notification/internal/components/cps-toast/cps-toast.component.html Passes resolved timing params into the toast animation binding.
projects/cps-ui-kit/src/lib/services/cps-notification/internal/components/cps-toast/cps-toast.component.spec.ts Tests toast reduced-motion timing resolution.
projects/cps-ui-kit/src/lib/services/cps-dialog/internal/components/cps-dialog/cps-dialog.component.ts Resolves dialog transition options based on reduced motion.
projects/cps-ui-kit/src/lib/services/cps-dialog/internal/components/cps-dialog/cps-dialog.component.html Uses resolved transition options for dialog animations.
projects/cps-ui-kit/src/lib/services/cps-dialog/internal/components/cps-dialog/cps-dialog.component.spec.ts Tests dialog reduced-motion transition behavior.
projects/cps-ui-kit/src/lib/components/cps-tab-group/cps-tab-group.component.ts Adds reduced-motion-aware animation params for slide/fade tab transitions.
projects/cps-ui-kit/src/lib/components/cps-tab-group/cps-tab-group.component.html Passes reduced-motion-aware params into tab content animations.
projects/cps-ui-kit/src/lib/components/cps-tab-group/cps-tab-group.component.spec.ts Tests tab group reduced-motion timing resolution.
projects/cps-ui-kit/src/lib/components/cps-sidebar-menu/cps-sidebar-menu.component.ts Adds reduced-motion-aware params for expand/collapse animation.
projects/cps-ui-kit/src/lib/components/cps-sidebar-menu/cps-sidebar-menu.component.html Passes reduced-motion-aware params into sidebar menu label animations.
projects/cps-ui-kit/src/lib/components/cps-sidebar-menu/cps-sidebar-menu.component.spec.ts Tests sidebar menu reduced-motion transition behavior.
projects/cps-ui-kit/src/lib/components/cps-progress-linear/cps-progress-linear.component.scss Slows indeterminate linear progress animation under reduced motion.
projects/cps-ui-kit/src/lib/components/cps-progress-circular/cps-progress-circular.component.scss Slows circular progress animation under reduced motion.
projects/cps-ui-kit/src/lib/components/cps-menu/cps-menu.component.ts Uses reduced-motion-aware show/hide transition options for menu overlay animation.
projects/cps-ui-kit/src/lib/components/cps-menu/cps-menu.component.html Passes reduced-motion-aware transition params into menu animation binding.
projects/cps-ui-kit/src/lib/components/cps-menu/cps-menu.component.spec.ts Tests menu reduced-motion transition behavior.
projects/cps-ui-kit/src/lib/components/cps-loader/cps-loader.component.scss Slows loader animations under reduced motion.
projects/cps-ui-kit/src/lib/components/cps-expansion-panel/cps-expansion-panel.component.ts Applies reduced-motion timing to expansion/collapse animations and updates DI style.
projects/cps-ui-kit/src/lib/components/cps-expansion-panel/cps-expansion-panel.component.html Passes reduced-motion transition params into expansion panel header animation binding.
projects/cps-ui-kit/src/lib/components/cps-expansion-panel/cps-expansion-panel.component.spec.ts Tests expansion panel reduced-motion transition behavior.
jest-setup.ts Adds a window.matchMedia polyfill for Jest tests.

Comment thread projects/cps-ui-kit/src/lib/utils/internal/motion-utils.ts
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  110 passed

Details

stats  110 tests across 4 suites
duration  4 minutes, 1 second
commit  d8db447
info  For details, download the Playwright report

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@fateeand fateeand merged commit cc45191 into master Jul 7, 2026
11 checks passed
@fateeand fateeand deleted the 664-support-prefers-reduced-motion-across-the-library-components branch July 7, 2026 09:42
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.

Support prefers-reduced-motion across the library components

3 participants