fix(assistant): #91 bulle utilisateur elargie (81% du fil) + ancrage de la question des l'envoi ; docs: feuille de route outils #92
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user