Skip to content

feat(#1807): prefers-reduced-motion defaults for Collapsible transitions - #1996

Open
kotAPI wants to merge 2 commits into
mainfrom
feat/issue-1807-prefers-reduced-motion
Open

feat(#1807): prefers-reduced-motion defaults for Collapsible transitions#1996
kotAPI wants to merge 2 commits into
mainfrom
feat/issue-1807-prefers-reduced-motion

Conversation

@kotAPI

@kotAPI kotAPI commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add SSR-safe usePrefersReducedMotion hook with tests.
  • Collapsible content uses zero transition duration by default when prefers-reduced-motion: reduce is enabled and transitionDuration is omitted.
  • Document default behavior in Collapsible Storybook and add a changeset.

Test plan

  • npm test -- --testPathPatterns=usePrefersReducedMotion|Collapsible/tests/Collapsible.test
  • Verify Collapsible open/close in Storybook with reduced motion enabled in OS/browser settings

Closes #1807

Add an SSR-safe usePrefersReducedMotion hook and disable default Collapsible height transitions when users prefer reduced motion unless transitionDuration is set explicitly.
@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 98ab10e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@radui/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@kotAPI, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 57 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc62d465-4738-45ce-aa1d-325e4306e104

📥 Commits

Reviewing files that changed from the base of the PR and between fe87b36 and 98ab10e.

📒 Files selected for processing (9)
  • .changeset/prefers-reduced-motion-collapsible.md
  • src/core/hooks/usePrefersReducedMotion/index.ts
  • src/core/hooks/usePrefersReducedMotion/usePrefersReducedMotion.test.tsx
  • src/core/hooks/usePrefersReducedMotion/usePrefersReducedMotion.ts
  • src/core/primitives/Collapsible/contexts/CollapsiblePrimitiveContext.tsx
  • src/core/primitives/Collapsible/fragments/CollapsiblePrimitiveContent.tsx
  • src/core/primitives/Collapsible/fragments/CollapsiblePrimitiveRoot.tsx
  • src/core/primitives/Collapsible/stories/Collapsible.stories.tsx
  • src/core/primitives/Collapsible/tests/Collapsible.test.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-1807-prefers-reduced-motion

Comment @coderabbitai help to get the list of available commands and usage tips.

Note Storybook behavior when transitionDuration is omitted and reduced motion is enabled.
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

This report compares the PR with the base branch. "Δ" shows how the PR affects each metric.

Metric PR Δ
Statements 75.78% +0.05%
Branches 59.25% +0.08%
Functions 61.82% +0.07%
Lines 77.31% +0.05%

Coverage improved or stayed the same. Great job!

Run npm run coverage:ci locally for detailed reports and target untested areas to raise these numbers.

@kotAPI

kotAPI commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Code review

LGTM. Matches project patterns for portal Theme refs, Floating UI prop merge, controlled-switch/lazy-mount/RTL tests, or focused bug fixes. No changes requested.

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.

Add prefers-reduced-motion opt-in defaults for transitions.

1 participant