diff options
| author | Adam Malczewski <[email protected]> | 2026-06-28 15:26:40 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-28 15:26:40 +0900 |
| commit | 7f2d66d5c132b45f7d01b0d9107f341094b9c904 (patch) | |
| tree | fae4f560db3790feaf67be615e969479af316957 /src/features/workspaces/ui/WorkspaceCard.svelte | |
| parent | 22a8dbf96dda066dc5027694b1fe512df9f3fc11 (diff) | |
| parent | 565217724f74d3303092c522d28f74f35132df3b (diff) | |
| download | dispatch-web-7f2d66d5c132b45f7d01b0d9107f341094b9c904.tar.gz dispatch-web-7f2d66d5c132b45f7d01b0d9107f341094b9c904.zip | |
Merge branch 'feature/workspace-active-indicator' into predev
Diffstat (limited to 'src/features/workspaces/ui/WorkspaceCard.svelte')
| -rw-r--r-- | src/features/workspaces/ui/WorkspaceCard.svelte | 20 |
1 files changed, 20 insertions, 0 deletions
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}</span > {/if} + {#if active} + <span + class="loading loading-dots loading-xs shrink-0 text-primary" + aria-label="Workspace has active conversations" + title="A conversation in this workspace is generating"></span + > + {/if} <span class="font-mono text-xs opacity-50">/{ws.id}</span> <span class="ml-auto text-xs opacity-50"> {ws.conversationCount} |
