Prevent footer buttons below last assistant message from always appearing

This commit is contained in:
oobabooga 2025-05-29 12:45:53 -07:00
parent 724147ffab
commit e7129f9dbe

View file

@ -171,7 +171,6 @@ const observer = new MutationObserver(function(mutations) {
document.getElementById("Generate").style.display = "flex"; document.getElementById("Generate").style.display = "flex";
} }
doSyntaxHighlighting(); doSyntaxHighlighting();
if (!isScrolled && targetElement.scrollTop !== targetElement.scrollHeight) { if (!isScrolled && targetElement.scrollTop !== targetElement.scrollHeight) {
@ -184,7 +183,7 @@ const observer = new MutationObserver(function(mutations) {
const lastChild = messagesContainer?.lastElementChild; const lastChild = messagesContainer?.lastElementChild;
const prevSibling = lastChild?.previousElementSibling; const prevSibling = lastChild?.previousElementSibling;
if (lastChild && prevSibling) { if (lastChild && prevSibling) {
lastChild.style.minHeight = `calc(max(70vh, 100vh - ${prevSibling.offsetHeight}px - 102px))`; lastChild.style.setProperty("margin-bottom", `calc(max(70vh, 100vh - ${prevSibling.offsetHeight}px - 102px) - ${lastChild.offsetHeight}px)`, "important");
} }
} }
}); });