Skip to content

fix: auto-expand sidebar when a project is selected#56

Merged
matt1398 merged 1 commit intomatt1398:mainfrom
proxikal:feat/sidebar-auto-open-on-project-select
Feb 22, 2026
Merged

fix: auto-expand sidebar when a project is selected#56
matt1398 merged 1 commit intomatt1398:mainfrom
proxikal:feat/sidebar-auto-open-on-project-select

Conversation

@proxikal
Copy link
Contributor

Summary

When the sidebar is collapsed and the user clicks a project, the session list updated silently behind the hidden panel — no visual feedback, nothing appeared to happen. The user had to manually re-open the sidebar to see the result.

Selecting a project implies intent to browse its sessions. The sidebar should open automatically to reflect that.

Root Cause

Project selection is handled in two separate store actions:

  • selectRepository — triggered by dashboard project cards
  • selectProject — triggered by the command palette and keyboard shortcuts

Neither action accounted for the sidebar being collapsed when called.

Fix

Added sidebarCollapsed: false to the set() call in both selectProject and selectRepository. The change is atomic with the selection itself — the sidebar opens at exactly the same moment the session list updates.

// selectProject (projectSlice.ts)
set({
  selectedProjectId: id,
  sidebarCollapsed: false, // Ensure session list is visible when a project is selected
  ...getSessionResetState(),
});

// selectRepository (repositorySlice.ts)
set({
  selectedRepositoryId: repositoryId,
  selectedWorktreeId: worktreeToSelect.id,
  selectedProjectId: worktreeToSelect.id,
  activeProjectId: worktreeToSelect.id,
  sidebarCollapsed: false, // Ensure session list is visible when a project is selected
  ...getSessionResetState(),
});

Files Changed

File Change
src/renderer/store/slices/projectSlice.ts Uncollapse sidebar on selectProject
src/renderer/store/slices/repositorySlice.ts Uncollapse sidebar on selectRepository

Test Plan

  • Collapse the sidebar (Cmd+B or the toggle button)
  • Click any project from the dashboard — sidebar should open automatically
  • Open the command palette (Cmd+K), select a project — sidebar should open automatically
  • Selecting a session within an already-open sidebar is unaffected

🤖 Generated with Claude Code

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>
@proxikal
Copy link
Contributor Author

Closing to re-submit after running full quality gates (typecheck, lint, test, build).

@proxikal proxikal closed this Feb 21, 2026
@proxikal proxikal reopened this Feb 21, 2026
@proxikal
Copy link
Contributor Author

Quality gates verified before re-opening: pnpm typecheckpnpm lintpnpm test (650 tests passing) ✅ pnpm build

@matt1398 matt1398 merged commit 40a4676 into matt1398:main Feb 22, 2026
3 checks passed
@proxikal proxikal deleted the feat/sidebar-auto-open-on-project-select branch February 23, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants