Skip to content

feat(gui): follow the OS reduce-motion setting - #889

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
niukanen1:reduce-motion-839
Oct 19, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
niukanen1:reduce-motion-839

Conversation

@niukanen1

@niukanen1 niukanen1 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With reduced motion on, the lyrics page and the Room lyrics column now jump to the current line instead of gliding, and the CSS transitions (the settings switch knob, the folder chevron, hover slides) are turned off. With the setting off nothing changes, and flipping it takes effect right away with no reload

A scrollBehavior() helper reads prefers-reduced-motion inside the scroll effects, and one @media (prefers-reduced-motion: reduce) block in style.css sets transition: none !important across the GUI. No new interface text, so the Rust string table and the generated bindings stay untouched

Fixes #839

Testing

In gui/, on macOS arm64:

  • npm ci
  • npm run lint
  • npm run format:check
  • npm run typecheck
  • npm test (58 files, 500 passed, including the 2 new tests in motion.test.ts)
  • npm run build
  • npm test -- motion shows 2 passed
  • git grep -n smooth -- gui/src lists only motion.ts and motion.test.ts

The two tests in motion.test.ts were red first: inverting the helper's return values failed both, restored after

Additional notes

With the OS setting on, Settings switches jump instead of sliding and synced lyrics pages step line by line. With it off, behavior is identical to today

Summary by CodeRabbit

  • New Features
    • The app now respects your operating system’s reduced-motion setting. When enabled, lyric scrolling jumps directly to the active line, and animated switches, folder chevrons, and hover slides change without sliding.
    • Turn reduced motion off to restore animations without reloading the app.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 615f12b3-5ab0-4d6e-8999-7530c99178b4
📥 Commits

Reviewing files that changed from the base of the PR and between 1061e85 and 3536dad.

📒 Files selected for processing: 1
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes: 1
  • CHANGELOG.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The GUI checks the operating system’s reduced-motion preference. Both lyric views use automatic scrolling when reduced motion is preferred and smooth scrolling otherwise. A CSS media query disables transitions for that preference.

Changes: Reduced-motion behavior

Layer / File(s) Summary
Preference-aware scrolling and animations
gui/src/motion.ts, gui/src/LyricsPage.tsx, gui/src/Room.tsx, gui/src/style.css, gui/src/motion.test.ts, CHANGELOG.md
The shared scrollBehavior() helper selects automatic or smooth scrolling based on matchMedia. Both lyric views use the helper. The CSS media query disables transitions when reduced motion is preferred. Tests cover both scrolling modes, and the changelog describes the change.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 3536d

This change adds a changelog entry describing the new reduced-motion behavior in the GUI. No merge-blocking risk was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the allowed conventional-commit prefix and scope, states the main GUI change, and uses a concise imperative subject.
Linked Issues check Passed Issue #839 requires reduced-motion support, preserved default motion, lyric jumps in LyricsPage and Room, a scroll helper, tests, and an Unreleased changelog entry. scrollBehavior() returns "auto"…
Out of Scope Changes check Passed The reviewed changes are limited to the requested GUI motion helper, LyricsPage and Room integration, reduced-motion CSS, focused tests, and the Unreleased changelog entry. These changes implement iss…
Full details: Linked Issues check

Explanation

Issue #839 requires reduced-motion support, preserved default motion, lyric jumps in LyricsPage and Room, a scroll helper, tests, and an Unreleased changelog entry. scrollBehavior() returns "auto" when window.matchMedia(REDUCED_MOTION) matches and "smooth" otherwise. LyricsPage.tsx and Room.tsx use the helper. style.css disables transitions under prefers-reduced-motion: reduce. motion.test.ts tests both results. CHANGELOG.md contains the Unreleased entry. The supplied test report covers lint, formatting, type checking, unit tests, and build. No dependency, Rust, binding, progress-tracking, transform, or end-to-end test change is reported.

Full details: Out of Scope Changes check

Explanation

The reviewed changes are limited to the requested GUI motion helper, LyricsPage and Room integration, reduced-motion CSS, focused tests, and the Unreleased changelog entry. These changes implement issue #839. No unrelated change is demonstrated.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

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

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

With reduced motion on, the lyrics page and the Room lyrics column jump
to each new line instead of gliding, and the CSS transitions (switch
knob, folder chevron, hover slides) are turned off. Turning the setting
off brings the motion back with no reload.

Closes LargeModGames#839
@LargeModGames
LargeModGames merged commit 6e3987e into LargeModGames:main Oct 19, 2026
32 checks passed
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.

GUI: respect the OS "reduce motion" setting

2 participants