feat(chat): pause auto-scroll when user scrolls up, add acp.chat.autoScroll setting#54
Open
body-cmd wants to merge 1 commit into
Open
feat(chat): pause auto-scroll when user scrolls up, add acp.chat.autoScroll setting#54body-cmd wants to merge 1 commit into
body-cmd wants to merge 1 commit into
Conversation
…Scroll setting Implements the standard chat-UI auto-scroll pattern used by Claude Code, VS Code Copilot Chat, and other chat interfaces: - Auto-scroll follows new streaming content by default. - When the user manually scrolls up (>80px from bottom), auto-scroll pauses. - Scrolling back to the bottom or sending a new message resumes auto-scroll. - Add acp.chat.autoScroll setting (default: true) to disable auto-scroll entirely. Fixes the issue where ACP Client chat forcefully scrolls to the bottom on every streaming update, making it impossible to read earlier content while a response is being generated.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the ACP Client chat webview UX by implementing a standard “pause auto-scroll when the user scrolls up” behavior during streaming responses, and introduces a new acp.chat.autoScroll setting to disable auto-scroll entirely.
Changes:
- Add
acp.chat.autoScrollcontributed setting (defaulttrue) and send its value to the chat webview via thestatemessage. - Update the chat webview’s inline JS to pause
scrollToBottom()when the user scrolls up (using an ~80px-from-bottom threshold) and to resume when returning to bottom or sending a new message.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ui/ChatWebviewProvider.ts | Reads acp.chat.autoScroll, forwards it to the webview, and adds scroll-intent tracking to pause/resume auto-scroll. |
| package.json | Contributes the new acp.chat.autoScroll configuration setting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1265
to
+1276
| function saveState() { | ||
| vscode.setState({ chatHistory, sessionState, hasActiveSession }); | ||
| } | ||
|
|
||
| function restoreState() { | ||
| const saved = vscode.getState(); | ||
| if (!saved) return; | ||
|
|
||
| chatHistory = saved.chatHistory || []; | ||
| sessionState = saved.sessionState || null; | ||
| hasActiveSession = saved.hasActiveSession || false; | ||
|
|
Comment on lines
+1982
to
+1984
| messagesEl.addEventListener('scroll', function () { | ||
| const atBottom = messagesEl.scrollHeight - messagesEl.scrollTop - messagesEl.clientHeight < 80; | ||
| if (!atBottom) { |
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.
Problem
The ACP Client chat panel forcefully auto-scrolls to the bottom on every
streaming update (agent_message_chunk, tool_call, tool_call_update,
agent_thought_chunk), making it impossible to scroll up and read earlier
content while a response is being generated. This is a well-known UX issue
also reported against Claude Code (#11092, #31496, #58767), VS Code Copilot
Chat (#312626), and others.
Solution
Implements the standard chat-UI auto-scroll pattern:
pauses. The scroll listener tracks user intent — as long as the viewport
is more than 80px from the bottom, scrollToBottom() is a no-op.
auto-scroll.
disable auto-scroll entirely.
Implementation
The scroll tracking is done in the webview inline JavaScript:
event, using the 80px threshold standard from Claude Code and Copilot Chat
state message, using vscode.workspace.getConfiguration()
Testing