clean up frontend

This commit is contained in:
felix
2026-09-26 18:22:27 +02:00
parent 4c81c21261
commit ac05a5ed2b
10 changed files with 199 additions and 28 deletions

View File

@@ -0,0 +1,17 @@
import Modifier from 'ember-modifier';
// Keeps the chat scrolled to the bottom: on insert, when another
// conversation is opened, and when the number of messages changes. The same
// conversation and count (e.g. a poll reload) leaves the scroll position
// alone, so reading history is not interrupted.
export default class ChatScrollBottom extends Modifier {
lastKey = null;
modify(element, positional) {
const [id, count] = positional;
const key = `${id}:${count}`;
if (key === this.lastKey) return;
this.lastKey = key;
element.scrollTop = element.scrollHeight;
}
}