Skip to content

fix(native-chat): give each animation a reduced-motion state - #26276

Merged
brennanb2025 merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:global-reduced-motion-rule
Oct 10, 2026
Merged

brennanb2025 merged 1 commit into
stablyai:mainfrom
AmoabaKelvin:global-reduced-motion-rule

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 0
Prod 19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​57 $\color{#cf222e}{\Huge{\mathbf{−}}}$​27 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​30

ELI5

Some people turn on "reduce motion" because moving things on screen make them unwell or distract them. The chat only half listened: some things stopped and others kept moving, and a stopped spinner just looked stuck. Now each moving thing in the chat has a still version that says the same thing.

What Changed

Before: with reduce motion on, the chat's "working" spinner froze as a partial ring, while the loading spinner, the spinners in the @ and / menus and on attachments, the pulsing item in the message rail, the arrow rotations and the popover slide-ins all kept moving.

After: with reduce motion on:

  • Spinners show a still hourglass instead of a frozen or spinning ring.
  • Disclosure arrows and the message rail ticks change state instantly.
  • The pending item in the message rail dims instead of pulsing.
  • Popovers, menus and the rail's hover preview appear instantly.
  • Colour and opacity fades are unchanged.

With reduce motion off, nothing changes.

Mechanism: each element declares its own reduced-motion state with a motion-reduce: class. Spinners go through a new LoadingSpinner component that renders the spinning icon and a still hourglass and shows one or the other. The style guide now states the rule: turn movement off, give spinners and pulses a still state that still says "working", and leave short fades alone.

Why

An earlier version of this PR used one global CSS rule to stop every animation. That froze spinners mid-frame with nothing else showing that work was happening. Handling each element lets it decide how to say the same thing without moving.

The chat's popovers and menus are the shared popover, dropdown menu and hover card components, so that part applies across the app. Restyling them from the chat is blocked by the design-system lint, and the content says everything without the slide.

The scripted scroll fixes that were here moved to their own PR.

Visual Proof

Captured in the real app: a hidden dev build of this PR's base (before) and this PR's head (after), with reduce motion turned on through Chrome DevTools and confirmed with matchMedia('(prefers-reduced-motion: reduce)') before every screenshot. The chat runs a local stand-in agent that starts two commands and a helper agent and never finishes them, so the turn stays "working".

Working line (reduce motion on). Four frames, about 200 ms apart, zoomed on the icon. Before, the ring stays frozen at the same angle and looks stuck. After, it is a still hourglass.

Before After
before working line frames after working line frames
before working rows after working rows

The "Running 2 commands and running 1 agent" label and the "Audit loader cache · working" subagent rows read the same in both builds.

Reduce motion off (after), for everyone else. The ring still spins, and the label and dot pulses still run.

after, reduce motion off, frames

Menus, rail preview and arrows (reduce motion on). These open within 150 ms, faster than a screenshot lands, so the motion is measured from the element's computed style right after the click or hover:

Before After
Model menu, at the click opacity 0, scaled to 95%, enter animation running opacity 1, no transform, no animation
Rail tick width on hover grows 12 → 20 px over ~180 ms 20 px immediately
Rail hover preview fades in from opacity 0.12 to 1 opacity 1 immediately
Disclosure arrow on click rotates 90° → 0° changes at once
@ and / menus while loading spinning ring still hourglass

Fully open, both builds draw the same readable menu and preview:

Before After
Model menu before model menu after model menu
Rail preview before rail preview after rail preview

Not captured: the attachment thumbnail spinner, and the rail tick for a message whose older history is still loading. Neither stays in that state long enough to catch locally. The @ loading state lasts only a few milliseconds, so it was read from the page rather than photographed.

Captured with React Grab turned off (VITE_ENABLE_REACT_GRAB=false). In a default pnpm dev build, React Grab's stylesheet loads after the app's and declares its own .hidden, which beats motion-reduce:block. So in dev both icons are hidden under reduce motion and the working line shows no icon at all. Packaged builds never load React Grab.

Testing

  • Checked each new class in headless Chromium with reduce motion on and off: the spinner hides and the hourglass shows, the pulse stops and dims, the arrow transition is off, the popover animation is off.

  • pnpm lint passes. The native chat and shared component tests pass (3,746).

  • pnpm tc reports one error in command-receipt-transaction.test.ts, which this PR does not touch and which fails the same way on main.

  • Not run: the full app, the e2e suite.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

One spinner test updated for the new class and one snapshot regenerated. No new test: the behaviour is a CSS media query the unit environment does not evaluate.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Popovers, dropdown menus and hover cards lose their slide and fade under reduce motion everywhere, not only in the chat. Tooltips and dialogs are unchanged.
  • The tool, subagent and awaiting-input pulses already stopped under reduce motion and sit beside a text label, so they are unchanged.
  • The rest of the app still needs the same treatment; this PR covers the chat.
  • No platform, SSH, mobile or wire impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

The renderer adds a shared LoadingSpinner that displays an animated loader normally and a static hourglass when reduced motion is enabled. Native chat loading indicators now use this component. Native chat chevron transitions, message rail tick motion, and shared UI animation classes also change their reduced-motion behavior. The style guide and spinner tests are updated.


Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to dbb9e

The reduced-motion fallback works, though its still-state icon would benefit from a test assertion. No production defect introduced by this change was established.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 38.24% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 29 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: adding reduced-motion states for native-chat animations.
Description check Passed The description is mostly complete and clearly explains the user impact, implementation, rationale, visual proof, testing, and scope. It omits a linked issue and leaves some checklist items unchecked,…

Full details: Docstring Coverage

Explanation

Docstring coverage is 38.24% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 29 files. (1 skipped: 1 unsupported.)



  • Fix all pre-merge checks with AI
  • Autopilot · 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.

@brennanb2025

Copy link
Copy Markdown
Contributor

Thanks for digging into this, Kelvin. The goal is right, but I'd like to be careful with a single global rule, so I'm going to hold this one for now.

My main worry is what happens when an animation is the only thing telling you what's going on. A spinner or a pulsing "working" label is how you know the agent is busy. With the global rule it freezes mid-frame, and nothing else shows that work is happening, so users may not know whether Orca is busy or stuck. Where we drop the motion, we need to show the same thing another way: a still "working" icon or a label.

Could we handle reduced motion element by element instead? Each animation can then decide how it says the same thing without moving:

  • Moving or sliding things (popovers sliding in, panels and rows animating into place) can turn their motion off under motion-reduce:, because the content still says everything.
  • Spinners, pulses and progress indicators switch to a still state that still clearly says "working", rather than freezing mid-frame.
  • Short opacity fades can usually stay, since they don't move anything.

I'd start with native chat first and foremost: the working line, tool and subagent labels, the message rail, the chat's popovers and menus, and the loading spinners there. Once that's in, we can work through the rest of the app the same way.

The scroll changes are great and I'd keep them as they are: motionSafeScrollBehavior() and switching scripted smooth scrolls to an instant jump. If you split those into their own PR, I'm happy to merge that quickly.

Spinners swap to a still hourglass instead of freezing; chevrons, the rail and popovers stop moving.
@AmoabaKelvin
AmoabaKelvin force-pushed the global-reduced-motion-rule branch from 6b493a1 to dbb9e52 Compare October 9, 2026 07:43
@AmoabaKelvin AmoabaKelvin changed the title fix(renderer): honor reduced motion for every animation and transition fix(native-chat): give each animation a reduced-motion state Oct 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx (1)

95-95: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the LoadingSpinner still-state icon.

LoadingSpinner renders Loader2 first and Hourglass second. The tests use querySelector('svg'), so they inspect only Loader2. A regression that removes or hides the Hourglass fallback can pass. Assert the fallback's hidden motion-reduce:block classes in both reduced-motion assertions.

Suggested fix
     const activity = screen.getByText('Working…')
     const row = activity.closest('[data-native-chat-turn-activity]')
     const spinner = row?.querySelector('svg')
+    const stillIndicator = row?.querySelector('.lucide-hourglass')
     expect(activity).not.toHaveClass('animate-pulse', 'animate-spin')
     expect(spinner).toHaveClass('size-4', 'animate-spin', 'motion-reduce:hidden')
+    expect(stillIndicator).toHaveClass('hidden', 'motion-reduce:block')

Add the same stillIndicator query and assertion to the running-tool test.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c5672d52-dba1-4cef-be0a-d518facf1e1e
📥 Commits

Reviewing files that changed from the base of the PR and between 6b493a1777564e8bfadab91c94d008f1ad8f6c0d and dbb9e52.

⛔ Files ignored due to path filters (1)
  • src/renderer/src/components/sidebar/__snapshots__/subagent-child-row-fallback-pixels.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (20)
  • docs/STYLEGUIDE.md
  • src/renderer/src/components/LoadingSpinner.tsx
  • src/renderer/src/components/native-chat/NativeChatAutocompleteMenus.tsx
  • src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx
  • src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx
  • src/renderer/src/components/native-chat/NativeChatDiffCard.tsx
  • src/renderer/src/components/native-chat/NativeChatImageAttachmentPreview.tsx
  • src/renderer/src/components/native-chat/NativeChatLoadingCue.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageRail.tsx
  • src/renderer/src/components/native-chat/NativeChatQueuedMessageCard.tsx
  • src/renderer/src/components/native-chat/NativeChatSubagentRun.tsx
  • src/renderer/src/components/native-chat/NativeChatSubagentSectionHead.tsx
  • src/renderer/src/components/native-chat/NativeChatToolLine.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx
  • src/renderer/src/components/native-chat/NativeChatTurnActivityLine.tsx
  • src/renderer/src/components/native-chat/NativeChatWorkingStatus.tsx
  • src/renderer/src/components/ui/dropdown-menu.tsx
  • src/renderer/src/components/ui/hover-card.tsx
  • src/renderer/src/components/ui/popover.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/STYLEGUIDE.md

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

@AmoabaKelvin

AmoabaKelvin commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thanks Brennan, that makes sense.

I've reworked this PR the way you described and dropped the global rule:

  • Spinners in the chat switch to a still hourglass under reduce motion instead of freezing.
  • Disclosure arrows and the message rail change state instantly.
  • The pending item in the message rail dims instead of pulsing.
  • Popovers, menus and the rail's hover preview appear without sliding.
  • Colour and opacity fades are left alone.

Two things to flag:

  • The chat's popovers and menus are the shared popover, dropdown menu and hover card components, so that part applies across the app, not only the chat. Tooltips and dialogs are untouched.
  • The hourglass is my pick for the still icon. Happy to swap it if you have something else in mind.

The scroll changes are split out into #26796 as you suggested.

@brennanb2025
brennanb2025 merged commit f9829cd into stablyai:main Oct 10, 2026
23 of 25 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.

2 participants