Repository navigation
fix(styles): reduced motion no longer gives every element a transition - #78
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
In the
prefers-reduced-motion: reduceblock ofsrc/styles.css,transition-duration: 0.01ms !importanton*, *::before, *::afteris now0s !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-propertydefaults toall. 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]) readstransition: all 1e-05swith the rule on andall 0swith it off.ChatViewsets that element'spadding-bottomfromcomposerDock.pad, and thepinOnlayout effect inuse-transcript-viewport.ts:329-337runsscrollTo(scrollHeight). A transition delays the computed padding to the next style update, so that effect read the oldscrollHeight. Recorded in order: at t=756 ms the inline style already saidcalc(96px + 0.75rem), the effect scrolled to the old 2063, and 25 ms laterscrollHeightbecame 2099 with nothing scrolling again.useBottomFollowResizewatches the content box, so a padding change does not reach it.0skeeps 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 withprefers-reduced-motion: reduce(macOS "Reduce motion" is on on this Mac too). The bot hassocratic-tutor, so the chip row appears after the thread is shown. Before wasmain32fb531 (samesrcas a512e6d); After was this branch. Measured with a same-origin iframe probe: gap =scrollHeight - scrollTop - clientHeightof the transcript scroller (the.glass-scrolleraround[role=log];[role=log]itself does not scroll), sampled every 100 ms after each step.Before shows the last line under the
/socratic-tutorchip. After shows it whole above the chip.Before (
main32fb531), thread just opened:After, thread just opened:
scrollTopunchanged, jump button stays: not pulled downtransitionof[role=log]all 1e-05sall 0stransition-durationof a sidebar bot row (has its own transition)1e-05s0s(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.
After, 390 px, turn hung, two messages queued (94 px card): the last line sits above the chip.
Also checked:
NODE_OPTIONS=--no-experimental-webstorage vitest runon the 22 test files that readstyles.css, plususe-transcript-viewport,bottom-followandtranscript-follow: 877 tests pass. Three files fail (color-utilities,faded-text,touch-actions), and they fail the same way onmain; they are inmain's CI failures already, and point at files this PR does not touch. The flag works around Node 26's ownlocalStorageon this Mac; CI andenginesuse Node 24.@media (prefers-reduced-motion: reduce)(styles.css:3016), so people without reduced motion get the same CSS as before. The in-appdata-reduced-motion="true"preview path does not use this rule.transitionendhas one listener in the app (LocalVmWorkspace.tsx:202).shared/app-frame/helper.ts:241also listens, but it runs in the bot page iframe, which does not loadstyles.css.Known limits
LocalVmWorkspace.tsx:198-205re-reads native-view overlays ontransitionstart/transitionend, besidesclass/stylemutations and resizes. With reduced motion on, an element that appears only through CSS:hoverused 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:167are candidates) was not checked. Inferred from the code, not run.transition-durationin the reduce block". A test likesrc/lib/chat-finish-styles.test.tscould hold it if wanted.ResizeObserverwatches the content box, so a future padding transition on.glass-scroller-contentwould bring this back for everyone. Not changed here.Not verified
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.