Repository navigation
Agent chat: a streaming reply follows Reduce Motion when it turns on mid-reply - #27775
Conversation
Red first: a row that mounted with Reduce Motion off keeps pacing its reveal after the preference turns on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-d0113a9b59e8132f3f6d
useStreamReveal read prefers-reduced-motion once at mount and StreamReveal latched it in a readonly field, so a reply kept pacing and fading after Reduce Motion turned on. Each row now listens for the media query's change (removed on unmount); turning it on cancels the pending reveal frame, shows the whole reply and retires the fading steps, and later text shows as it arrives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-d0113a9b59e8132f3f6d
|
Found 8 test failures on Blacksmith runners: Failures
|
…into lane/hq5058-live-reduced-motion
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Gallery before/after for
States
Pick other states with a red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base 320d9a3; does not block Shipped in:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-d0113a9b59e8132f3f6d
…the reply Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-d0113a9b59e8132f3f6d
There was a problem hiding this comment.
2 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="webviews/src/agent-session/acpmux/conversation/RevealedMarkdown.test.tsx">
<violation number="1" location="webviews/src/agent-session/acpmux/conversation/RevealedMarkdown.test.tsx:321">
P2: This regression test does not verify that turning Reduce Motion off resumes pacing or that the later delta eventually appears. Assert the first post-toggle frame is shorter than the new text, then assert a later frame reaches the complete reply.</violation>
</file>
<file name="webviews/src/agent-session/acpmux/streamReveal.ts">
<violation number="1" location="webviews/src/agent-session/acpmux/streamReveal.ts:70">
P2: Toggling Reduce Motion off before the pending frame runs can make the reveal re-process already-visible text. The handler exposes the latest target after `setReduceMotion(true)` flushes only the stale `received` length, but disabling motion never rebases the internal cursor. Synchronize `StreamReveal` with the target text when enabling reduced motion and reset its pacing state when disabling it.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| motion.set(true); | ||
| expect(container.querySelector(".cv-md")?.textContent).toBe(shown); | ||
| motion.set(false); | ||
| render(`${shown} The release went out.`, true); |
There was a problem hiding this comment.
P2: This regression test does not verify that turning Reduce Motion off resumes pacing or that the later delta eventually appears. Assert the first post-toggle frame is shorter than the new text, then assert a later frame reaches the complete reply.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At webviews/src/agent-session/acpmux/conversation/RevealedMarkdown.test.tsx, line 321:
<comment>This regression test does not verify that turning Reduce Motion off resumes pacing or that the later delta eventually appears. Assert the first post-toggle frame is shorter than the new text, then assert a later frame reaches the complete reply.</comment>
<file context>
@@ -226,6 +226,102 @@ test("the last word shows once text stops arriving, while the reply still stream
+ motion.set(true);
+ expect(container.querySelector(".cv-md")?.textContent).toBe(shown);
+ motion.set(false);
+ render(`${shown} The release went out.`, true);
+ for (let index = 0; index < 20; index++) expect(frame(32 + index * 16).length).toBeGreaterThanOrEqual(shown.length);
+});
</file context>
Text can render and have its frame cancelled before StreamReveal reads it; turning Reduce Motion on showed it while the reveal kept its older length, so turning it off again re-revealed from there and the reply shrank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-d0113a9b59e8132f3f6d
|
Review (the owner lane's independent review, at its land request): SHIP at f20e8fe Recorded by lane-gh-broker from this PR's owner lane, which asked to land this exact head after its independent review. next-autoland lands it once every red is the base's; a BLOCK at this head, a HOLD line or a hold label still stops it. |
|
Ready to land at
The newest base guard run, 41264191296 at |
|
Review (codex gpt-6.1-sol xhigh, next-review): SHIP at 64fa07b SHIP at 64fa07b Visual verdict: no images; Leo tries the build No correctness findings. Syntax and direct
Follow-ups:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Fixes an internal report: a streaming reply that mounted with Reduce Motion off kept pacing its reveal and fading its newest words after Reduce Motion turned on, until the row remounted. The stylesheet had already switched.
Cause
useStreamRevealreadprefers-reduced-motiononce, into a ref, when the row mounted.StreamRevealcopied that value into areadonlyfield in its constructor. Nothing listened forchange, so fixing only the ref would still have leftadvance()pacing.Change
StreamReveal.setReduceMotion(on): the field is no longerreadonly. Turning it on shows everything received.useStreamRevealadds onematchMediachangelistener per mounted row, and removes it on unmount. When Reduce Motion turns on, it cancels the row's pending reveal frame, shows the whole reply in that commit and clears the fading steps (.cv-fresh). Later text then shows whole as it arrives, the same as in a row that mounted with Reduce Motion on. Turning it off paces later text again.Test
RevealedMarkdown.test.tsx, "turning Reduce Motion on mid-reply shows the whole reply and stops the reveal". It mounts a row with Reduce Motion off and paces three frames of a long reply. Then it switches the stubbedmatchMediatoreduceand checks:.cv-freshspan is left;Red/green with
bun test src/agent-session/acpmux/conversation/RevealedMarkdown.test.tsxthroughcmux-ci test:red at the test-only commit
3eab9f1: the new test fails when Reduce Motion turns on, with the reply cut off mid-text (run 40982179853); the other 9 pass.green at the fix, merged with base,
e5ea1e9: 10/10 pass, along withtest/streaming-text-frames.test.ts(run 41253723297). That run's one red,chromium: a followed reply rises line by line without jumps(-32.5 against a -25.75 floor), is a flake that also happens on base code. On the same runner it passed 3/3 at this head and failed 1/3 with base'sRevealedMarkdown.tsxandstreamReveal.ts, with the same -32.5.A first Astra review at
7f5680bblocked with a P2: text that rendered but whose frame was cancelled before the reveal read it leftStreamRevealbehind what showed, so turning Reduce Motion off again could shrink the reply.bd4b2b8adds a red test for it ("Reduce Motion on then off before a frame keeps what shows when later text arrives": the shown length dropped from 1974 to 154, run 41260981611).f20e8fefixes it:setReduceMotion(true, text)takes in the latest text before it flushes.green at
f20e8fe: 11/11 pass (run 41266926949).Review: Astra (gpt-6-astra, high) gave
VERDICT: SHIP f20e8fe574b404c95bc0e32a4a2edde0b21e046b, with no P1, P2 or P3 findings.Reds at this head:
nightly-guards / release-notary("Test What's New highlights and release notes") and itsGuard status. The same steps fail on base's latest guard run 41262022316 ata2a65690, and this PR changes only the three webview files above.UI: no visual change with Reduce Motion off. With it on, the reply shows whole at once, as a row that mounted under Reduce Motion already does.
Agent session: agent session
🤖 Generated with Claude Code