fix(assistant): #91 maintien de l'ancre en haut pendant le streaming, libération au scroll manuel
This commit is contained in:
@@ -304,7 +304,25 @@ async function main() {
|
||||
panel.remove();
|
||||
});
|
||||
|
||||
await test("empty content renders no action bar", () => {
|
||||
await test("manual wheel scroll releases the top-pinning", async () => {
|
||||
const b = new BooksLM();
|
||||
const panel = b._render();
|
||||
b._panel = panel;
|
||||
document.body.appendChild(panel);
|
||||
b._messages = [
|
||||
{ role: "user", content: "premier" },
|
||||
{ role: "assistant", content: "réponse" },
|
||||
{ role: "user", content: "deuxième" },
|
||||
];
|
||||
b._renderMessages({ anchor: true });
|
||||
assert.equal(b._pinnedTurn, true, "anchor sets the pin");
|
||||
const container = panel.querySelector(".bookslm-messages");
|
||||
container.dispatchEvent(new w.WheelEvent("wheel", { deltaY: -30, bubbles: true }));
|
||||
assert.equal(b._pinnedTurn, false, "wheel releases the pin");
|
||||
panel.remove();
|
||||
});
|
||||
|
||||
await test("empty content renders no action bar", () => {
|
||||
const b = new BooksLM();
|
||||
const panel = b._render();
|
||||
b._panel = panel;
|
||||
|
||||
Reference in New Issue
Block a user