SSE reconnect, task switcher state/inbox/new task, stream throttle
This commit is contained in:
@@ -19,6 +19,15 @@ const views: Record<View, { label: string; mount: (root: HTMLElement) => () => v
|
||||
|
||||
const order: View[] = ["transcript", "changes", "tasks", "inbox", "admin", "settings"];
|
||||
|
||||
const panes: Pane[] = [];
|
||||
|
||||
export function openTranscript(): void {
|
||||
if (panes.some((p) => p.current() === "transcript")) {
|
||||
return;
|
||||
}
|
||||
(panes.find((p) => p.current() !== "tasks") ?? panes[0])?.show("transcript");
|
||||
}
|
||||
|
||||
export class Pane {
|
||||
readonly el: HTMLElement;
|
||||
private readonly tabs: HTMLElement;
|
||||
@@ -34,6 +43,11 @@ export class Pane {
|
||||
const saved = localStorage.getItem(this.storageKey()) as View | null;
|
||||
this.view = saved && saved in views ? saved : fallback;
|
||||
this.show(this.view);
|
||||
panes.push(this);
|
||||
}
|
||||
|
||||
current(): View {
|
||||
return this.view;
|
||||
}
|
||||
|
||||
show(view: View): void {
|
||||
|
||||
Reference in New Issue
Block a user