Sidebar: workspace chat list is not visible until clicking the folder chevron
Describe the bug
When navigating to a workspace (either via URL or by clicking the workspace name in the sidebar), the chat list remains hidden. The user must click a small folder chevron icon to expand the workspace and see the chat list. Clicking the workspace name should also expand the workspace to show its chats.
To Reproduce
- Open the app with
?workspace=/some/path (or any workspace path)
- Notice the sidebar shows the workspace name but no chat list
- The chat list only appears after clicking the tiny folder chevron icon next to the workspace name
Expected behavior
- When navigating to a workspace (clicking its name), the workspace should auto-expand to show the chat list
- When loading a page with a
?workspace= URL parameter, that workspace should auto-expand
Technical details
The issue is in SidebarWorkspaceList.svelte. The openWorkspace() function navigates to the workspace URL but does not expand the workspace. The onMount also does not auto-expand the workspace from the URL.
Patch (source-level diff)
Two changes to cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte:
Change 1 — openWorkspace() function:
function openWorkspace(e: MouseEvent, path: string) {
if (e.metaKey || e.ctrlKey) return;
e.preventDefault();
// NEW: expand the workspace when clicking the name
if (!expandedWorkspaces.has(path)) {
const next = new Set(expandedWorkspaces);
next.add(path);
expandedWorkspaces = next;
if (!wsChatsCache.has(path)) fetchWorkspaceChats(path);
}
goto(`/?workspace=${encodeURIComponent(path)}`);
closeMobileSidebar();
}
Change 2 — inside onMount():
onMount(async () => {
// ... existing sortable setup ...
// ... existing socket listener ...
// NEW: auto-expand the workspace from the URL on page load
if (currentPath && !expandedWorkspaces.has(currentPath)) {
const next = new Set(expandedWorkspaces);
next.add(currentPath);
expandedWorkspaces = next;
await fetchWorkspaceChats(currentPath);
}
});
For pipx installations (no source available):
Edit the compiled JS file at _app/immutable/nodes/0.<hash>.js:
- In
function N(e,t){...} — add ,l(x).has(t)||O(t) after the goto() call
- In
L(()=>{...}) — add ,l(D)&&!l(x).has(l(D))&&O(l(D)) before the closing })
- Bump the service worker version timestamp to force re-cache
Sidebar: workspace chat list is not visible until clicking the folder chevron
Describe the bug
When navigating to a workspace (either via URL or by clicking the workspace name in the sidebar), the chat list remains hidden. The user must click a small folder chevron icon to expand the workspace and see the chat list. Clicking the workspace name should also expand the workspace to show its chats.
To Reproduce
?workspace=/some/path(or any workspace path)Expected behavior
?workspace=URL parameter, that workspace should auto-expandTechnical details
The issue is in
SidebarWorkspaceList.svelte. TheopenWorkspace()function navigates to the workspace URL but does not expand the workspace. TheonMountalso does not auto-expand the workspace from the URL.Patch (source-level diff)
Two changes to
cptr/frontend/src/lib/components/SidebarWorkspaceList.svelte:Change 1 —
openWorkspace()function:Change 2 — inside
onMount():For pipx installations (no source available):
Edit the compiled JS file at
_app/immutable/nodes/0.<hash>.js:function N(e,t){...}— add,l(x).has(t)||O(t)after thegoto()callL(()=>{...})— add,l(D)&&!l(x).has(l(D))&&O(l(D))before the closing})