From 6d756215a2f96d362ff35278faf8a2b802a24f8f Mon Sep 17 00:00:00 2001 From: garrach Date: Mon, 15 Jun 2026 06:57:59 +0100 Subject: [PATCH] fix: respect user scroll-up in thinking section Only auto-scroll the live thinking panel while the user is near the bottom, so manual scroll-up is preserved during streaming. --- static/js/chat.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/chat.js b/static/js/chat.js index a9d89cc64..adb68c9c5 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -1564,9 +1564,12 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer .replace(//gi, ''); thinkText = thinkText.replace(/^\s*Thinking(?:\s+Process)?:\s*/i, ''); _liveThinkInner.innerHTML = markdownModule.mdToHtml(thinkText); - // Keep thinking box scrolled to bottom + // Keep thinking box scrolled to bottom, but let user scroll up var thinkBox = _liveThinkInner.closest('.thinking-content'); - if (thinkBox) thinkBox.scrollTop = thinkBox.scrollHeight; + if (thinkBox) { + var nearBottom = thinkBox.scrollHeight - thinkBox.clientHeight - thinkBox.scrollTop < 80; + if (nearBottom) thinkBox.scrollTop = thinkBox.scrollHeight; + } } uiModule.scrollHistory(); continue;