Skip to content

Studio: turn Reduce motion on by default - #17377

Merged
shimmyshimmer merged 1 commit into
mainfrom
studio-reduce-motion-default
Nov 10, 2026
Merged

shimmyshimmer merged 1 commit into
mainfrom
studio-reduce-motion-default

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

What changed

Reduce motion (Settings > Appearance) now defaults to On instead of Off, for Studio and Desktop.

  • appearance-custom-store.ts: DEFAULT_CUSTOMIZATION.reduceMotion is "on", and the sanitizer falls back to "on" for a missing or invalid value. Off and System stay selectable.
  • routes/settings.py: the saved personalization model defaults reduceMotion to "on", so a payload without the field does not write Off back to the account.
  • Tests updated to pin the new default (tests/reduce-motion-default.test.ts, test_personalization_settings.py::test_customization_defaults).

Who sees it

New installs and new accounts start with Reduce motion on. Existing accounts keep what they have stored: Studio persists the full appearance customization (locally and on the account) on first load, so anyone who has opened Studio already has an explicit value saved, and there is no way to tell an untouched Off from a chosen one. This PR deliberately does not migrate those.

Verification

  • npm run typecheck, npm test (15584 pass, 0 fail) in studio/frontend. biome check on the touched files reports the same diagnostics as on main.
  • pytest studio/backend/tests/test_personalization_settings.py (61 passed).
  • Built the Desktop app (macOS, debug bundle) and Studio from this branch on a no-torch install and confirmed the served bundle carries the new default.

Not tested here

  • Cross-platform staging CI and UI screenshots were not run for this change.
  • Desktop signing, notarization and the updater path are not exercised from this host (this change does not touch them).

@shimmyshimmer
shimmyshimmer merged commit e236140 into main Nov 10, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-reduce-motion-default branch November 10, 2026 11:25
danielhanchen added a commit that referenced this pull request Nov 10, 2026
… is on by default (#17395)

## Summary

`Repo tests (CPU, studio)` is red on `main` since #17377 merged:

```
tests/studio/test_appearance_coverage.py::test_every_appearance_setting_is_measured_or_allowlisted
E   AssertionError: appearance setting reduceMotion='off' is not measured: set it in CUSTOM_MEASURED or list ('reduceMotion', 'off') in ENUM_ALLOW with a reason
```

#17377 turned Reduce motion on by default. The coverage guard from
#17262 requires every appearance value to be the default, measured by
the long-chat gate, or allowlisted with a reason. Until #17377 the
default was `'off'` (forced motion), which every gate mode measured, so
`reduceMotion` sat in `CUSTOM_ALLOW` on that basis. With the default now
`'on'`, the costliest value, forced motion, is no longer measured
anywhere. The guard is right and #17377 is right; the coverage table
needs to follow the new default.

## Changes

- `tests/studio/_appearance_coverage.py`:
- `CUSTOM_MEASURED` gets `"reduceMotion": "off"`, so the `+custom` gate
modes now run with forced motion, the setting's costliest value.
- `CUSTOM_EXPECT` gets `force-motion`, the class the store puts on
`<html>` for `'off'`, so a renamed key cannot silently measure nothing.
- `reduceMotion` leaves `CUSTOM_ALLOW`, whose reason ("default 'off' is
what every mode measures") is no longer true.

No product code changes; default modes keep measuring the new default.

## Testing

- `tests/studio/test_appearance_coverage.py`: 5 passed (fails on `main`
as above).
- `test_area_matrix.py`, `test_webkit_leg.py`, `test_firefox_leg.py`,
`test_appearance_coverage.py`: 91 passed.
- Not run here: the long-chat Playwright gate itself, where the
`+custom` modes will now also check that `force-motion` reached
`<html>`.
danielhanchen added a commit that referenced this pull request Nov 10, 2026
…a transition on every element (#17413)

## Summary

Since #17377 turned Reduce motion on by default, the area matrix in
`Frontend build + bundle sanity` fails on main: in every Glass material,
opening the API monitor restyles 3,400 to 4,900 elements against about
110 in the default appearance (limit 10x). Bisecting
`ec6d1606..c3af42a` with only that cell measured lands on #17377 (123
elements before it, 13,754 after).

#17377 itself is fine, it only flips a default. It exposed a cost that
every user who had turned Reduce motion on was already paying:

- Reduce motion sets `transition-duration: 0.01ms` on every element
(`html.force-reduced-motion *`). Elements with no transition of their
own keep the initial `transition-property: all`, so every property
change on them now runs a transition.
- `* { scrollbar-color: oklch(0.5 0 0 / 0.54) transparent }` puts an
oklch colour on every element. Chromium reads it back as `oklab(...)`
once a transition has run on it, so the next restyle of that element
sees a different value and starts another `scrollbar-color` transition,
which restyles it again.

A Chrome trace of one API monitor open and close in Liquid Glass shows
10,635 `scrollbar-color` transitions started, and nearly every restyle
reason is `Animation`. Any restyle of a long thread triggers the same
loop, not just the monitor.

## Change

- Every `scrollbar-color` in `index.css` and `hub.css` is now written as
the equivalent `rgb()` (for example `oklch(0.5 0 0 / 0.54)` becomes
`rgb(99 99 99 / 0.54)`). These are achromatic greys, so the conversion
is exact to the nearest 8-bit step and nothing changes on screen. Legacy
colours round-trip unchanged, so no spurious transition starts.
- `studio/frontend/tests/scrollbar-color-legacy-rgb.test.ts` checks
every `scrollbar-color` under `src/` is rgb, hex or a keyword, and
rejects oklch, `var()` and `color-mix()`. Run against main's
`index.css`, it fails and lists the oklch values.

## Measured

Production long-thread build, Chromium, same harness as the area matrix
(`_area_matrix.Page.sweep`), elements restyled per area:

| Area | Appearance | Turns | main | this PR |
|---|---|---|---|---|
| type | default | 200 | 63 | 53 |
| type | liquid-3d | 200 | 12,980 | 1,306 |
| thread_scroll | default | 200 | 3,878 | 1,497 |
| thread_scroll | liquid-3d | 200 | 19,816 | 3,706 |
| api_monitor | liquid | 40 | 13,779 | 4,105 |

CPU for typing in liquid-3d at 200 turns goes from 2.9 s to 0.6 s.

## Not fixed here

With Reduce motion on, the API monitor cell is still above the 10x limit
in Glass (about 4,000 elements against 110). That remainder does not
come from CSS: with this change it stays at 3,400 even when every
reduced-motion transition is forced to `0s`, and it drops to 117 when
Reduce motion is set to Off. It comes from the JS side of Reduce motion
and needs its own change.

## Testing

- `node --test tests/scrollbar-color-legacy-rgb.test.ts
tests/dialog-scrollbar-corners.test.ts` pass. The new test fails on
main's `index.css`.
- The built CSS carries the rgb values (`scrollbar-color:#6363638a
transparent` and so on).
danielhanchen added a commit that referenced this pull request Nov 10, 2026
…ening it in Glass stops restyling the app (#17418)

## Summary

With Reduce motion on (the default since #17377), opening or closing the
floating API monitor in any Glass material restyled the whole app root.
That is the area-matrix failure on main and on every PR, in `Frontend
build + bundle sanity`, `Composer (ubuntu-latest, browsers)` and `Inline
images (ubuntu-latest)`:

```
appearance mode liquid makes area api_monitor cost 3,626 elements restyled against 112 in the default appearance at 40 turns = 32.4x (limit 10.0x ...)
appearance mode liquid-3d makes area api_monitor cost 4,905 elements restyled against 110 in the default appearance at 200 turns = 44.6x (limit 10.0x ...)
```

This fixes it without touching Reduce motion, Glass, or how the panel
looks or behaves.

## Cause

`__root.tsx` renders `<ApiMonitorOverlay />` before the sidebar, and the
overlay returned its `AnimatePresence` directly. Each open therefore
inserted the panel's `fixed` wrapper as the **first child of `#root`**,
and each close removed it again.

A Chrome trace with invalidation tracking shows that insertion
invalidating the whole `#root` subtree (Chromium's positional sibling
invalidation). Under Reduce motion in Glass that is about 1,700 elements
on open and 1,650 on close. The position is what matters. In the same
page state:

| Inserted node | Elements restyled |
|---|---|
| a plain `<div>` prepended to `#root` | 1,653 |
| a plain `<div>` appended to `#root` | 5 |
| a plain `<div>` appended to `<body>` | 4 |

## Change

`ApiMonitorOverlay` now returns an always-mounted host, `<div
data-api-monitor-host="" className="contents">`, with the
`AnimatePresence` inside it. The panel mounts and unmounts inside that
host, so `#root`'s children never change when it opens.

- `display: contents` keeps the host out of layout. The panel is
`position: fixed` with its own z-index, so where it sits and what it
covers are unchanged.
- The overlay stays in the same place in the React tree, so the `useId`
paths of everything after it are unchanged.

`tests/api-monitor-stable-host.test.ts` pins this: the overlay returns
the host, the host is not conditional and is `contents`, and
`AnimatePresence` sits inside it. On main's overlay the test fails.

## Measured

Production long-thread build, Chromium, the area matrix's own
`Page.sweep`, elements restyled by the `api_monitor` area:

| Appearance | Turns | main | this PR |
|---|---|---|---|
| default | 40 | 110 | 108 |
| liquid | 40 | 4,105 | 382 |
| blurred | 40 | 3,849 | 385 |
| frosted | 40 | 3,853 | 388 |
| liquid-3d | 40 | 4,141 | 131 |
| liquid-3d | 200 | 4,905 | 290 |

All of these are now well inside the 10x ceiling (at most 3.6x), and CPU
stays inside it too (liquid 7.1x, liquid-3d 5.9x at 200 turns).

## Testing

- `tests/api-monitor-stable-host.test.ts` passes, and fails on main's
overlay.
- The existing overlay suites pass, 302 tests: `api-monitor-snapshot`,
`drag-costs-no-render`, `floating-panel-position`, `glass-motion`,
`find-in-page`, `keyboard-shortcuts`.
- `tsc --noEmit` is clean.

Nothing on screen changes: the panel opens in the same place with the
same fade, so there are no before and after screenshots.
danielhanchen added a commit that referenced this pull request Nov 11, 2026
…17466)

## Summary

Reduce motion is on by default since #17377, and its blanket rule in
`index.css` gives every element `transition-duration: 0.01ms`.
`transition-property` defaults to `all`, so that one line turns on
transitions for every property of every element, including the many no
rule ever meant to animate.

Chromium makes this expensive. `* { scrollbar-color }` sets a scrollbar
colour on every element, and Chromium starts a scrollbar-color
transition on each of them whenever they are restyled, even when the
value does not change (the from and to keyframes are identical). With
any non-`auto` colour, a body-level restyle in a 40 turn Liquid Glass
chat started about 2,000 of these transitions, and more as the chat
grows. This is behind the Chromium long-chat gate cells that keep
failing on recent PRs (`area thread_scroll (liquid-3d)` and `area stream
(liquid-3d)` growing 2.5x to 2.8x from 40 to 200 turns, e.g. #17453 and
#17460).

## Change

- Both Reduce motion blocks (`html.force-reduced-motion`, on by default,
and the OS `prefers-reduced-motion` block) now give the `*` blanket
`transition-duration: 0s`. A transition that lasts 0.01ms and one that
does not run look the same, so nothing on screen changes and Reduce
motion stays on.
- A second rule in each block keeps 0.01ms for elements that still need
their `transitionend`:
- elements that declare a transition through a Tailwind class
(`[class*="transition"]`), which covers the reasoning and sidebar
collapsibles that unmount on `transitionend`;
- the overlays `native-view.ts` follows by their transition events
(`CLICKABLE_SELECTOR`: toasts, the find bar, native clickables and the
rail), so the Desktop browser view keeps its hole in place while they
appear.
- The annotation layer's zoom only had a transition because of the
blanket. Its comment now says what happens without one: the existing
`[zoom]` effect redraws it.

## Guard

New `studio/frontend/tests/reduced-motion-implicit-transitions.test.ts`:

- fails if either Reduce motion `*` blanket sets a nonzero
`transition-duration`, with its own cases for the checker;
- requires the 0.01ms exemption in both blocks, and that it lists every
part of `native-view.ts`'s `CLICKABLE_SELECTOR`, so the two cannot drift
apart.

`reasoning-grid-collapse.test.ts` now checks that the collapse is
reached through the class exemption instead of counting the old blanket
lines.

Against main's `index.css` the new test and the updated collapse test
fail (3 failures); with this change all 20 tests in the four related
files pass.

## Measurements

Chromium (the long-chat gate's headless build and harness, this host),
Liquid Glass 3D, main-thread CPU per area at 200 turns, three
interleaved runs each:

| Area | main | this PR |
|---|---|---|
| `thread_scroll` | 1,166 / 679 / 628 ms | 186 / 209 / 166 ms |
| `stream` | 3,072 / 3,242 / 3,244 ms | 1,450 / 1,241 / 1,175 ms |
| `command_palette` | 1,370 / 1,058 / 1,172 ms | 326 / 236 / 346 ms |

Scrollbar-color transitions started by one body-level restyle at 40
turns: 2,550 on main, 0 with this change.

## Long-chat gate: Settings ceiling

With the blanket transitions gone, the gate's 40 turn reading of opening
Settings in the default appearance drops from about 6,100 elements
restyled to about 2,400, while the 200 turn reading stays near 7,900.
That made `area settings (default)` read 3.3x against the 2.0x
element-growth limit.

The growth itself is on main already. Measured on fresh pages with the
gate's harness, default appearance:

| | 40 turns | 200 turns | growth |
|---|---|---|---|
| main | 1,975 elements, 290 ms CPU | 9,721 elements, 816 ms CPU | 4.9x
|
| this PR | 1,663 elements, 217 ms CPU | 7,760 elements, 461 ms CPU |
4.7x |

The gate only passed on main because the transitions inflated its 40
turn reading. `KNOWN_DEFAULT` in `tests/studio/_area_matrix.py` now
records it as `length:settings=5`, so Settings keeps a ceiling instead
of being skipped. This changes only the element and layout count check
for that one area; its CPU and paint growth checks are unchanged.
Finding what restyles the thread when Settings opens is a separate fix.

## Not covered

The Firefox long-chat gate failure that also started with #17377 is a
different cost: forcing every transition to 0s does not change the
Firefox numbers, so this PR does not address it.
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.

1 participant