Skip to content

feat(ui): one motion system on shared tokens, off under reduced motion - #5266

Merged
kovtcharov-amd merged 2 commits into
amd:mainfrom
kovtcharov:claude/ui-motion-system-5259
Oct 19, 2026
Merged

kovtcharov-amd merged 2 commits into
amd:mainfrom
kovtcharov:claude/ui-motion-system-5259

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Held until after v0.25.0.

During a long turn the Agent UI gave little sign it was working, and its motion was 84 hand-picked timings that reduced motion only partly stopped. Now one live status line carries a subtle sweep while the model works. Plan steps tick over, the side rail slides in, and queued messages ease into place. Every timing comes from a small set of tokens, reduced motion stops all of it (including the status typewriter and smooth scrolling), and an idle window runs no animation at all.

Live status line, before and after, from real local turns (main vs this branch, same backend and prompt; reduced motion emulated in the page):

Live status line: before and after, normal and reduced motion

  • Before: only the cursor blinks, and with reduced motion on the label still types itself out.
  • After: a slow highlight sweeps the label while the model works. With reduced motion on, the label appears whole, has no sweep, and document.getAnimations() reports nothing running.
  • The GIF is stitched from frames captured about 0.3 s apart, so the sweep looks steppier than it does live.
🔍 Technical details
  • Tokens: --duration-fast|--duration|--duration-slow|--duration-spin|--duration-blink|--duration-pulse|--duration-shimmer, --ease|--ease-in-out|--ease-linear|--ease-step, --stagger, --toast-hold.
  • The shimmer is an alpha mask-image sweep, not a gradient fill (the design language bans those). Its dim stop is 80%, which keeps the 11 px label above AA in both themes.
  • The global reduced-motion rule keeps 0.01 ms rather than none, so forwards fills and toast holds still land. It now also forces scroll-behavior: auto. JS motion reads prefersReducedMotion() from utils/motion.ts.
  • motion.test.ts rejects literal times, raw easings, var() fallbacks and non-motion variables in any animation*/transition* declaration. It also requires every loop to sit on a live-state selector.
  • Queue-place changes animate only on remount. Adding key={place} on feat(ui): chat list shows what needs you, chats queue for the GPU, notification settings #5242's .sb-row-queue span makes each change replay.
  • With feat(ui): show a turn's work in plain words, with a live plan checklist #5245 merged there are two live lines (Thinking… · 24s in the bubble, Waiting on the model · 8s in the summary). Only the bubble line shimmers. Folding the two into one is a product follow-up.

Test plan

  • cd src/gaia/apps/webui && npx vitest run: 857 pass, including styles/__tests__/motion.test.ts and MessageBubble.liveMotion.test.tsx
  • npx tsc --noEmit is clean
  • Run a multi-step turn in the Agent UI and send a second message while it works. Check that the status line sweeps, the queued row drops in, the rail slides in, and once the turn ends document.getAnimations().filter(a => a.playState === 'running') is empty.
  • Turn on reduced motion in the OS (or emulate it in DevTools) and repeat. The label appears whole with no sweep, spinners stand still, and the rail and queue appear without movement.

Verified locally on main merged with #5245, #5246 and #5241 (backend :4309, Vite :5309, real local turns), with reduced motion emulated in the page.

GAIA's motion had 84 hand-written timings and gave no sign of life on the newer
pieces. Every animation and transition now takes its duration and easing from
tokens in index.css, and a lint test keeps it that way.

- The live status line sweeps a subtle highlight while the model works and
  stops when GAIA waits on the user.
- Plan steps tick over when done, the side rail slides in, queued messages and
  GPU-queue places ease in. Their selectors apply once those components land.
- Reduced motion also stops script-driven motion: the status typewriter and
  smooth scrolling.
- Every looping animation is tied to live work, so an idle window is still.

Closes amd#5259
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

The PR moves every Agent UI animation onto shared timing tokens, makes reduced motion stop all of it (including the typewriter label and smooth scrolling), and adds a subtle sweep to the live status line. I found no correctness bugs. The new lint test stops literal timings from creeping back in, and the reduced-motion paths are tested.

Before merging:

  • Add a before/after capture. It's an Agent UI change, so a short screen recording or screenshots of the live line, plus the same view with reduced motion on, would back up the "verified locally" note. This is a nudge, not a blocker.
  • Expect a merge-order conflict. The checklist, rail and queue rules target class names from four open PRs. Whichever lands second will fail the new lint (feat(ui): chat list shows what needs you, chats queue for the GPU, notification settings #5242's literal 1.4s), and a renamed class there would quietly turn this PR's motion off. Recheck the selectors after those PRs merge.

Real-world evidence

N/A: no evidence bundle was produced for this run, and real Agent UI rendering is deferred to the strix-halo lane. I couldn't run the new vitest suites here (the webui dependencies aren't installed on this runner). The verdict rests on static review plus the author's local verification.

🔍 Technical details

Issues

🟡 No visual evidence for an Agent UI change. The rubric asks for a Playwright before/after on gaia chat --ui. A GIF of the is-live sweep, with a second one under DevTools "emulate prefers-reduced-motion", covers the test plan's last two items.

🟢 The live label now changes colour as well as sweeping (styles/motion.css:12). .thinking-indicator is --text-muted (MessageBubble.css:549). While live, the label switches to --text-primary at an alpha of 80–100%, which is noticeably brighter than before. It flips back to muted on "Waiting for you" and under reduced motion (color: inherit). That seems intentional for contrast, but the PR body only mentions a "subtle sweep". Worth one line in the description so reviewers know the colour shift is deliberate.

🟢 The reduced-motion preference is read once per indicator (MessageBubble.tsx:53). useState(prefersReducedMotion) doesn't react if the OS setting changes mid-turn. That's acceptable because each new bubble re-reads it, and CSS still stops the sweep immediately. It's only worth a matchMedia change listener if utils/motion.ts grows more consumers.

🟢 motion.css styles selectors that don't exist yet (.side-rail, .queued-message*, .sb-row-queue, .sb-dot, .plan-icon-done). The header comment says so. A follow-up test asserting that each selector appears in some .tsx would catch a rename in #5241/#5242/#5245/#5246 instead of letting the motion silently drop.

Strengths

  • motion.test.ts enforces the token system. It rejects literal times, raw easings, var() fallbacks and non-motion variables, and it requires every infinite loop to sit on a live-state selector, so the rule can't drift.
  • Keeping reduced motion at 0.01ms rather than none lets forwards fills and the toast hold delay still land. Adding scroll-behavior: auto plus scrollBehavior() for JS scrollIntoView closes the gap that CSS alone can't reach.
  • The shimmer is an alpha mask, so it follows the no-gradient-fill design rule. The thinking-dot delays were re-expressed as fractions of the shimmer duration, keeping the wave in phase.

@kovtcharov

Copy link
Copy Markdown
Contributor Author

Both suggestions are addressed in the PR description.

The red Windows unit-test job ran past its 1h30m limit and was cancelled; no test failed. Main's Windows job now finishes in about 16 minutes. I merged current main into the branch, without a force-push, so CI re-runs on it.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 19, 2026
Merged via the queue into amd:main with commit ef78e7e Oct 19, 2026
39 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the claude/ui-motion-system-5259 branch October 19, 2026 08:29
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Oct 19, 2026
…ter (amd#5290)

The Agent UI looked developer-built: copper on cool blue-grey, 19 font
sizes, labels in spaced-out monospace capitals, and buttons in three
different shapes. This lands the foundation of the approved redesign
(amd#1001). It brings warm gray neutrals and muted brass for actions and
focus only. Inter replaces DM Sans and Space Mono. Controls are soft
tinted, rise slightly on hover and settle on press, and dialogs use calm
sentence-case titles. Every token keeps its name, so the open feature
PRs pick up the new look without edits. With no saved theme, the app now
follows the OS instead of defaulting to dark, so a light-mode user who
never picked a theme opens it in light.

**Decided: brass on both the Agent UI and the TUI.** This PR moves the
Agent UI first. The TUI keeps copper only until amd#5291 lands a
terminal-safe brass, because the light brass `#7A5A22` rounds to
`#875F00` on a 256-colour terminal, which is the TUI's Warning and
Selected entry. Until then the cross-surface test pins the TUI's copper
on its own, and amd#5291 restores the shared-accent assertion. The commit
marked `[decision pending]` predates the decision.

**Stacked on amd#5266.** This branch includes amd#5266's motion commit,
because its tokens are the motion base; review the commits after it.
Lands after v0.25.0.

| Before (`main`) | After |
|---|---|
|
![](https://raw.githubusercontent.com/kovtcharov/gaia/ui-redesign-1001-before/finished-answer-light-win32.png)
|
![](https://raw.githubusercontent.com/kovtcharov/gaia/5eb5f66b5ff11ed138c04b692443ee044caa5352/src/gaia/apps/webui/visual/__screenshots__/finished-answer-light-win32.png)
|
|
![](https://raw.githubusercontent.com/kovtcharov/gaia/ui-redesign-1001-before/scheduled-tasks-light-win32.png)
|
![](https://raw.githubusercontent.com/kovtcharov/gaia/5eb5f66b5ff11ed138c04b692443ee044caa5352/src/gaia/apps/webui/visual/__screenshots__/scheduled-tasks-light-win32.png)
|
|
![](https://raw.githubusercontent.com/kovtcharov/gaia/ui-redesign-1001-before/documents-dark-win32.png)
|
![](https://raw.githubusercontent.com/kovtcharov/gaia/5eb5f66b5ff11ed138c04b692443ee044caa5352/src/gaia/apps/webui/visual/__screenshots__/documents-dark-win32.png)
|
|
![](https://raw.githubusercontent.com/kovtcharov/gaia/ui-redesign-1001-before/new-chat-dark-win32.png)
|
![](https://raw.githubusercontent.com/kovtcharov/gaia/5eb5f66b5ff11ed138c04b692443ee044caa5352/src/gaia/apps/webui/visual/__screenshots__/new-chat-dark-win32.png)
|

**Defaulted, easy to change.** The four round-3 design questions went
unanswered, so the recommended answers stand: a green tick for a
finished step, neutral markers for the selected chat and current
chapter, a small dark dot for an unread answer, and an icon shadow that
falls only outside each shape. They apply in the follow-ups below, which
own those components.

## Test plan

- [ ] `npm test` in `src/gaia/apps/webui`: 899 pass, including new
contrast cases for the raw brass and the switch knob on it
- [ ] `npx tsc --noEmit -p .` and `npx tsc --noEmit -p visual` in
`src/gaia/apps/webui` are clean
- [ ] `npx vitest run` in `website/`: 236 pass
- [ ] `go test ./internal/ui/theme/...` in `tui/` passes against the
updated spec
- [ ] `npm run test:visual` in `src/gaia/apps/webui`: 12 snapshots, six
screens in light and dark, match on Windows (set `GAIA_VISUAL_CHROMIUM`
to a local Chromium if `npx playwright install chromium` can't download)
- [ ] `gaia chat --ui`: switch Light, Dark and Match system in Settings
› General. The composer shows a brass focus ring, buttons lift on hover,
the warning notice shows its icon, and Settings switches are brass when
on.

<details>
<summary>🔍 Technical details</summary>

**What moved**
- `index.css` tokens: warm-gray palette in both themes; brass `--accent`
(`#7A5A22` / `#D4B47E`); soft-tinted `--accent-fill`; new
`--accent-solid`, `--accent-ring`, `--shadow-press`, `--ease-spring`,
`--duration-spring`, `--duration-press` and `--fs-*`. The layered
`--shadow-sm/md/lg` carry a light top rim. None of them is a glow, and
the no-glow guard passes.
- Each place that used `--accent-fill` as a solid mark moved to a role
that stays visible on the new pale wash: switch tracks, native
checkboxes and progress bars, the suggested permission button, and the
count badges in `Sidebar.css` and `NotificationCenter.css`.
- `ScheduleManager.css` redefined `.btn-primary` and `.btn-secondary`
unscoped. Once its lazy chunk loaded, every button in the app changed
shape. Those rules are removed.
- Labels that were uppercase or monospace in stylesheets no other open
PR touches are now sentence-case Inter. Paths, keys and code stay
monospace.
- `--bg-active` rejoins the contrast matrix. The pinned copper used to
fail on it; the brass clears every floor.
- The Electron mirrors (`main.cjs`, the installer dialog), `index.html`
`theme-color` and `utils/theme.ts` follow the new canvas.

**Visual suite** (`src/gaia/apps/webui/visual/`): `vite preview` of the
production build, every `/api` call answered from fixtures, a frozen
clock, animations off, and at most 50 differing pixels. An API call
without a fixture fails the test by name. Baselines are Windows-only and
no CI job runs the suite yet; follow-up below.

**Follow-ups once these PRs merge** (each restyle goes through tokens;
no code here depends on them)
- amd#5242: sidebar rich rows (status, preview line, time), titles that
fade instead of truncating, borderless search.
- amd#5240: 28px greeting, raised suggestion cards that lift, first-run
stepper. `SetupScreen.css` gets a one-line change here, outside amd#5240's
hunks.
- amd#5243: Memory with neutral stat figures, brass switches instead of
green, and no per-tile hues.
- amd#5245: live checklist with each step's time, a shimmering live step,
and sans labels.
- amd#5269 / amd#5266: a raised user bubble, 15px answer prose, path chips and
the answer footer.
- amd#5244: AdvancedSettings headings in sentence case, and warning status
text with its icon.
- amd#5246, amd#5241, amd#5275, amd#5283, amd#5239: side rail, queue rows, context
panel, session panel and turn changes adopt the type and elevation
tokens.
- New behaviour, each its own PR: resizable panes, chapter bars (amd#5271),
the outer-only icon shadow wrapper, and Linux baselines plus a CI job
for `test:visual`.
- TUI: brass that survives 256-colour rounding, re-unifying the accent
(amd#5291).
</details>

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

electron Electron app changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants