fix(assistant): #91 bulle utilisateur elargie (81% du fil) + ancrage de la question des l'envoi ; docs: feuille de route outils #92
CI / lint (push) Successful in 1m23s
CI / security (push) Successful in 58s
CI / test (push) Successful in 2m37s
CI / build (push) Successful in 51s
CI / e2e (push) Successful in 10m47s

This commit is contained in:
2026-09-15 19:34:05 -04:00
parent 0e9fcb78e0
commit 1ed0d52619
8 changed files with 182 additions and 9 deletions
+9 -3
View File
@@ -1803,7 +1803,7 @@ class BooksLM {
container.appendChild(this._chatBubble(msg));
}
if (opts.anchor) this._anchorLatestUser();
if (opts.anchor) this._anchorLatestUser({ instant: !!opts.instant });
else if (this._isLoading && this._pinnedTurn) this._anchorLatestUser({ instant: true });
else container.scrollTop = prevTop;
}
@@ -2279,7 +2279,9 @@ class BooksLM {
.map((m) => ({ role: m.role, content: m.content }));
this._messages.push({ role: 'user', content: text });
this._renderMessages({ anchor: true });
// Instant anchor: the post must already sit at the top when the answer
// starts streaming (a smooth animation would leave it at the bottom).
this._renderMessages({ anchor: true, instant: true });
let provider = null;
let model = null;
@@ -2309,8 +2311,12 @@ class BooksLM {
const assistantMsg = { role: 'assistant', content: '', sources: [], toolCalls: [], confirmation: null, payload };
this._messages.push(assistantMsg);
this._renderMessages();
// Loading must be flagged *before* this render: otherwise it would take
// the "restore previous scroll" branch and cancel the anchor applied to
// the user post, leaving the new question at the bottom until the first
// token arrives.
this._isLoading = true;
this._renderMessages({ anchor: true, instant: true });
const sendBtn = this._panel.querySelector('.bookslm-btn-send');
if (sendBtn) sendBtn.disabled = true;