fix(vscode): keep session scroll pinned during layout corrections - #13273
Merged
Conversation
marius-kilocode
enabled auto-merge
August 20, 2026 11:40
johnnyeric
approved these changes
Aug 20, 2026
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.
Summary
Session auto-follow can stop during streaming when virtualized layout corrections move
scrollTopwithout changingscrollHeight. The transcript then remains above the live output even though the user did not scroll.This change keeps unmarked layout corrections in follow mode while preserving deliberate user scrolling across the transcript, PromptRail, keyboard, touch, pointer, and nested scroll containers.
Regression History
PR #13009, initial scroll stabilization
PR #13009,
fix(ui): prevent snap-to-bottom and flickering during upward session scroll, merged on August 7, addressed the earlier snap-to-bottom and flicker behavior. Its implementation changedcreateAutoScrollandcreateUserActivityand introduced the input-aware distinction between user scrolling and layout-driven movement.The relevant commits were:
c514c08749, initial scroll stabilization.f1e5ed30e4, replaced the stop debounce with synchronous scroll-state handling.That work correctly stopped content resizing from fighting an active upward scroll, but it left a difficult distinction: native scrollbar movement can produce a
scrollevent without an easily observable input event.PR #13160, streaming follow-up
PR #13160,
fix(ui): preserve streaming chat scroll position, merged on August 17, addressed streaming output, virtualizer measurement, browser anchoring, downward wheel input, native scrollbar movement, and long touch gestures.The relevant commits were:
cba6ebc6fa, added the streaming scroll-position handling.2acdb46eee, added the native scroll pause behavior.PR #13160 added a stable-height movement heuristic to cover the native-scrollbar case. The heuristic compared the previous and current
scrollTopandscrollHeightvalues and treated a position change with stable content height as intentional user movement.Current Regression
The stable-height condition is not sufficient to identify user input. Virtua and browser layout code can correct
scrollTopduring virtualized row measurement, scroll anchoring, or layout reflow whilescrollHeightremains unchanged.The failure sequence is:
scrollTopupward.scrollevent before the resize observer restores bottom-follow.The visible result is intermittent: the session scrolls correctly in most cases, then stops following after a layout correction. The problem is more likely with long transcripts, virtualized rows, tool output, tables, charts, throughput updates, and other content that changes height while streaming.
There was also a separate integration path in which PromptRail directly changed the transcript
scrollTopfrom a sibling element. Removing the heuristic would otherwise lose that user-intent signal, so this change handles PromptRail explicitly.Fix
scrollTopmovement as an implicit user-intent signal.The key rule is now: layout movement alone does not pause auto-follow; observable user input does.
Behavior
ArrowUp,ArrowDown,PageUp,PageDown,Home,End, and Space, including nested scroll containers.Reproduction
A deterministic reproduction is:
scrollTopwithout changingscrollHeight.PromptRail reproduction:
Scope
The existing
@kilocode/kilo-uipatch changeset is updated for this follow-up. Regression coverage lives at the hook level and in the VS Code webview Storybook/Chromium path.