fix: auto-expand sidebar when a project is selected

When the sidebar is collapsed and the user clicks a project, the session
list was silently updated behind the hidden panel with no visual feedback,
leaving the user confused about why nothing appeared to change.

Fixed by setting sidebarCollapsed: false in both selectProject and
selectRepository at the moment of selection. Both entry points are covered:
- selectRepository: used by the dashboard project cards
- selectProject: used by the command palette and keyboard shortcuts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
proxy 2026-02-21 15:56:40 -05:00
parent 39d88e22a4
commit c69d2414d6
2 changed files with 2 additions and 0 deletions

View file

@ -59,6 +59,7 @@ export const createProjectSlice: StateCreator<AppState, [], [], ProjectSlice> =
selectProject: (id: string) => {
set({
selectedProjectId: id,
sidebarCollapsed: false, // Ensure session list is visible when a project is selected
...getSessionResetState(),
});

View file

@ -87,6 +87,7 @@ export const createRepositorySlice: StateCreator<AppState, [], [], RepositorySli
selectedWorktreeId: worktreeToSelect.id,
selectedProjectId: worktreeToSelect.id,
activeProjectId: worktreeToSelect.id,
sidebarCollapsed: false, // Ensure session list is visible when a project is selected
...getSessionResetState(),
});
// Fetch sessions for this worktree