fix(desktop): keep sidebar Projects chevron visible while the section is collapsed

Merged
KI
3mo ago
+6-2

Fixes #6009.

What happened

The entire "PROJECTS" header strip is a collapse toggle (role="button" with onClick={toggleCollapsed}), and the state persists to localStorage (sidebar-workspaces-collapse). One stray click on the strip collapses the section — but the chevron that indicates the collapsed state was opacity-0 unless hovered, so the section just looked empty: header and + button render, zero project rows, survives Cmd+R and restarts. The collapsed icon rail bypasses the gate (isCollapsed || !workspacesListCollapsed in DashboardSidebar.tsx), which is why icons still showed there — exactly the confusing split the reporter described.

The macOS App Management prompt in the report is coincidental; nothing ties this store to permissions. The likely sequence is a click into the sidebar afterwards landing on the header strip (same accidental-toggle class as #6000).

The fix

Keep the chevron visible (right-pointing) whenever the section is collapsed, so the state reads as "collapsed, click to expand" instead of "my projects are gone". Expanded behavior is unchanged: chevron stays hover/focus-only.

Evidence (CDP-driven dev app, real header clicks)

Reproduced end-to-end before the fix: one synthetic click on the header persisted {"isCollapsed":true} and emptied the section; rail icons unaffected; state survived location.reload(); clicking the header again restored all rows.

Before (collapsed = looks broken)After (collapsed)After (expanded, unchanged)
beforeafter collapsedafter expanded

Screenshots captured via Page.captureScreenshot on this branch's dev app (unhovered — the after-collapsed chevron is visible with no mouse over it). bun run lint and apps/desktop typecheck pass.

Note: #6010 attempted the same idea but was closed unmerged; the reporter never got a build with it.


Summary by cubic

Keep the Projects chevron visible when the section is collapsed in the desktop sidebar, so it’s clear the list is hidden and can be expanded. Fixes #6009 where an accidental header click collapsed Projects and it looked empty across reloads; expanded behavior is unchanged.