summaryrefslogtreecommitdiffhomepage
path: root/packages/frontend/src/lib/components/Header.svelte
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-05-21 19:52:35 +0900
committerAdam Malczewski <[email protected]>2026-05-21 19:52:35 +0900
commit4ba2673557c7cfd0bc31b03e2c35ab5e1efe60e7 (patch)
treedddae8fc37a12157f4c8e840475e9e5d6203464a /packages/frontend/src/lib/components/Header.svelte
parent55633c90c0d96e62153a4b6655f3f833a3b46ad4 (diff)
downloaddispatch-4ba2673557c7cfd0bc31b03e2c35ab5e1efe60e7.tar.gz
dispatch-4ba2673557c7cfd0bc31b03e2c35ab5e1efe60e7.zip
feat: tab system with per-tab agents, DB persistence, and DaisyUI tabs-lift UI
- Add tabs, messages, and settings tables to SQLite database - Backend: refactor AgentManager to manage per-tab Agent instances via Map<tabId, TabAgent> - Backend: WebSocket events tagged with tabId for multiplexing - Backend: tab CRUD routes (create, list, update, archive, messages) - Backend: persist user and assistant messages to DB during chat - Frontend: new tabStore replaces single chatStore with multi-tab reactive state - Frontend: TabBar component using DaisyUI tabs-lift style with status dots - Frontend: Settings sidebar panel for title generation model selection - Frontend: wire ChatPanel, ChatInput, Header to use tabStore - Fix HMR listener accumulation via wsClient.clearCallbacks() - Delete old single-chat chatStore (chat.svelte.ts)
Diffstat (limited to 'packages/frontend/src/lib/components/Header.svelte')
-rw-r--r--packages/frontend/src/lib/components/Header.svelte12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/frontend/src/lib/components/Header.svelte b/packages/frontend/src/lib/components/Header.svelte
index 721a773..ada5500 100644
--- a/packages/frontend/src/lib/components/Header.svelte
+++ b/packages/frontend/src/lib/components/Header.svelte
@@ -1,5 +1,6 @@
<script lang="ts">
-import { chatStore } from "../chat.svelte.js";
+import { tabStore } from "../tabs.svelte.js";
+import { wsClient } from "../ws.svelte.js";
import ThemeSwitcher from "./ThemeSwitcher.svelte";
const { onToggleSidebar }: { onToggleSidebar: () => void } = $props();
@@ -12,7 +13,7 @@ function resetCopyLabel() {
}
async function handleCopy() {
- const text = chatStore.copyConversation();
+ const text = tabStore.copyConversation();
try {
await navigator.clipboard.writeText(text);
copyLabel = "Copied";
@@ -29,8 +30,9 @@ async function handleCopy() {
<span class="text-xl font-bold tracking-tight">Dispatch</span>
</div>
<div class="navbar-end flex items-center gap-3">
- <span class="text-xs text-base-content/60 hidden sm:block">
- {chatStore.activeModelId ?? "Default Model"}
+ <span class="flex items-center gap-1.5 text-xs text-base-content/60">
+ <span class="status status-sm {wsClient.connectionStatus === 'connected' ? 'status-success' : wsClient.connectionStatus === 'connecting' ? 'status-warning' : 'status-error'}"></span>
+ <span class="capitalize">{wsClient.connectionStatus}</span>
</span>
<button
type="button"
@@ -54,7 +56,7 @@ async function handleCopy() {
onclick={onToggleSidebar}
aria-label="Toggle sidebar"
>
- ☰ Sidebar
+ Sidebar
</button>
</div>
</header>