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.
This commit is contained in:
garrach
2026-06-15 06:57:59 +01:00
committed by GitHub
parent 7dedc51d9f
commit 6d756215a2
+5 -2
View File
@@ -1564,9 +1564,12 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
.replace(/<channel\|>/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;