From 0bf3e840dc5c995942aa44082d7b43a64f4e5e26 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Sat, 27 Jun 2026 23:13:31 +0900 Subject: feat(workspace-active-indicator): show loading dots on workspace cards with active chats --- src/features/workspaces/ui/WorkspaceCard.svelte | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/features/workspaces/ui/WorkspaceCard.svelte') diff --git a/src/features/workspaces/ui/WorkspaceCard.svelte b/src/features/workspaces/ui/WorkspaceCard.svelte index 0ffc975..1825b7d 100644 --- a/src/features/workspaces/ui/WorkspaceCard.svelte +++ b/src/features/workspaces/ui/WorkspaceCard.svelte @@ -11,14 +11,27 @@ store, onNavigate, computers, + hasActive, }: { ws: WorkspaceEntry; store: WorkspaceStore; onNavigate: (path: string) => void; /** Discovered computers (`GET /computers`), for the default-computer dropdown. */ computers: readonly ComputerEntry[]; + /** + * Optional port: returns whether the workspace has at least one active + * (generating / queued) conversation — drives a loading-dots indicator on + * the card. Wired by the composition root to the app store's + * `workspaceHasActiveConversations`. Absent → no indicator (e.g. tests). + */ + hasActive?: (workspaceId: string) => boolean; } = $props(); + // Whether at least one conversation in this workspace is currently active + // (generating). Reactive: the composition-root port reads the app store's + // reactive tab set + lifecycle statuses, so this re-derives on change. + const active = $derived(hasActive?.(ws.id) ?? false); + // ── Title: double-click to rename inline ────────────────────────────────── let editingTitle = $state(false); let titleDraft = $state(""); @@ -122,6 +135,13 @@ ondblclick={startEditTitle}>{ws.title} {/if} + {#if active} + + {/if} /{ws.id} {ws.conversationCount} -- cgit v1.2.3