diff --git a/cptr/frontend/src/lib/components/Sidebar.svelte b/cptr/frontend/src/lib/components/Sidebar.svelte
index 8a39498..31b1a58 100644
--- a/cptr/frontend/src/lib/components/Sidebar.svelte
+++ b/cptr/frontend/src/lib/components/Sidebar.svelte
@@ -1,148 +1,18 @@
{#if $sidebarOpen}
@@ -278,269 +77,17 @@
onpointerdown={startResize}
ondblclick={() => sidebarWidth.set(220)}
>
-
-
-
-
-
-
-
-
-
- {#if $chatEnabled}
-
- {/if}
-
-
-
- {$t('sidebar.workspaces')}
-
-
-
-
-
- {#each $workspaceList as ws (ws.path)}
- {@const isExpanded = expandedWorkspaces.has(ws.path)}
- {@const chats = wsChatsCache.get(ws.path)}
- {@const isLoading = wsChatsLoading.has(ws.path)}
-
-
-
-
- {#if $chatEnabled && isExpanded}
-
- {#if isLoading && !chats}
-
-
-
-
-
- {:else if chats && chats.length > 0}
- {#each chats as chat (chat.id)}
-
handleSidebarChatClick(chat.id, ws.path, chat.title)}
- />
- {/each}
-
- {:else if chats}
-
- {/if}
-
- {/if}
-
- {/each}
-
- {#if $workspaceList.length === 0}
-
-
{$t('sidebar.noWorkspaces')}
-
- {/if}
-
-
-
-
-
-
+
+
+ (showPicker = true)} />
+
{/if}
-{#if showMenu && menuButtonEl}
- {
- settingsTab = 'account';
- showMenu = false;
- showSettings = true;
- }
- }
- ]
- : []),
- ...($session ? [{ divider: true, label: '', onclick: () => {} }] : []),
- {
- label: $t('sidebar.settings'),
- icon: 'settings',
- shortcut: formatChord($keybindings.openSettings),
- onclick: openSettings
- },
- {
- label: $t('system.infoTitle'),
- icon: 'info',
- onclick: openSystemInfo
- },
- { divider: true, label: '', onclick: () => {} },
- { label: $t('sidebar.logOut'), icon: 'log-out', onclick: logout }
- ]}
- onclose={() => (showMenu = false)}
- />
-{/if}
-
{#if showPicker}
(showPicker = false)} />
{/if}
-{#if wsMenuPath && wsMenuAnchor}
- handleRemoveWorkspace(wsMenuPath!)
- }
- ]}
- onclose={closeWsMenu}
- />
-{/if}
-
{#if showSettings}
diff --git a/cptr/frontend/src/lib/components/SidebarFooter.svelte b/cptr/frontend/src/lib/components/SidebarFooter.svelte
new file mode 100644
index 0000000..cd06a6e
--- /dev/null
+++ b/cptr/frontend/src/lib/components/SidebarFooter.svelte
@@ -0,0 +1,87 @@
+
+
+
+
(showMenu = !showMenu)}
+ >
+
+ {$session?.display_name || $session?.username || $t('sidebar.settings')}
+ {#if $appVersion}
+ {
+ e.stopPropagation();
+ showChangelog.set(true);
+ }}
+ class="ml-auto text-[0.625rem] text-gray-400 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 font-mono hover:underline cursor-pointer"
+ >
+ v{$appVersion}
+
+ {/if}
+
+
+
+{#if showMenu && menuButtonEl}
+ openSettings('account')
+ }
+ ]
+ : []),
+ ...($session ? [{ divider: true, label: '', onclick: () => {} }] : []),
+ {
+ label: $t('sidebar.settings'),
+ icon: 'settings',
+ shortcut: formatChord($keybindings.openSettings),
+ onclick: () => openSettings()
+ },
+ {
+ label: $t('system.infoTitle'),
+ icon: 'info',
+ onclick: openSystemInfo
+ },
+ { divider: true, label: '', onclick: () => {} },
+ { label: $t('sidebar.logOut'), icon: 'log-out', onclick: clearSession }
+ ]}
+ onclose={() => (showMenu = false)}
+ />
+{/if}
diff --git a/cptr/frontend/src/lib/components/SidebarHeader.svelte b/cptr/frontend/src/lib/components/SidebarHeader.svelte
new file mode 100644
index 0000000..465ac53
--- /dev/null
+++ b/cptr/frontend/src/lib/components/SidebarHeader.svelte
@@ -0,0 +1,32 @@
+
+
+
+
Computer
+
sidebarOpen.set(false)}
+ aria-label={$t('sidebar.collapse')}
+ use:tooltip={$t('sidebar.collapse')}
+ >
+
+
+
diff --git a/cptr/frontend/src/lib/components/SidebarNav.svelte b/cptr/frontend/src/lib/components/SidebarNav.svelte
new file mode 100644
index 0000000..e8d1145
--- /dev/null
+++ b/cptr/frontend/src/lib/components/SidebarNav.svelte
@@ -0,0 +1,48 @@
+
+
+
+ showSearch.set(true)}
+ >
+
+ {$t('search.search')}
+
+
+
+
+{#if $chatEnabled}
+
+{/if}
diff --git a/cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte b/cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte
new file mode 100644
index 0000000..98d3a23
--- /dev/null
+++ b/cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte
@@ -0,0 +1,426 @@
+
+
+
+ {$t('sidebar.workspaces')}
+
+
+
+
+
+
+ {#each $workspaceList as ws (ws.path)}
+ {@const isExpanded = expandedWorkspaces.has(ws.path)}
+ {@const chats = wsChatsCache.get(ws.path)}
+ {@const isLoading = wsChatsLoading.has(ws.path)}
+
+
+
+ {#if $chatEnabled && isExpanded}
+
+ {#if isLoading && !chats}
+
+
+
+
+
+ {:else if chats && chats.length > 0}
+ {#each chats as chat (chat.id)}
+
openChat(chat.id, ws.path)}
+ onmenu={(e) => openChatMenu(e, chat.id, ws.path)}
+ />
+ {/each}
+ showMoreChats(ws.path)}>
+ {$t('sidebar.showMore')}
+
+ {/if}
+
+ {/if}
+
+ {/each}
+
+ {#if $workspaceList.length === 0}
+
+
{$t('sidebar.noWorkspaces')}
+
+ {/if}
+
+
+{#if wsMenuPath && wsMenuAnchor}
+ handleRemoveWorkspace(wsMenuPath!)
+ }
+ ]}
+ onclose={closeWsMenu}
+ />
+{/if}
+
+{#if chatMenu}
+
+{/if}
+
+