Skip to content

fix(a11y): add pause controls and WCAG 2.2.2 carousel semantics to TipCarousel - #1824

Open
chiragjangiir wants to merge 1 commit into
reframe-oss:mainfrom
chiragjangiir:fix/tip-carousel-accessibility
Open

chiragjangiir wants to merge 1 commit into
reframe-oss:mainfrom
chiragjangiir:fix/tip-carousel-accessibility

Conversation

@chiragjangiir

Copy link
Copy Markdown

Summary

Resolves #1773 by bringing TipCarousel.tsx into compliance with WCAG 2.2.2 (Pause, Stop, Hide). Previously, the tip carousel auto-advanced on an unyielding 6-second interval with no hover, focus, or visual pause controls, and lacked carousel accessibility semantics.

Root Cause & Changes

  1. Pause on Hover & Focus: Added onMouseEnter, onMouseLeave, onFocus, and container onBlur listeners to pause auto-advancement whenever a user is reading or interacting with the card or its controls.
  2. Explicit Play/Pause Toggle: Added an accessible pause/resume button with appropriate icons (Pause and Play), aria-pressed, and dynamic aria-label.
  3. Prefers-Reduced-Motion: Added detection and event subscription for (prefers-reduced-motion: reduce), defaulting to paused state for users sensitive to motion.
  4. WCAG ARIA Semantics: Added aria-roledescription="carousel", aria-label="Workflow tips", aria-live polite region, and aria-current="true" on the active pagination indicator.
  5. Unit Tests: Created src/components/__tests__/TipCarousel.test.tsx verifying rotation, pause-on-hover, pause-on-focus, manual toggle, pagination selection, and reduced-motion initialization.

Validation

  • Verified with Vitest: 8/8 unit tests passing in src/components/__tests__/TipCarousel.test.tsx.
  • Verified with ESLint: 0 errors across TipCarousel.tsx and test suite.
  • Verified TypeScript: bun x tsc --noEmit cleanly passed with 0 errors.

Closes #1773

…pCarousel

- Add pause-on-hover and pause-on-focus to satisfy WCAG 2.2.2 (Pause, Stop, Hide)
- Add accessible play/pause toggle button with dynamic aria-label and aria-pressed
- Respect prefers-reduced-motion media query by defaulting to paused state
- Add carousel ARIA attributes (aria-roledescription, aria-label, aria-live, aria-current)
- Add comprehensive unit test suite in src/components/__tests__/TipCarousel.test.tsx

Closes reframe-oss#1773
@netlify

netlify Bot commented Oct 28, 2026

Copy link
Copy Markdown

👷 Deploy request for reframe-os pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9bebe2b

@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Format Check Passed — @chiragjangiir

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @chiragjangiir!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. ✅ Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added level:advanced Advanced level - 55 pts type:bug Bug fix type:testing Testing labels Oct 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:advanced Advanced level - 55 pts type:bug Bug fix type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Homepage tip carousel auto-rotates with no way to pause it

1 participant