fix(term): flex layout for details summary, fix thinking brain icon column

This commit is contained in:
damocles 2026-07-05 12:10:24 +02:00
commit 758f5ae5a8
2 changed files with 42 additions and 3 deletions

View file

@ -1926,13 +1926,19 @@ window.marked = marked;
// tick starts a fresh row.
if (v.subtype === 'thinking_tokens') {
const n = v.estimated_tokens;
const label = '🧠 thinking … '
const text = 'thinking … '
+ (n != null ? '~' + Number(n).toLocaleString() + ' tokens' : '');
if (thinkingTokensRow && thinkingTokensRow.isConnected
&& thinkingTokensRow.nextElementSibling === null) {
thinkingTokensRow.textContent = label;
// Update only the text portion after the icon glyph
// (textContent would clobber the .row-glyph span).
const glyph = thinkingTokensRow.querySelector('.row-glyph');
[...thinkingTokensRow.childNodes].forEach((node) => {
if (node !== glyph) thinkingTokensRow.removeChild(node);
});
thinkingTokensRow.appendChild(document.createTextNode(text));
} else {
thinkingTokensRow = api.row('note', label);
thinkingTokensRow = api.row('note', text, '🧠');
}
return;
}