summaryrefslogtreecommitdiffhomepage
path: root/src/app/views/TabsPane.svelte
blob: 4547e0649caab62a4d808084a9567119e2202f36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<script lang="ts">
  /**
   * The `tabs` view — the conversation tab list (moved out of the top bar into
   * the sidebar). Re-mounts per workspace so the filtered tab set + scroll
   * reset cleanly on a workspace switch (the {#key} moved inside the wrapper).
   */
  import { TabList } from "../../features/tabs";
  import type { AppViewPorts } from "../view-ports";

  let { ports }: { ports: AppViewPorts } = $props();
  const store = $derived(ports.store);
</script>

{#key store.activeWorkspaceId}
  <TabList
    tabs={store.tabs}
    activeConversationId={store.activeConversationId}
    statusFor={(id) => store.conversationStatus(id)}
    onSelect={(id) => store.selectTab(id)}
    onClose={(id) => store.closeTab(id)}
    onNewDraft={() => store.newDraft()}
    onRename={(id, title) => store.renameTab(id, title)}
    onSetTabGroup={(id, parentId) => store.setTabGroup(id, parentId)}
  />
{/key}