Skip to content

fix(styles): reduced motion no longer gives every element a transition - #78

Merged
zereight merged 1 commit into
mainfrom
fix/transcript-repin-on-dock-growth
Dec 1, 2026
Merged

zereight merged 1 commit into
mainfrom
fix/transcript-repin-on-dock-growth

Conversation

@zereight

@zereight zereight commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

What changed

In the prefers-reduced-motion: reduce block of src/styles.css, transition-duration: 0.01ms !important on *, *::before, *::after is now 0s !important. One value.

Why

With reduced motion on, opening a thread left the transcript 36 px short of its end: the last reply sat behind the skill chip row from #74. Growing the dock any other way (a five-line draft, a bigger queued card) did the same by the amount it grew. No "Jump to latest" button appeared, so the transcript was still meant to be following; this was not the designed "released" state. This is the item listed under "Found while verifying" in #77.

The cause is the reduced-motion rule from #52 (b52a42a):

  • transition-property defaults to all. Setting a non-zero duration on every element therefore gives every element, including ones that never had a transition, a 0.01 ms transition on every property. The transcript content ([role=log]) reads transition: all 1e-05s with the rule on and all 0s with it off.
  • When the dock grows, ChatView sets that element's padding-bottom from composerDock.pad, and the pinOn layout effect in use-transcript-viewport.ts:329-337 runs scrollTo(scrollHeight). A transition delays the computed padding to the next style update, so that effect read the old scrollHeight. Recorded in order: at t=756 ms the inline style already said calc(96px + 0.75rem), the effect scrolled to the old 2063, and 25 ms later scrollHeight became 2099 with nothing scrolling again. useBottomFollowResize watches the content box, so a padding change does not reach it.
  • Removing only that media rule through CSSOM, with nothing else changed, kept the gap at 0. That isolates the rule as the cause.

0s keeps what #52 asked for: transitions still finish at once. A zero duration does not create a transition, so a padding change lands in the same layout and the existing re-pin works.

How it was verified

Isolated fixture (FAKE_CLAUDE_MODE=hang scripts/control-omb.ts launch), Vite on top of it, the built-in browser with prefers-reduced-motion: reduce (macOS "Reduce motion" is on on this Mac too). The bot has socratic-tutor, so the chip row appears after the thread is shown. Before was main 32fb531 (same src as a512e6d); After was this branch. Measured with a same-origin iframe probe: gap = scrollHeight - scrollTop - clientHeight of the transcript scroller (the .glass-scroller around [role=log]; [role=log] itself does not scroll), sampled every 100 ms after each step.

Before shows the last line under the /socratic-tutor chip. After shows it whole above the chip.

Before (main 32fb531), thread just opened:

before

After, thread just opened:

after

case Before After
open thread with chips, 1280×800, 3 runs 36 / 36 / 36 px short, no jump button 0 / 0 / 0
open thread with chips, 390×800, 3 runs 36 / 36 / 36 0 / 0 / 0
hung turn, queue a message with ⌘↩ (card 0 → 53 px) or a second one (53 → 94 px), 390×800 41 px short at 3 of 9 queue steps, no jump button 0 at all 10 queue steps
type a five-line draft, 1280×800 (dock 96 → 176 px) 80 px short 0
type a five-line draft, 390×800, turn hung, card queued 72 px short 0
scrolled up 600 px, then a five-line draft (After only) — scrollTop unchanged, jump button stays: not pulled down
computed transition of [role=log] all 1e-05s all 0s
transition-duration of a sidebar bot row (has its own transition) 1e-05s 0s (still instant)

The queued-card gap does not appear at every step on main: across two hung turns it hit once after the first card and once after the second, then once in three delete-and-requeue rounds. The fix brought every step to 0.

Before, 390 px, turn hung, one message queued: the last line ("Fixture Starter hasn't heard back…") is under the chip.

before, queued

After, 390 px, turn hung, two messages queued (94 px card): the last line sits above the chip.

after, queued

Also checked:

  • NODE_OPTIONS=--no-experimental-webstorage vitest run on the 22 test files that read styles.css, plus use-transcript-viewport, bottom-follow and transcript-follow: 877 tests pass. Three files fail (color-utilities, faded-text, touch-actions), and they fail the same way on main; they are in main's CI failures already, and point at files this PR does not touch. The flag works around Node 26's own localStorage on this Mac; CI and engines use Node 24.
  • The changed line sits inside @media (prefers-reduced-motion: reduce) (styles.css:3016), so people without reduced motion get the same CSS as before. The in-app data-reduced-motion="true" preview path does not use this rule.
  • transitionend has one listener in the app (LocalVmWorkspace.tsx:202). shared/app-frame/helper.ts:241 also listens, but it runs in the bot page iframe, which does not load styles.css.

Known limits

  • LocalVmWorkspace.tsx:198-205 re-reads native-view overlays on transitionstart/transitionend, besides class/style mutations and resizes. With reduced motion on, an element that appears only through CSS :hover used to fire those events through its 0.01 ms transition and now fires none, so that read waits for the next mutation or resize. Without reduced motion, a hover-only element with no transition already behaved this way. Whether any such element sits over a native view (remote-desktop-panel.tsx:288, bot-panel/ComputerTab.tsx:167 are candidates) was not checked. Inferred from the code, not run.
  • No guard test was added for "no non-zero transition-duration in the reduce block". A test like src/lib/chat-finish-styles.test.ts could hold it if wanted.
  • The bottom follow's ResizeObserver watches the content box, so a future padding transition on .glass-scroller-content would bring this back for everyone. Not changed here.

Not verified

  • Reduced motion off, measured on screen. The rule does not apply then (see above), and removing it through CSSOM gave gap 0.
  • The Electron app, and the native phone apps.

Merge danger

Door: two-way. Revert the PR, or put the value back.

Blast radius: transition timing of every element, only for people with reduced motion on. Transitions that used to take 0.01 ms now take none. No state, route or data changes.

@zereight
zereight merged commit 5ac2194 into main Dec 1, 2026
1 of 2 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.

1 participant