UI: Minor fix/optimization

This commit is contained in:
oobabooga 2026-03-13 19:06:04 -07:00
parent e8d1c66303
commit 16636c04b8

View file

@ -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);