Skip to content

fix(ui): Respect reduced motion in testimonials - #23

Merged
IamLRBA merged 1 commit into
OpenDataEnsemble:mainfrom
Hanan88:codex/respect-testimonials-reduced-motion
Nov 11, 2026
Merged

IamLRBA merged 1 commit into
OpenDataEnsemble:mainfrom
Hanan88:codex/respect-testimonials-reduced-motion

Conversation

@Hanan88

@Hanan88 Hanan88 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #17.

Stop the testimonials requestAnimationFrame loop when prefers-reduced-motion: reduce matches, and listen for preference changes while the page stays open. Cancel the pending frame when stopping and reset the frame timestamp when resuming so a long pause does not jump the track.

Keep previous/next navigation available. Normalize negative offsets before rendering the transform: pressing Previous from the initial position previously produced the invalid CSS translateX(--420px). The existing reduced-motion CSS continues to remove the manual transition.

Related implementation: #22. This independently prepared change also fixes Previous at the initial position and includes a live-preference-change regression test. The full browser suite result is linked below for review.

Validation

  • pnpm build, pnpm lint and pnpm typecheck: passed on Node 24.19.0 / pnpm 11.1.2.
  • Focused Prettier check and git diff --check: passed. The full pnpm format:check flags three unchanged files: packages/tokens/src/tokens.css, src/BackToTop.tsx and tsconfig.json.
  • Eight local component-harness checks passed using existing workspace test tooling, covering reduced motion on mount, live changes, resuming, previous/next at offset zero, timeout/hover behavior and unmount cleanup. Seven of these fail against the original component.
  • Added two project-native Playwright regression tests for stable reduced-motion rendering with manual controls, and changing the preference without reloading. All 17 browser tests collect successfully.
  • Browser checked the production export at desktop and 375px mobile widths: navigation works, no horizontal page overflow, no console errors. The local browser had no motion preference; reduced-motion behavior was checked separately by the component harness and hosted browser tests.

Full hosted Chromium suite: 17 passed (50.2s), including both new motion-preference scenarios and the existing navigation, modal, mobile and overflow checks. Successful run. This test-only workflow lives on a separate fork validation branch and is outside this PR.

Prepared with AI assistance (Codex).

@IamLRBA

IamLRBA commented Nov 11, 2026

Copy link
Copy Markdown
Member

Looks good for #17. The carousel no longer auto-scrolls.
And that modulo fix for Previous at offset 0 (avoiding invalid translateX(--420px)) is a very welcome bonus 😊.

Thanks, @Hanan88

@IamLRBA
IamLRBA merged commit 157dd08 into OpenDataEnsemble:main Nov 11, 2026
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.

a11y: respect prefers-reduced-motion on testimonials carousel

2 participants