feat(v2): add agent tree, status bar, notifications, settings dialog (Phase 5)
Agent tree visualization (SVG) with horizontal layout and bezier edges. Global status bar with pane counts, active agents pulse, token/cost totals. Toast notification system with auto-dismiss and agent dispatcher integration. Settings dialog with SQLite persistence for shell, cwd, and max panes. Keyboard shortcuts: Ctrl+W close pane, Ctrl+, open settings.
This commit is contained in:
parent
cd1271adf0
commit
be24d07c65
13 changed files with 809 additions and 2 deletions
36
v2/src/lib/stores/notifications.svelte.ts
Normal file
36
v2/src/lib/stores/notifications.svelte.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
// Notification store — ephemeral toast messages
|
||||
|
||||
export type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
||||
|
||||
export interface Notification {
|
||||
id: string;
|
||||
type: NotificationType;
|
||||
message: string;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
let notifications = $state<Notification[]>([]);
|
||||
|
||||
const MAX_TOASTS = 5;
|
||||
const TOAST_DURATION_MS = 4000;
|
||||
|
||||
export function getNotifications(): Notification[] {
|
||||
return notifications;
|
||||
}
|
||||
|
||||
export function notify(type: NotificationType, message: string): void {
|
||||
const id = crypto.randomUUID();
|
||||
notifications.push({ id, type, message, timestamp: Date.now() });
|
||||
|
||||
// Cap visible toasts
|
||||
if (notifications.length > MAX_TOASTS) {
|
||||
notifications = notifications.slice(-MAX_TOASTS);
|
||||
}
|
||||
|
||||
// Auto-dismiss
|
||||
setTimeout(() => dismissNotification(id), TOAST_DURATION_MS);
|
||||
}
|
||||
|
||||
export function dismissNotification(id: string): void {
|
||||
notifications = notifications.filter(n => n.id !== id);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue