From 76d86d4dbae1466687dce86ca3aeb99654e340e5 Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Fri, 14 Aug 2026 12:38:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20webui=20=E8=81=8A=E5=A4=A9=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=89=93=E5=BC=80=E6=97=B6=E5=AE=9A=E4=BD=8D=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E6=B6=88=E6=81=AF=EF=BC=88switchTab/?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E7=AD=BE=E5=90=8D=E5=91=BD=E4=B8=AD=E5=88=86?= =?UTF-8?q?=E6=94=AF/=E5=9B=BE=E7=89=87=E5=8A=A0=E8=BD=BD=E5=90=8E?= =?UTF-8?q?=E5=9D=87=E5=BC=BA=E5=88=B6=E6=BB=9A=E5=BA=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/plugins/webui/dashboard.html | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/internal/plugins/webui/dashboard.html b/internal/plugins/webui/dashboard.html index 4d61f85..7b21daf 100644 --- a/internal/plugins/webui/dashboard.html +++ b/internal/plugins/webui/dashboard.html @@ -2232,11 +2232,7 @@ if (m) crumb.textContent = __(m[0], m[1]); else crumb.textContent = n; } - if (window.innerWidth <= 768) { - document.body.classList.add("sidebar-collapsed"); - } - renderAll(); - } + if (window.innerWidth <= 768) {\n document.body.classList.add(\"sidebar-collapsed\");\n }\n if (n === \"chat\") {\n state.chatStick = true;\n var msgsEl = document.getElementById(\"chat-msgs\");\n if (msgsEl) {\n msgsEl.scrollTop = msgsEl.scrollHeight;\n }\n }\n renderAll();\n } function toggleSidebar() { document.body.classList.toggle("sidebar-collapsed"); @@ -2660,10 +2656,7 @@ msgsEl.clientHeight < 80; }, - { passive: true }, - ); - } - var msgs = state.messages; + { passive: true },\n );\n msgsEl.addEventListener(\n \"load\",\n function () {\n if (state.chatStick === true) {\n msgsEl.scrollTop = msgsEl.scrollHeight;\n }\n },\n true,\n );\n }\n var msgs = state.messages; var sig = msgs .map(function (m) { var c = m.content || ""; @@ -2686,9 +2679,7 @@ (state.chatLoading ? "1" : "0") + "|P" + (state.pendingTools || []).join(","); - if (msgsEl._chatSig === sig && msgsEl.childElementCount > 0) { - return; - } + \1 if (state.chatStick === true) {\n msgsEl.scrollTop = msgsEl.scrollHeight;\n }\n\2 msgsEl._chatSig = sig; var prevPending = msgsEl._lastPending || []; var newPending = (state.pendingTools || []).slice(); @@ -2899,14 +2890,7 @@ : "") + ""; } - msgsEl.innerHTML = html; - if (state.chatStick !== false) { - try { - msgsEl.scrollTo({ top: msgsEl.scrollHeight, behavior: "smooth" }); - } catch (e) { - msgsEl.scrollTop = msgsEl.scrollHeight; - } - } + msgsEl.innerHTML = html;\n if (state.chatStick !== false) {\n msgsEl.scrollTop = msgsEl.scrollHeight;\n } updateChatBadge(); }