fix: event-loop freezes, plugin-install boot crash, tmux attach/scrollbar, Codex transcripts
- GET /api/workflows: one LEAD() window pass in a read worker (read-pool.js, workflow-stats.js); idx_events_session restored, idx_events_tool added - compat-sqlite gains function/pluck/readonly so a plugin install without a better-sqlite3 build boots again; antigravity-usage uses db.js's Database - install-hooks adds no checkout hooks while the agenthub plugin is enabled (events were doubled) - terminal attach runs the live tmux server's own binary; the pane scrollbar gets a visible 2-column style, and claude panes start with CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 so tmux keeps history to scroll - Codex sessions' conversation in GET /api/sessions/:id/transcript - Codex/Antigravity sessions claimed by their workspace without hooks - UI-audit follow-ups, docs and OpenAPI
This commit is contained in:
@@ -16,6 +16,7 @@ export interface ToastItem {
|
||||
}
|
||||
|
||||
const SUCCESS_MS = 4000;
|
||||
const MAX_TOASTS = 4;
|
||||
let items: ToastItem[] = [];
|
||||
let nextId = 1;
|
||||
const listeners = new Set<(items: ToastItem[]) => void>();
|
||||
@@ -33,7 +34,14 @@ export function dismissToast(id: number): void {
|
||||
function push(kind: ToastKind, message: string): number {
|
||||
const id = nextId++;
|
||||
// Same text twice in a row (a double click, a retry) shows once.
|
||||
items = [...items.filter((t) => t.message !== message), { id, kind, message }].slice(-4);
|
||||
const next = [...items.filter((t) => t.message !== message), { id, kind, message }];
|
||||
// Over four: the oldest non-error goes first, so an unread error is not pushed
|
||||
// out by a few copies or saves; the newest toast always stays.
|
||||
while (next.length > MAX_TOASTS) {
|
||||
const older = next.slice(0, -1).findIndex((t) => t.kind !== "error");
|
||||
next.splice(older === -1 ? 0 : older, 1);
|
||||
}
|
||||
items = next;
|
||||
emit();
|
||||
if (kind !== "error") window.setTimeout(() => dismissToast(id), SUCCESS_MS);
|
||||
return id;
|
||||
|
||||
Reference in New Issue
Block a user