Skip to content

feat(ui): add WebChat auto-scroll mode selector#81629

Merged
BunsDev merged 1 commit into
mainfrom
meow/webchat-autoscroll-toggle-81287
May 14, 2026
Merged

feat(ui): add WebChat auto-scroll mode selector#81629
BunsDev merged 1 commit into
mainfrom
meow/webchat-autoscroll-toggle-81287

Conversation

@BunsDev

@BunsDev BunsDev commented May 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a persisted Control UI/WebChat chatAutoScroll setting with near-bottom as the default and new always / off modes.
  • Wires the mode into chat scroll scheduling while preserving manual scrollToBottom and New messages behavior.
  • Exposes the selector in desktop and mobile chat controls, syncs i18n fallbacks, and documents the fix in the changelog.

Fixes #7648
Fixes #81287
Refs #72957
Refs #81291

Triage

Security / bug review

  • No new network calls, dependencies, workflow changes, permissions, credentials, or secret handling.
  • The persisted value is normalized through a closed string enum before load/save/use, so malformed stored values fall back to near-bottom.
  • off mode blocks automatic streaming scroll only; manual scroll-to-bottom is explicitly tagged as manual so users are not trapped away from the live tail.
  • The selector uses existing settings plumbing and i18n keys rather than adding a new storage or protocol surface.

Real behavior proof

Behavior addressed: WebChat now has a persisted auto-scroll mode selector; near-bottom preserves current behavior, always follows streaming output, and off suppresses automatic streaming scroll while keeping manual New messages / scroll-to-bottom available.

Real environment tested: local macOS Codex worktree on rebased commit 1b8859c8ba7e83b9158eb6e6b25dbe31290444fe; Vite dev server at http://localhost:5173/. The unauthenticated local gateway showed the auth gate, so selector proof used Vite-loaded Control UI render helpers in browser.

Exact steps or command run after this patch:

  • pnpm test ui/src/ui/app-settings.test.ts ui/src/ui/views/chat.test.ts ui/src/ui/app-render.helpers.node.test.ts ui/src/ui/app-render.helpers.browser.test.ts ui/src/ui/storage.node.test.ts ui/src/ui/app-scroll.test.ts -- --reporter=verbose
  • pnpm check:changed
  • pnpm ui:i18n:check
  • pnpm ui:build
  • Browser proof: rendered renderChatControls and renderChatMobileToggle via Vite imports; confirmed two auto-scroll selectors with Always, Near bottom, Off; changed the first selector to off and observed applySettings received chatAutoScroll: "off".

Evidence after fix: targeted UI/settings/scroll/chat tests passed (136 UI tests plus 32 unit-ui chat tests); check:changed passed; i18n check was clean; Vite production build passed; browser proof returned selectCount: 2, values near-bottom, labels Always/Near bottom/Off, and applied off.

Observed result after fix: auto-scroll policy is mode-gated in tests and the rendered selector updates persisted UI settings without console errors in the local browser proof.

What was not tested: live authenticated WebChat streaming against a real gateway, because the local gateway endpoint required credentials; full cross-browser/device matrix was not run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels May 14, 2026
@clawsweeper

clawsweeper Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR adds a persisted Control UI/WebChat chatAutoScroll setting, selector UI, scroll policy gating, i18n/generated metadata, tests, and a changelog entry.

Reproducibility: not applicable. as a feature PR rather than a broken-contract bug. Source inspection confirms current main has only the implicit near-bottom policy and no chatAutoScroll setting to reproduce as an existing behavior failure.

Real behavior proof
Sufficient (live_output): The PR body supplies after-fix real behavior proof via local Vite browser rendering plus terminal test/build/check output, though live authenticated gateway streaming was not covered.

Next step before merge
No ClawSweeper repair job is needed; this is an active member-authored feature PR with no discrete automated fix finding from review.

Security
Cleared: The diff touches local UI settings, rendering, styles, i18n, tests, and changelog only; I found no new dependency, workflow, network, credential, or code-execution surface.

Review details

Best possible solution:

Review and land the PR if CI and maintainer UX review agree with adding a persisted WebChat auto-scroll preference; keep the default near-bottom behavior for existing users.

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

Not applicable as a feature PR rather than a broken-contract bug. Source inspection confirms current main has only the implicit near-bottom policy and no chatAutoScroll setting to reproduce as an existing behavior failure.

Is this the best way to solve the issue?

Yes, the proposed direction is a coherent implementation path: a closed enum setting is normalized through storage, exposed in the existing chat controls, and used at the scroll scheduling boundary. The remaining decision is product/UX approval and normal validation, not a narrow repair.

What I checked:

  • Protected maintainer handling: The provided PR context shows author association MEMBER and labels app: web-ui, maintainer, and size: L; repository policy says protected-label or member-authored items stay open for explicit maintainer handling.
  • Current main has hard-coded near-bottom chat scrolling: scheduleChatScroll on current main computes shouldStick from effectiveForce, chatUserNearBottom, or the fixed NEAR_BOTTOM_THRESHOLD; there is no persisted mode in this code path. (ui/src/ui/app-scroll.ts:63, 78eb92e62277)
  • Current main settings lack chatAutoScroll: UiSettings, defaults, load normalization, and persisted settings on current main include chatShowThinking and chatShowToolCalls but not chatAutoScroll. (ui/src/ui/storage.ts:72, 78eb92e62277)
  • PR diff implements the requested feature surface: The PR diff adds CHAT_AUTO_SCROLL_MODES, normalizes/persists chatAutoScroll, renders a desktop/mobile selector, gates scheduleChatScroll by always, near-bottom, and off, and adds focused scroll/settings/render tests. (ui/src/ui/app-scroll.ts:70, 1b8859c8ba7e)
  • PR body includes after-fix proof: The PR body reports targeted UI/settings/scroll tests, pnpm check:changed, pnpm ui:i18n:check, pnpm ui:build, and a Vite browser render-helper proof showing two selectors and persistence of chatAutoScroll: "off". (1b8859c8ba7e)
  • Feature history sample: Local blame on the central current-main Web UI files points most central scroll/render/settings lines to 439e39626220bef889530c2a342b9f3049e67382; nearby settings history also includes 52370c59980b4c3dce7e1bde22a256d3dfd6b5a7 for browser-local UI settings. (ui/src/ui/app-scroll.ts:1, 439e39626220)

Likely related people:

  • Peter Steinberger: Local blame assigns the central current-main chat scroll helper, render helper, i18n strings, and most settings plumbing to commit 439e39626220bef889530c2a342b9f3049e67382; the checkout history is grafted, so this is a routing signal rather than full authorship proof. (role: current-main code provenance; confidence: medium; commits: 439e39626220; files: ui/src/ui/app-scroll.ts, ui/src/ui/app-render.helpers.ts, ui/src/ui/storage.ts)
  • Val Alexander: Recent local history shows feat(ui): add browser-local Control UI text size setting, and blame places that nearby settings default in ui/src/ui/storage.ts; this is adjacent to the new browser-local chat setting pattern. (role: recent adjacent settings contributor; confidence: low; commits: 52370c59980b; files: ui/src/ui/storage.ts)

Remaining risk / open question:

  • I did not run tests because this sweep is read-only; CI or maintainer validation should confirm the PR body's reported UI test/build results.
  • The PR body notes live authenticated WebChat streaming against a real gateway was not tested, so the final landing check should cover that if maintainers want end-to-end stream proof.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 78eb92e62277.

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

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR proof: sufficient ClawSweeper judged the real behavior proof convincing. size: L

Projects

None yet

1 participant