feat(ui,api): chat view with live tail and autoscroll, conversation rail with last message previews
This commit is contained in:
@@ -8,6 +8,7 @@ import type {
|
||||
import { session } from "./session.svelte";
|
||||
|
||||
const TAPE_SIZE = 120;
|
||||
const RELOAD_DEBOUNCE_MS = 1500;
|
||||
const QUIET = new Set(["stream", "hello"]);
|
||||
|
||||
// Gateway-wide live state: the conversation index kept fresh by
|
||||
@@ -98,10 +99,28 @@ class Gateway {
|
||||
this.applyLimit(event);
|
||||
return;
|
||||
}
|
||||
case "message.queued":
|
||||
case "inject.queued":
|
||||
case "reply": {
|
||||
this.reloadSoon();
|
||||
return;
|
||||
}
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
private reloadTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
private reloadSoon(): void {
|
||||
if (this.reloadTimer) {
|
||||
return;
|
||||
}
|
||||
this.reloadTimer = setTimeout(() => {
|
||||
this.reloadTimer = null;
|
||||
this.load().catch(() => undefined);
|
||||
}, RELOAD_DEBOUNCE_MS);
|
||||
}
|
||||
|
||||
private applyLimit(event: BusEvent): void {
|
||||
if (!this.limits || typeof event.window !== "string") {
|
||||
this.refreshLimits().catch(() => undefined);
|
||||
|
||||
Reference in New Issue
Block a user