From 16636c04b88df924b1af0a79dfe5cd574aa33753 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 13 Mar 2026 19:06:04 -0700 Subject: [PATCH] UI: Minor fix/optimization --- js/main.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/js/main.js b/js/main.js index a8bbbc71..5f79c3ec 100644 --- a/js/main.js +++ b/js/main.js @@ -1075,15 +1075,13 @@ document.fonts.addEventListener("loadingdone", (event) => { const currentHeight = chatInputRow.offsetHeight; const heightDifference = currentHeight - originalHeight; chatParent.style.marginBottom = `${originalMarginBottom + heightDifference}px`; + if (!window.isScrolled) { + chatParent.scrollTop = chatParent.scrollHeight - chatParent.clientHeight; + } } - // Watch for changes that might affect height - const observer = new MutationObserver(updateMargin); - observer.observe(chatInputRow, { - childList: true, - subtree: true, - attributes: true - }); + // Watch for size changes that affect height + new ResizeObserver(updateMargin).observe(chatInputRow); // Also listen for window resize window.addEventListener("resize", updateMargin);