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;
|
||||
|
||||
+7
-3
@@ -9440,8 +9440,11 @@ body.popup-mode .content-area {
|
||||
.bookslm-messages { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex;
|
||||
flex-direction: column; gap: 24px; }
|
||||
.bookslm-msg { display: flex; flex-direction: column; gap: 4px; scroll-margin-top: 14px; }
|
||||
.bookslm-msg.user { align-self: flex-end; max-width: 80%; }
|
||||
.bookslm-msg.assistant { align-self: stretch; width: 100%; }
|
||||
/* The user bubble is capped against the *thread* width, not against a
|
||||
shrink-to-fit wrapper: capping both would compound (80% × 85% ≈ 68%) and
|
||||
produced very short lines. Wrapper stretches, bubble carries the cap. */
|
||||
.bookslm-msg.user { align-items: flex-end; }
|
||||
.bookslm-msg.assistant { align-items: stretch; width: 100%; }
|
||||
.bookslm-msg-meta { font-size: 11px; color: var(--text-secondary); opacity: 0.75;
|
||||
padding: 0 2px; align-self: flex-start; user-select: none; }
|
||||
/* Hover-revealed action bar (Copier / Ajouter). */
|
||||
@@ -9456,7 +9459,8 @@ body.popup-mode .content-area {
|
||||
.bookslm-msg-action:hover { background: var(--surface2); color: var(--text-primary);
|
||||
border-color: var(--border); }
|
||||
.bookslm-bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
|
||||
.bookslm-bubble.user { align-self: flex-end; background: var(--surface2); color: var(--text-primary); border-bottom-right-radius: 6px; }
|
||||
.bookslm-bubble.user { align-self: flex-end; max-width: 90%; min-width: 0;
|
||||
background: var(--surface2); color: var(--text-primary); border-bottom-right-radius: 6px; }
|
||||
.bookslm-bubble.assistant { align-self: flex-start; background: transparent; padding: 0; width: 100%; max-width: 100%; color: var(--text-primary); }
|
||||
.bookslm-bubble.assistant code { background: rgba(0,0,0,0.2); padding: 1px 4px; border-radius: 3px; font-size: 0.9em; }
|
||||
.bookslm-bubble.assistant pre { background: rgba(0,0,0,0.3); padding: 10px; border-radius: 6px; overflow-x: auto; margin: 8px 0; }
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
* cache or Cloudflare does NOT clear the Service Worker Cache Storage, which is
|
||||
* a separate store. Bumping SW_VERSION invalidates it on every release.
|
||||
*/
|
||||
const SW_VERSION = 'v10';
|
||||
const SW_VERSION = 'v12';
|
||||
const CODE_CACHE = `obsigate-code-${SW_VERSION}`;
|
||||
const RUNTIME_CACHE = `obsigate-runtime-${SW_VERSION}`;
|
||||
const API_CACHE = `obsigate-api-${SW_VERSION}`;
|
||||
|
||||
Reference in New Issue
Block a user