diff --git a/app/static/public/css/chat.css b/app/static/public/css/chat.css index 1fefc32..e609ddb 100644 --- a/app/static/public/css/chat.css +++ b/app/static/public/css/chat.css @@ -848,6 +848,10 @@ body { content: ""; width: 20px; height: 20px; + display: inline-flex; + align-items: center; + justify-content: center; + flex: 0 0 20px; border-radius: 50%; background: conic-gradient(from 180deg, #f59e0b, #f97316, #22c55e, #0ea5e9, #f59e0b); border: 1px solid #fff; diff --git a/app/static/public/js/chat.js b/app/static/public/js/chat.js index ecf159a..99a8489 100644 --- a/app/static/public/js/chat.js +++ b/app/static/public/js/chat.js @@ -1234,7 +1234,8 @@ startedAt: Date.now(), firstTokenAt: null, hasThink: false, - thinkElapsed: null + thinkElapsed: null, + thinkingActive: false }; return entry; } @@ -1535,8 +1536,9 @@ restoreScrollState(entry.contentNode, '.think-rollout-body', savedThinkRolloutBodyScroll); } if (entry.hasThink) { + entry.thinkingActive = !finalize; if (finalize && (entry.thinkElapsed === null || typeof entry.thinkElapsed === 'undefined')) { - entry.thinkElapsed = 0; + entry.thinkElapsed = Math.max(1, Math.round((Date.now() - (entry.startedAt || Date.now())) / 1000)); } updateThinkSummary(entry, entry.thinkElapsed); } @@ -1612,7 +1614,7 @@ node.textContent = text; const block = node.closest('.think-block'); if (!block) return; - if (typeof elapsedSec === 'number') { + if (!entry.thinkingActive) { block.removeAttribute('data-thinking'); node.style.removeProperty('--think-spin-delay'); block.querySelectorAll('.think-agent summary').forEach((summary) => { @@ -2639,6 +2641,7 @@ } if (!assistantEntry.hasThink && assistantText.includes('')) { assistantEntry.hasThink = true; + assistantEntry.thinkingActive = true; assistantEntry.thinkElapsed = null; updateThinkSummary(assistantEntry, null); }