Repository navigation
fix(renderer): jump instead of smooth-scrolling under reduced motion - #26796
Conversation
A scripted scroll's explicit behavior ignores the reduce-motion setting.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The change makes the listed scripted scrolls respect reduced-motion settings. No concrete regression is established, so it appears ready to merge subject to ordinary checks. Pre-merge checks |
|
ELI5
When you turn on "reduce motion", things that glide across the screen should jump straight there instead. Several places in Orca still glided when they scrolled for you. Now they jump.
What Changed
Before: with reduce motion on, these scrolls still animated: the tab strip arrows and scroll indicator, jumps to review comments in the markdown preview and rich editor, markdown heading links, the checks panel comment list, and two jumps in Settings.
After: with reduce motion on, each of those goes straight to its target. With it off, nothing changes.
Mechanism: a scroll started from code with an explicit smooth behavior ignores the reduce-motion setting, so each call has to check it. One function,
motionSafeScrollBehavior(), returns an instant jump when the setting is on. The seven files call it, and the sidebar reveal uses it in place of its own inline copy of the same check.Why
The sidebar already did this check by hand. Sharing it means the next scripted scroll gets the right behavior by calling one function, and the style guide now points to it.
Split out of #26276 as requested in review there.
Visual Proof
N/A: the only change is that a scroll animation is skipped when reduce motion is on.
Testing
Confirmed in headless Chromium that a scripted smooth scroll still animates with reduce motion emulated, which is why the call sites need the check.
pnpm lintpasses. Tests for the touched areas pass: tab bar, checks panel, sidebar reveal (851).pnpm tcreports one error incommand-receipt-transaction.test.ts, which this PR does not touch and which fails the same way onmain.Not run: the full app, the e2e suite.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
The function is the sidebar reveal's existing check moved to a shared place. The new
usePrefersReducedMotion.test.tscovers its reduced-motion branch: with reduced motion on, a smooth scroll becomes an instant jump; with it off, or with nomatchMedia, the requested behavior is kept.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)