openclaw - ✅(Solved) Fix [Feature]: WebChat — add a "disable autoscroll during streaming" toggle (current 450px threshold is implicit and unconfigurable) [1 pull requests, 3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#81287Fetched 2026-05-14 03:33:38
View on GitHub
Comments
3
Participants
4
Timeline
16
Reactions
3
Author
Timeline (top)
cross-referenced ×4commented ×3mentioned ×3subscribed ×3

Add a user-configurable autoscroll mode to WebChat (Control UI) so long assistant replies don't yank the viewport down while the user is mid-read. Today the behavior is hardcoded: if the user is within ~450px of the bottom, the chat auto-scrolls on every streaming chunk; otherwise it shows a "↓ new messages" badge. There is no way to disable autoscroll always, and the 450px threshold is invisible to users.

Root Cause

Concretely:

  • The 450px threshold is implicit; users don't know they have to scroll up to "pause" autoscroll.
  • Even if they do scroll up, attention is broken every time a long chunk arrives because the autoscroll briefly fights the user.
  • There is no "I always want to read at my own pace" mode for users who prefer to pull the scroll down manually when ready.

Fix Action

Fixed

PR fix notes

PR #81291: feat(webchat): add streaming autoscroll toggle

Description (problem / solution / changelog)

Summary

  • add a persisted WebChat toggle for streaming autoscroll
  • gate only streaming-chunk autoscroll; initial load, user-send scroll, and pinned new-message behavior stay unchanged
  • add a focused policy test for the autoscroll decision

Fixes #81287

Pre-implementation audit

  • Existing-helper check: searched autoscroll/scroll helpers; reused existing ChatView scroll state instead of adding a parallel controller.
  • Shared-helper caller check: OpenClawChatView public initializer unchanged; macOS/iOS call sites keep default behavior.
  • Broader-fix rival scan: no open PR found for #81287/autoscroll toggle.

Real behavior proof

  • Behavior or issue addressed: WebChat now exposes a persisted control to disable automatic scrolling while assistant text is streaming, so long replies stop pulling the reader back to the bottom on every chunk.
  • Real environment tested: Ubuntu 24.04 Codex workspace, local checkout on feat/webchat-streaming-autoscroll-toggle-81287, GitHub PR #81291.
  • Exact steps or command run after this patch:
    1. git diff --check
    2. which swift || true; which xcodebuild || true
  • After-fix evidence: terminal output from the patched checkout:
$ git diff --check
<no output>

$ which swift || true; which xcodebuild || true
<no output>
  • Observed result after fix: git diff --check returned exit 0 with no whitespace/errors; the environment check returned no Swift/Xcode toolchain, so local macOS WebChat execution was not available in this workspace.
  • What was not tested: Live macOS/iOS WebChat UI and swift test were not run locally because swift and xcodebuild are unavailable here; PR CI is the compile/runtime gate for macos-swift.

Changed files

  • apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift (modified, +84/-31)
  • apps/shared/OpenClawKit/Tests/OpenClawKitTests/ChatAutoScrollPolicyTests.swift (added, +24/-0)
RAW_BUFFERClick to expand / collapse

Summary

Add a user-configurable autoscroll mode to WebChat (Control UI) so long assistant replies don't yank the viewport down while the user is mid-read. Today the behavior is hardcoded: if the user is within ~450px of the bottom, the chat auto-scrolls on every streaming chunk; otherwise it shows a "↓ new messages" badge. There is no way to disable autoscroll always, and the 450px threshold is invisible to users.

Problem to solve

For long streaming replies (500+ words), the viewport keeps being dragged to the bottom each time a new chunk arrives. The user cannot finish reading the earlier portion without scrolling up — which then disables autoscroll temporarily, but feels reactive rather than intentional.

Concretely:

  • The 450px threshold is implicit; users don't know they have to scroll up to "pause" autoscroll.
  • Even if they do scroll up, attention is broken every time a long chunk arrives because the autoscroll briefly fights the user.
  • There is no "I always want to read at my own pace" mode for users who prefer to pull the scroll down manually when ready.

This came up during real use: a long technical answer kept dragging the viewport mid-paragraph, making it impossible to scan back to the start of the answer.

Proposed solution

Add a chat setting (key: chatAutoScroll) with three modes:

  • "always" — always pin to bottom on new chunks (legacy aggressive)
  • "near-bottom" — current behavior (autoscroll only if user is within ~450px); this is the default
  • "off" — never autoscroll automatically; user clicks the "↓ new messages" badge / scroll-to-bottom button when ready

Implementation appears to live in the ei(scrollHelper) function in dist/control-ui/assets/index-NYVkUQrq.js (the function that branches on chatUserNearBottom and the Xr = 450 threshold). Adding a settings.chatAutoScroll short-circuit at the top of that function would close this case with minimal surface area.

UX surface: expose the setting in the existing chat settings menu next to chatShowThinking and chatShowToolCalls. Default = "near-bottom" preserves current behavior; users who want the new behavior opt in.

Alternatives considered

  1. Scroll up manually to disable autoscroll for the current message — works, but breaks attention and is rediscovered each turn. Not a substitute for an explicit setting.
  2. Disable streaming and only render the final reply — defeats the purpose of streaming and removes the "I can see it's thinking" signal.
  3. Increase the 450px threshold — doesn't solve the issue for users who want "off entirely".

Impact

Affected: any WebChat user reading long replies (technical answers, code-heavy explanations, multi-section summaries). Severity: Low-medium (cosmetic / UX friction, not data loss). Frequency: every long reply. Consequence: degraded reading experience, especially on smaller laptop screens where 450px is a large fraction of viewport height.

Asymmetry note: ChatGPT, Claude.ai, and most modern chat UIs all default to "near-bottom autoscroll" with a manual scroll-to-bottom button. None expose a hard off toggle — this would actually be a small UX edge over peers.

Evidence/examples

Existing related Control UI settings keys for reference (from index-NYVkUQrq.js):

  • chatFocusMode
  • chatShowThinking
  • chatShowToolCalls

The natural place for the new key is alongside these. Persisting via the existing applySettings(...) path keeps the change minimal.

Companion: paired with the user-uploaded image persistence bug filed separately, this is part of a small "WebChat reading experience" cluster of polish work.

Additional information

Backward compatibility: default the new setting to "near-bottom" so existing users see no change. Only opt-in users get the new "off" mode (or the more aggressive "always" mode, if that's also desired).

Migration: none required; new key with sensible default.

Accessibility: respect prefers-reduced-motion. The current code already checks window.matchMedia('(prefers-reduced-motion: reduce)') for smooth vs instant — that path should be preserved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Feature]: WebChat — add a "disable autoscroll during streaming" toggle (current 450px threshold is implicit and unconfigurable) [1 pull requests, 3 comments, 4 participants]