Past chat histories in a side bar on desktop (#5098)

Lots of room for improvement, but that's a start.
This commit is contained in:
oobabooga 2024-01-09 01:57:29 -03:00 committed by GitHub
parent 372ef5e2d8
commit 4f7e1eeafd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 10 deletions

View file

@ -385,3 +385,15 @@ new ResizeObserver(updateCssProperties)
.observe(document.querySelector("#chat-input textarea"));
window.addEventListener("resize", updateCssProperties);
//------------------------------------------------
// Keep track of the display width to position the past
// chats dropdown on desktop
//------------------------------------------------
function updateDocumentWidth() {
var updatedWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
document.documentElement.style.setProperty("--document-width", updatedWidth + "px");
}
updateDocumentWidth();
window.addEventListener("resize", updateDocumentWidth);