fix(components): respect prefers-reduced-motion in animations#6723
Conversation
prefers-reduced-motion in animations
📝 WalkthroughWalkthroughUpdated component themes to respect reduced-motion preferences for chat indicators, shimmer, marquee, progress, and table loading animations. Motion-safe variants preserve animations for users who allow motion, while reduced-motion rules provide static, muted, or pulse-based presentations. Documentation now describes these behaviors for each affected component. Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/content/docs/2.components/progress.md`:
- Around line 98-100: Hyphenate “full width pulse” as “full-width pulse” in the
documentation tip at docs/content/docs/2.components/progress.md lines 98-100 and
the corresponding tip at docs/content/docs/2.components/table.md lines 189-191.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 33aa2db7-e496-4ca4-895e-459af49878a7
⛔ Files ignored due to path filters (18)
test/components/__snapshots__/ChatMessages-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatMessages.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatReasoning-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatReasoning.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatShimmer-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatShimmer.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatTool-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatTool.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/Marquee-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/Marquee.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/PageLogos-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/PageLogos.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/Progress-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/Progress.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/Table-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/Table.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/Toast-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/Toast.spec.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (9)
docs/content/docs/2.components/chat-shimmer.mddocs/content/docs/2.components/marquee.mddocs/content/docs/2.components/progress.mddocs/content/docs/2.components/table.mdsrc/theme/chat-messages.tssrc/theme/chat-shimmer.tssrc/theme/marquee.tssrc/theme/progress.tssrc/theme/table.ts
| ::tip | ||
| The animation is automatically disabled when the user prefers reduced motion, the indeterminate bar is displayed as a full width pulse instead. | ||
| :: |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Hyphenate “full-width” in both documentation tips.
docs/content/docs/2.components/progress.md#L98-L100: Change “full width pulse” to “full-width pulse”.docs/content/docs/2.components/table.md#L189-L191: Change “full width pulse” to “full-width pulse”.
🧰 Tools
🪛 LanguageTool
[grammar] ~99-~99: Use a hyphen to join words.
Context: ...indeterminate bar is displayed as a full width pulse instead. :: ### Orientation...
(QB_NEW_EN_HYPHEN)
📍 Affects 2 files
docs/content/docs/2.components/progress.md#L98-L100(this comment)docs/content/docs/2.components/table.md#L189-L191
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/content/docs/2.components/progress.md` around lines 98 - 100, Hyphenate
“full width pulse” as “full-width pulse” in the documentation tip at
docs/content/docs/2.components/progress.md lines 98-100 and the corresponding
tip at docs/content/docs/2.components/table.md lines 189-191.
Source: Linters/SAST tools
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
rg -n "full width pulse" docs/content/docs/2.components/table.mdLength of output: 345
@benjamincanac Confirmed the line in table.md. Here's the fix.
- Hyphenate "full width pulse" → "full-width pulse" in table.md tip
Failed to handle agent chat message. Please try again.
commit: |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. An unexpected error occurred while generating fixes: Not Found - https://docs.github.com/rest/git/refs#get-a-reference |
🔗 Linked issue
❓ Type of change
📚 Description
Infinite animations currently keep running when the user has
prefers-reduced-motionenabled. This gates them behindmotion-safe:and adds a designed fallback where a plain freeze would break the visual:ChatShimmer: the shimmer stops and the text is displayed as static muted text, a frozen animation would leave the highlight band stuck over transparent textChatMessages: the typing indicator dots stop bouncing and are displayed staticallyMarquee: the content stops scrolling and is displayed statically, in both orientations and RTLProgress: the indeterminate bar is displayed as a full size opacity pulse, a plain freeze would read as a stuck bar at 100% since thecarousel/swing/elastickeyframes are what set its sizeTable: the loading bar is displayed as a full width opacity pulse,inset-x-0is added under reduced motion because the keyframes are what give the bar its widthOne-shot enter/exit transitions, spinners and the
Skeletonpulse are deliberately left untouched: they are either brief, opacity only or convey loading state.Each component page gets a tip documenting the reduced motion behavior, and snapshots are regenerated, including
ToastandPageLogoswhich embedProgressandMarquee.📝 Checklist