Skip to content

fix(vscode): preserve streaming scroll intent - #13500

Merged
marius-kilocode merged 1 commit into
mainfrom
fix-streaming-scroll-race
Aug 27, 2026
Merged

fix(vscode): preserve streaming scroll intent#13500
marius-kilocode merged 1 commit into
mainfrom
fix-streaming-scroll-race

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Chat could snap back to the bottom while a response was streaming after an upward wheel or keyboard gesture. The failure was intermittent when the gesture landed on message controls, was only one pixel, or raced a pending bottom scroll and status transition.

Why This Change Was Made

The auto-scroll state now records the latest viewport position, preserves newer upward intent across pending scroll events, does not force-follow when work resumes if the user is paused, and treats upward keyboard input as a pause. Regression coverage exercises the real MessageList story with native wheel and keyboard input.

User Impact

Users can read earlier output while streaming without the transcript pulling them back to the bottom. Explicitly returning to the bottom still resumes auto-follow.

Evidence

  • Controlled visible VS Code Agent Manager reversal runs: 5/5 failures before the fix, 0/5 after; snap-back reduced from 282 px to 0 px.
  • Prior sidebar and Agent Manager edge cases: 24/24 failures before, 0/24 after.
  • 38 scroll-hook tests and 10 browser regression tests pass.
  • Extension build, lint, typecheck, Knip, and annotation checks pass.
  • Live local SSE streaming flow verified send, streaming, pause, resume, and stop behavior.

@kilo-code-bot

kilo-code-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • .changeset/fix-streaming-scroll-intent.md
  • packages/kilo-ui/src/hooks/create-auto-scroll.test.tsx
  • packages/kilo-ui/src/hooks/create-auto-scroll.tsx
  • packages/kilo-ui/src/hooks/scroll-user-activity.ts
  • packages/kilo-vscode/tests/chat-auto-scroll.spec.ts
  • packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx

Reviewed by grok-4.6 · Input: 250K · Output: 19.1K · Cached: 423.7K

Review guidance: REVIEW.md from base branch main

@WebReflection WebReflection left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I had similar issues and I've fixed it in a simpler way here and here.

I am writing this for historical sake, no action needed, it's just a possible future reference in case we'd like to refactor current streaming logic and simplify a bit the scrolling common issue all streaming content has.

@marius-kilocode
marius-kilocode merged commit 7b8895a into main Aug 27, 2026
33 checks passed
@marius-kilocode
marius-kilocode deleted the fix-streaming-scroll-race branch August 27, 2026 08:55
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.

2 participants