Revert "use a flex column-reverse outside a column"

fixes firefox autoscroll
This commit is contained in:
Charlotte Som 2025-02-28 16:21:44 +00:00
parent 8c058d217d
commit 95bca64731
3 changed files with 13 additions and 9 deletions

View file

@ -71,6 +71,9 @@ function conversationUI(id: string) {
if (typeof event.data !== "string") return;
const message = JSON.parse(event.data);
const scrolledToBottom =
chatlog.scrollTop + 16 >= chatlog.scrollHeight - chatlog.clientHeight;
if ("i" in message) {
window.history.replaceState(null, "", "#" + message.i);
id = message.i;
@ -103,6 +106,8 @@ function conversationUI(id: string) {
inFlightMessages.delete(message.r);
}
}
if (scrolledToBottom) chatlog.scrollTop = chatlog.scrollHeight - chatlog.clientHeight;
});
const form = (
@ -121,7 +126,7 @@ function conversationUI(id: string) {
return (
<section className="conversation">
{header}
<section className="chatlog-wrapper">{chatlog}</section>
{chatlog}
{form}
</section>
);

View file

@ -77,6 +77,11 @@ export class ChatResponse {
this.currentLine.appendData(token);
}
}
if (this.thinkingContext) {
this.thinkingContext.scrollTop =
this.thinkingContext.scrollHeight - this.thinkingContext.clientHeight;
}
}
finalize() {

View file

@ -66,18 +66,12 @@ main,
}
}
.chatlog-wrapper {
flex: 1;
display: flex;
flex-direction: column-reverse;
overflow-y: scroll;
}
.chatlog {
flex: 1;
display: flex;
flex-direction: column;
overflow-y: scroll;
article {
white-space: preserve;