Repository navigation
Agent chat: a trackpad scrolls up through older history without stalling - #27311
Conversation
…lling listener Leo (2026-10-29): "scrolling up when it paginates and loads... didnt we previously have it pretty fast? why is it sometimes blocking me from scrolling up further?" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-0a7dc7e74a6aa0e0d03c
…r the page Since #26114 the wheel glide kept a wheel listener that may cancel on the transcript, and WebKit sends every wheel event to the page before it scrolls while one is there: a trackpad's scroll up waited for whatever the page was doing, most of all an older page of history folding and rendering, and stopped. A passive listener now watches the wheel; the cancelling one stays only until the first precise event and comes back with the next notch (which scrolls natively). Older pages are asked for six viewports from the first row instead of two, so a page lands before a flick reaches the top. Leo (2026-10-29): "scrolling up when it paginates and loads... didnt we previously have it pretty fast? why is it sometimes blocking me from scrolling up further?" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-0a7dc7e74a6aa0e0d03c
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
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)
Unclear: CI failed on
Failures:
Matched log linesNot re-run automatically: Written by red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 4bc7428 to compare; do not merge until green; see lane-rules Gallery before/after for
States
Pick other states with a |
|
Owned by an agent session · session |
|
Found 19 test failures on Blacksmith runners: Failures
...and 9 more test failures. View all on Blacksmith: run 40839439946, run 40839439954
|
|
Bead |
|
Review (codex gpt-6-astra high fast via review-router, read-only): SHIP at ac90c11 I’ll inspect the full diff and the focused context files, then trace the wheel listener state machine and older-history request flow before deciding whether any correctness issue warrants BLOCK. DIFF
+const root = document.getElementById("root")!;
+function Transcript() {
+
+await requireBrowserLane("transcript-older-scroll.test.ts", async () => {
hook: PreToolUse
+// A wheel listener that may cancel makes WebKit hold every wheel event for the page before it
FILES hook: PreToolUse EXCERPT hook: PreToolUse PASS MOTION AGENT TEST hook: PreToolUse TEST FULL REOPEN hook: PreToolUse APP WHEEL INSTALL CONTEXT hook: PreToolUse hook: PreToolUse hook: PreToolUse hook: PreToolUse hook: PreToolUse codex
|
|
Red checks at ac90c11, classified before landing:
|
|
The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40851476637 at c89a975 failed: cmux-next checks (god files, concurrency, crash safety, l10n). |
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
Leo (2026-10-29): "scrolling up when it paginates and loads... didnt we previously have it pretty fast? why is it sometimes blocking me from scrolling up further?"
Two causes:
installWheelGlidehas kept a non-passive wheel listener on the transcript. While one is there, WebKit hands each wheel event to the page before it scrolls, so a trackpad's scroll waited on whatever the main thread was doing. The worst case is an older page of history folding and rendering as it lands, which matches "sometimes blocking me from scrolling up" and "previously pretty fast". A passive listener now watches the wheel. The cancelling listener stays installed only until the first precise (trackpad, Mos) event, and is added back on the next notch. A fresh pane's first notch still glides as before. The first notch after trackpad use scrolls natively, and the ones after it glide. No new timer or observer: the watcher is removed with the glide's other listener inremove()(unmount).OLDER_AHEAD_VIEWPORTS). Loaded rows stay virtualized, so the only cost is landing pages earlier. That cost is per page, not per token.I first suspected the scroll-anchor base from #25113 and tried anchoring from the live offset and correcting with
scrollBy. The new harness showed no difference between base and head for that change, so it isn't in this PR.Performance
Same harness at base and head:
webviews/test/transcript-older-scroll.test.ts(headless WebKit, 900×700, 3000-row synthetic chat opened on its last 120 rows, 30-row pages that land 400 ms after each ask, real wheel input one step a frame).wheel-glide-motion.test.tsTesting
Red on base, green on head (the commit before the fix holds only the tests):
wheel-glide-motion.test.ts› "precise input scrolls with no cancelling wheel listener; the next notch arms the glide again": base fails (Expected: 0, Received: 1), head passes.transcript-older-scroll.test.ts(new browser test, WebKit): base fails on both speeds (first ask at 1382 / 1347 px, expected ≥ 2800), head passes.Head also ran, all green: agent-pane-wheel-glide, transcript-parked-stream, transcript-fling, transcript-cached-rows-browser, transcript-older-history-at-top / once / retry, reopened-chat-history, transcript-scroll-restore, jump-scroll-animation, agent-pane-older-rows-fade, transcript-fold-anchor-browser, agent-pane-stream-jitter, agent-pane-scrollbar-shown (run). Command, from
webviews/:cmux-ci test --setup playwright -- bun test test/<file>.Observed / Not run
scripts/web-lint.shpasses.Changelog
Fixed: Scrolling up the agent chat with a trackpad no longer stalls while older messages load
Proof
No visual change: the before/after is the scroll behavior, and the numbers above. Nothing to screenshot.
Agent session: agent session
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes trackpad scrolling up the agent chat stalling while older history pages load.
Two causes were addressed:
Written for commit ac90c11. Summary will update on new commits.