Skip to content

fix(ui): preserve streaming chat scroll position - #13160

Merged
marius-kilocode merged 2 commits into
mainfrom
fix-kilo-session-indicator-scroll-bug
Aug 17, 2026
Merged

fix(ui): preserve streaming chat scroll position#13160
marius-kilocode merged 2 commits into
mainfrom
fix-kilo-session-indicator-scroll-bug

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Problem

Streaming transcript layout changes can emit scroll events before the resize observer restores bottom-follow. The chat previously treated those browser and virtualizer events as user intent, so chart rendering, Bash output, tables, throughput updates, and other growing content could leave the transcript stuck above the bottom. Downward wheel input at the bottom could trigger the same state, and the initial input-aware fix did not cover native scrollbar drags or long touch gestures after the interaction grace period.

Fix

Auto-follow now distinguishes user movement from layout remeasurement:

  • Scroll events caused by streaming reflow, virtualizer measurement, browser anchoring, or content growth no longer pause follow on their own.
  • Downward wheel and trackpad input at the bottom does not mark the transcript as intentionally paused.
  • Upward wheel input still pauses immediately.
  • Native scrollbar movement and scroll-position changes with stable content height are treated as intentional user scrolling.
  • Pointer, keyboard, and touch interaction protections remain in place, including long gestures that outlast the short activity grace period.

This keeps active streaming output pinned while preserving deliberate user scrolling.

Related Reports

Comment thread packages/kilo-ui/src/hooks/create-auto-scroll.tsx Outdated
@kilo-code-bot

kilo-code-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental review of 2acdb46; the previously reported warning (unmarked user-scroll channels no longer pausing auto-follow) is resolved by the stable-height position-change heuristic in handleScroll and covered by the new test.

Files Reviewed (2 files)
  • packages/kilo-ui/src/hooks/create-auto-scroll.tsx
  • packages/kilo-ui/src/hooks/create-auto-scroll.test.tsx
Previous Review Summary (commit cba6ebc)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit cba6ebc)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-ui/src/hooks/create-auto-scroll.tsx 114 Unmarked user-scroll channels (native scrollbar drag, touch fling past grace window) no longer pause auto-follow
Files Reviewed (4 files)
  • packages/kilo-ui/src/hooks/create-auto-scroll.tsx - 1 issue
  • packages/kilo-ui/src/hooks/scroll-user-activity.ts
  • packages/kilo-ui/src/hooks/create-auto-scroll.test.tsx
  • .changeset/fix-streaming-scroll-follow.md

Fix these issues in Kilo Cloud


Reviewed by kimi-k3 · Input: 37.2K · Output: 8K · Cached: 291.8K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 73f7a44 into main Aug 17, 2026
32 checks passed
@marius-kilocode
marius-kilocode deleted the fix-kilo-session-indicator-scroll-bug branch August 17, 2026 09:14
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