From d37f8a5c4d516070f19c70c95ee4709382fc4cab Mon Sep 17 00:00:00 2001 From: Aleksander Grygier Date: Mon, 17 Aug 2026 14:01:31 +0200 Subject: [PATCH] ui : render conversation tab bar in chat layout Desktop-only tab bar above the chat screen, one tab per open conversation or new-chat tab. The active tab follows the route id; clicking navigates, middle-click or the close button closes (switching to the left neighbor), and a trailing + starts a new chat. Tabs appear only on chat-id routes; the bare #/ new-chat view has none. The bare route stays put unless a prompt/model deep-link routes it to a new-chat tab. --- .../app/chat/ChatTabs/ChatTabs.svelte | 109 ++++++++++++++++++ tools/ui/src/lib/components/app/chat/index.ts | 12 ++ tools/ui/src/routes/(chat)/+layout.svelte | 28 ++++- tools/ui/src/routes/(chat)/+page.svelte | 82 +------------ 4 files changed, 151 insertions(+), 80 deletions(-) create mode 100644 tools/ui/src/lib/components/app/chat/ChatTabs/ChatTabs.svelte diff --git a/tools/ui/src/lib/components/app/chat/ChatTabs/ChatTabs.svelte b/tools/ui/src/lib/components/app/chat/ChatTabs/ChatTabs.svelte new file mode 100644 index 0000000000..9e433026a5 --- /dev/null +++ b/tools/ui/src/lib/components/app/chat/ChatTabs/ChatTabs.svelte @@ -0,0 +1,109 @@ + + + diff --git a/tools/ui/src/lib/components/app/chat/index.ts b/tools/ui/src/lib/components/app/chat/index.ts index 34571d53ba..a96ae37891 100644 --- a/tools/ui/src/lib/components/app/chat/index.ts +++ b/tools/ui/src/lib/components/app/chat/index.ts @@ -686,6 +686,18 @@ export { default as ChatMessageSystem } from './ChatMessages/ChatMessage/ChatMes */ export { default as ChatScreen } from './ChatScreen/ChatScreen.svelte'; +/** + * **ChatTabs** - Browser-style tab bar for open conversations + * + * Horizontal strip of tabs rendered above ChatScreen in the chat layout, + * one per conversation tracked by tabsStore. The active tab follows the + * route's conversation id; clicking a tab navigates to it, middle-click or + * the close button closes it (switching to the left neighbor when closing + * the active tab), and a trailing "+" button starts a new chat. Shows a + * spinner on tabs with a running generation. Desktop-only. + */ +export { default as ChatTabs } from './ChatTabs/ChatTabs.svelte'; + /** * Visual overlay displayed when user drags files over the chat screen. * Shows drop zone indicator to guide users where to release files. diff --git a/tools/ui/src/routes/(chat)/+layout.svelte b/tools/ui/src/routes/(chat)/+layout.svelte index 37aa035824..33769bc911 100644 --- a/tools/ui/src/routes/(chat)/+layout.svelte +++ b/tools/ui/src/routes/(chat)/+layout.svelte @@ -1,12 +1,34 @@ - +
+ {#if showTabs} + + {/if} + + +
{@render children?.()} diff --git a/tools/ui/src/routes/(chat)/+page.svelte b/tools/ui/src/routes/(chat)/+page.svelte index de8574e352..e41814cdd1 100644 --- a/tools/ui/src/routes/(chat)/+page.svelte +++ b/tools/ui/src/routes/(chat)/+page.svelte @@ -1,79 +1,11 @@