From 64dae13bc9b5bfb7d27ae42d8f593913344c064e Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Mon, 20 Jul 2026 01:18:27 -0400 Subject: [PATCH] fix(sidebar): stop agent 'working' spinner freezing as a broken ring under reduced motion (#9515) Under prefers-reduced-motion (Windows 'Animation effects' off), the agent 'working' spinner froze mid-rotation as a partial (3/4) ring, reading as a broken spinner in the terminal tab and worktree card. Fill the top border so it becomes a complete static ring, and apply the same treatment to StatusIndicator so the sidebar dot honors reduced motion consistently instead of stepping. Mirrors the existing feature-tour-preview-glyphs pattern. Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> --- src/renderer/src/components/AgentStateDot.test.ts | 3 +++ src/renderer/src/components/AgentStateDot.tsx | 5 ++++- .../src/components/sidebar/StatusIndicator.test.ts | 4 ++++ src/renderer/src/components/sidebar/StatusIndicator.tsx | 8 ++++++-- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/components/AgentStateDot.test.ts b/src/renderer/src/components/AgentStateDot.test.ts index 2e17d0423..112972244 100644 --- a/src/renderer/src/components/AgentStateDot.test.ts +++ b/src/renderer/src/components/AgentStateDot.test.ts @@ -24,6 +24,9 @@ describe('AgentStateDot', () => { expect(markup).toContain('border-t-transparent') expect(markup).toContain('[animation:spin_1s_steps(12,end)_infinite]') expect(markup).toContain('motion-reduce:animate-none') + // Why: under reduced motion the top border is filled so the frozen ring + // reads as a complete static marker, not a broken partial spinner. + expect(markup).toContain('motion-reduce:border-t-yellow-500') expect(markup).not.toContain('animate-spin') }) diff --git a/src/renderer/src/components/AgentStateDot.tsx b/src/renderer/src/components/AgentStateDot.tsx index 9a4fe792e..7543de46f 100644 --- a/src/renderer/src/components/AgentStateDot.tsx +++ b/src/renderer/src/components/AgentStateDot.tsx @@ -78,7 +78,10 @@ export const AgentStateDot = React.memo(function AgentStateDot({ className={cn( // Why: match the sidebar worktree spinner's stepped cadence so // long-running visible agents do not keep a full-frame-rate loop. - 'block rounded-full border-2 border-yellow-500 border-t-transparent [animation:spin_1s_steps(12,end)_infinite] motion-reduce:animate-none', + // Why: under reduced motion the spin is disabled, so fill the top + // border too — a frozen transparent-top ring reads as a broken + // spinner; a complete ring reads as an intentional static marker. + 'block rounded-full border-2 border-yellow-500 border-t-transparent [animation:spin_1s_steps(12,end)_infinite] motion-reduce:animate-none motion-reduce:border-t-yellow-500', inner )} /> diff --git a/src/renderer/src/components/sidebar/StatusIndicator.test.ts b/src/renderer/src/components/sidebar/StatusIndicator.test.ts index 5f9061eb9..0179a0bac 100644 --- a/src/renderer/src/components/sidebar/StatusIndicator.test.ts +++ b/src/renderer/src/components/sidebar/StatusIndicator.test.ts @@ -23,6 +23,10 @@ describe('StatusIndicator', () => { expect(classNames).toContain('border-yellow-500') expect(classNames).toContain('border-t-transparent') expect(classNames).toContain('[animation:spin_1s_steps(12,end)_infinite]') + // Why: under reduced motion the spin is disabled and the top border filled, + // so the dot stays a complete static ring rather than freezing mid-rotation. + expect(classNames).toContain('motion-reduce:animate-none') + expect(classNames).toContain('motion-reduce:border-t-yellow-500') expect(classNames).not.toContain('animate-spin') }) diff --git a/src/renderer/src/components/sidebar/StatusIndicator.tsx b/src/renderer/src/components/sidebar/StatusIndicator.tsx index 34c149109..c181e0c29 100644 --- a/src/renderer/src/components/sidebar/StatusIndicator.tsx +++ b/src/renderer/src/components/sidebar/StatusIndicator.tsx @@ -34,8 +34,12 @@ const StatusIndicator = React.memo(function StatusIndicator({ {...rest} > {/* Why: a stepped spin preserves the worker-is-running affordance while - avoiding a full-refresh-rate compositor loop for long agent runs. */} - + avoiding a full-refresh-rate compositor loop for long agent runs. + Why: honor reduced motion (Windows "Animation effects" off → + prefers-reduced-motion) by stopping the spin and filling the top + border, so the dot stays a complete static ring instead of a + partial ring frozen mid-rotation that reads as a broken spinner. */} + ) }