Skip to content

feat(webchat): add streaming autoscroll toggle#81291

Closed
hclsys wants to merge 1 commit into
openclaw:mainfrom
hclsys:feat/webchat-streaming-autoscroll-toggle-81287
Closed

feat(webchat): add streaming autoscroll toggle#81291
hclsys wants to merge 1 commit into
openclaw:mainfrom
hclsys:feat/webchat-streaming-autoscroll-toggle-81287

Conversation

@hclsys

@hclsys hclsys commented May 13, 2026

Copy link
Copy Markdown

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

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 feat(webchat): add streaming autoscroll toggle #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.

@openclaw-barnacle openclaw-barnacle Bot added size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 13, 2026
@clawsweeper

clawsweeper Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
The PR adds a persisted SwiftUI OpenClawChatView toggle around streaming assistant autoscroll and a focused Swift policy test.

Reproducibility: not applicable. as a feature request rather than a bug. Source inspection shows current Control UI still uses the hardcoded 450px near-bottom scroll policy and has no persisted chatAutoScroll setting.

Real behavior proof
Needs stronger real behavior proof before merge: The supplied terminal proof only shows whitespace checking and missing Swift/Xcode, not the runtime UI behavior; the contributor should add a screenshot, recording, terminal/live output, linked artifact, or redacted logs and update the PR body for re-review.

Next step before merge
Needs maintainer/contributor follow-up because the branch targets the wrong UI surface and lacks after-fix real behavior proof for a new UX setting.

Security
Cleared: The diff is limited to SwiftUI state/control code and a Swift policy test, with no dependency, workflow, package, secret, or supply-chain surface changes.

Review findings

  • [P2] Target the Control UI scroll path — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift:181-185
Review details

Best possible solution:

If maintainers accept the UX, implement the autoscroll mode in the Control UI settings contract, chat controls, and scheduleChatScroll path with focused browser/UI tests; keep native Swift chat preferences separate unless explicitly approved.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a feature request rather than a bug. Source inspection shows current Control UI still uses the hardcoded 450px near-bottom scroll policy and has no persisted chatAutoScroll setting.

Is this the best way to solve the issue?

No. The requested fix belongs in Control UI UiSettings, chat controls, and scheduleChatScroll; this PR changes native SwiftUI chat only.

Full review comments:

  • [P2] Target the Control UI scroll path — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift:181-185
    The linked request is for browser Control UI/WebChat behavior, where current main still hardcodes the 450px near-bottom policy and persists adjacent settings through UiSettings. This guard only changes OpenClawChatView.streamingAssistantText, so the requested WebChat setting and scroll policy remain unchanged; move the toggle into the Control UI storage, controls, scroll helper, and tests, or retarget the PR to native Swift chat.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.86

What I checked:

  • PR diff surface: The proposed branch changes apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift and adds a Swift test, with no changes to the browser Control UI scroll helper, settings schema, or chat controls requested by the linked issue. (apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift:181, 479bab8cbf37)
  • Current Control UI scroll policy: Current main still hardcodes NEAR_BOTTOM_THRESHOLD = 450 and computes shouldStick from force, chatUserNearBottom, or the 450px distance check in scheduleChatScroll. (ui/src/ui/app-scroll.ts:63, 2e7036e85cc0)
  • Current Control UI settings contract: UiSettings persists adjacent chat settings such as chatFocusMode, chatShowThinking, and chatShowToolCalls, but has no chatAutoScroll or equivalent autoscroll mode. (ui/src/ui/storage.ts:53, 2e7036e85cc0)
  • Current Control UI chat controls: The chat controls render refresh, thinking, tool-call, focus, and cron-filter buttons; there is no autoscroll mode control in this browser UI surface. (ui/src/ui/app-render.helpers.ts:337, 2e7036e85cc0)
  • Linked feature context: The linked open feature request asks for a Control UI/WebChat chatAutoScroll setting with an off mode exposed beside existing chat settings, not a native Swift-only preference.
  • Real behavior proof check: The PR body's proof shows git diff --check and absence of Swift/Xcode in the contributor workspace; it does not show the WebChat toggle running or changing streaming scroll behavior after the patch. (479bab8cbf37)

Likely related people:

  • nickmopen: Authored the recent Control UI streaming scroll guard change around chatUserNearBottom, which is directly adjacent to the requested autoscroll policy. (role: recent scroll behavior contributor; confidence: high; commits: b90f28e89506; files: ui/src/ui/app-scroll.ts, ui/src/ui/app-scroll.test.ts)
  • BunsDev: Recent commits touched responsive chat controls and Control UI persistence surfaces that would likely host a browser WebChat autoscroll setting. (role: recent Control UI chat/settings contributor; confidence: medium; commits: 098b72910dea, c65aa1d2a6e5; files: ui/src/ui/app-render.helpers.ts, ui/src/ui/storage.ts)
  • steipete: Recent history on the touched native Swift chat and macOS WebChat embedding paths points to this owner if maintainers decide to retarget the PR as a native Swift chat preference. (role: native Swift chat adjacent owner; confidence: medium; commits: b294f7c46763, d15b6af77b49; files: apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatView.swift, apps/macos/Sources/OpenClaw/WebChatSwiftUI.swift)

Remaining risk / open question:

  • The repository has both browser Control UI chat and native Swift chat surfaces, so maintainers may decide to retarget this PR instead of discarding the idea.
  • No live WebChat proof was supplied; the existing proof does not exercise either the requested browser UI or the patched SwiftUI behavior.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 2e7036e85cc0.

@hclsys

This comment was marked as low quality.

@BunsDev

BunsDev commented May 14, 2026

Copy link
Copy Markdown
Member

Thanks for taking a pass at this and for closing the PR once review showed the branch was aimed at the native Swift chat surface rather than the browser Control UI/WebChat path.

The browser Control UI/WebChat implementation has now landed on main via #81629, commit 256377c. Keeping this PR closed is still the right state, but I appreciate the attempt and the cleanup after review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proof: supplied External PR includes structured after-fix real behavior proof. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: WebChat — add a "disable autoscroll during streaming" toggle (current 450px threshold is implicit and unconfigurable)

2 participants