Reduce cookbook startup polling

This commit is contained in:
pewdiepie-archdaemon
2026-06-27 13:50:21 +00:00
parent 45ee5a71f4
commit 4222039b67
6 changed files with 66 additions and 26 deletions
+5 -3
View File
@@ -1541,9 +1541,9 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
<div class="thinking-header-left"><span class="live-think-header-text">Thinking\u2026</span></div>
<span class="live-think-spinner-slot" style="flex-shrink:0;margin-left:auto;"></span>
<span class="live-think-timer" style="font-size:11px;opacity:0.4;font-variant-numeric:tabular-nums;margin-left:6px;margin-right:5px;"></span>
<span class="thinking-toggle live-think-toggle" id="${_liveThinkDomId}-toggle"></span>
<span class="thinking-toggle live-think-toggle expanded" id="${_liveThinkDomId}-toggle"></span>
</div>
<div class="thinking-content" id="${_liveThinkDomId}">
<div class="thinking-content expanded" id="${_liveThinkDomId}">
<div class="thinking-content-inner live-think-inner"></div>
</div>
</div>`;
@@ -1589,13 +1589,15 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
_liveThinkTimerEl.textContent = _formatThinkStats(_elapsedLive, _liveThinkTokenCount);
}
// Keep thinking box scrolled to bottom, but let user scroll up
var _followThinking = true;
var thinkBox = _liveThinkInner.closest('.thinking-content');
if (thinkBox) {
var nearBottom = thinkBox.scrollHeight - thinkBox.clientHeight - thinkBox.scrollTop < 80;
if (nearBottom) thinkBox.scrollTop = thinkBox.scrollHeight;
_followThinking = nearBottom;
}
}
uiModule.scrollHistory();
if (_followThinking) uiModule.scrollHistory();
continue;
} else if (!hasUnclosedThink && isThinking) {
isThinking = false;