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>
This commit is contained in:
@@ -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')
|
||||
})
|
||||
|
||||
|
||||
@@ -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
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -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')
|
||||
})
|
||||
|
||||
|
||||
@@ -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. */}
|
||||
<span className="block size-2 rounded-full border-2 border-yellow-500 border-t-transparent [animation:spin_1s_steps(12,end)_infinite]" />
|
||||
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. */}
|
||||
<span className="block size-2 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" />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user