mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-10 23:09:50 +00:00
Fix auto-scroll for diff tool results
Replace incorrect scrollToBottom() calls with scrollToBottomIfNeeded() to restore auto-scrolling functionality when new Edit, MultiEdit, and Write tool results are displayed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -242,7 +242,7 @@ const getScript = (isTelemetryEnabled: boolean) => `<script>
|
||||
messageDiv.innerHTML = diffHTML;
|
||||
messagesDiv.appendChild(messageDiv);
|
||||
|
||||
if (shouldScroll) scrollToBottom(messagesDiv);
|
||||
scrollToBottomIfNeeded(messagesDiv, shouldScroll);
|
||||
return;
|
||||
} else if (data.toolName === 'MultiEdit' && data.rawInput.file_path && data.rawInput.edits) {
|
||||
const parsed = parseToolResult(data.content);
|
||||
@@ -267,7 +267,7 @@ const getScript = (isTelemetryEnabled: boolean) => `<script>
|
||||
messageDiv.innerHTML = html;
|
||||
messagesDiv.appendChild(messageDiv);
|
||||
|
||||
if (shouldScroll) scrollToBottom(messagesDiv);
|
||||
scrollToBottomIfNeeded(messagesDiv, shouldScroll);
|
||||
return;
|
||||
} else if (data.toolName === 'Write' && data.rawInput.file_path && data.rawInput.content) {
|
||||
const parsed = parseToolResult(data.content);
|
||||
@@ -291,7 +291,7 @@ const getScript = (isTelemetryEnabled: boolean) => `<script>
|
||||
messageDiv.innerHTML = html;
|
||||
messagesDiv.appendChild(messageDiv);
|
||||
|
||||
if (shouldScroll) scrollToBottom(messagesDiv);
|
||||
scrollToBottomIfNeeded(messagesDiv, shouldScroll);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user