Repository navigation
fix(desktop): solve #6009 — expanded sidebar Projects section silently collapsed with no visible chevron - #6010
github-actions[bot] wants to merge 1 commit into
Conversation
The projects-list collapse state is persisted, so a stray click on the Projects header row leaves the expanded sidebar showing only the section label and the add button over an empty list. The chevron was faded out until hover, so nothing on screen said the list was collapsed and a reload could not clear it. Refs #6009
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit 56be667 on Jul 28, 2026 3:56am UTC. |
|
Closing: does not fix the reported problem. The reporter tested it and said so directly in #6009 (comment). The store this patches has only two consumers, both mounted behind #6009 stays open (tracked as SUPER-1674, now Medium). The v2 half belongs to the sidebar state-loss work (#6089, #6109); the v1 half still needs OS/app version from the reporter. |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
What the bug is
The expanded sidebar renders the
PROJECTSheader and the add-project (+) button with no project rows underneath, while the collapsed icon rail shows every project. Cmd+R doesn't clear it, and the only way to see the projects again is to collapse the sidebar back down.Root cause
DashboardSidebargates both the pinned section and every project group on one flag:workspacesListCollapsedcomes fromrenderer/stores/sidebar-workspaces-collapse, which is used in exactly two places: this gate andDashboardSidebarWorkspacesHeader. Both the rail and the expanded list render the sameorderedGroups, so this gate is the only difference between the two views — a blank expanded Projects section means the flag istrue, and nothing else in the codebase can set it.Three things turn that state into a sidebar that reads as broken:
DashboardSidebarWorkspacesHeaderis a full-widthrole="button"(including the flex spacer next to the+button) with anonClickand an Enter/SpaceonKeyDown, so one stray click or a Space press while the row has focus empties the list.opacity-0untilgroup-hover/group-focus-visible, so a collapsed section looked identical to an empty one — no cue, and no hint that clicking the header restores it.persist), so a reload can't clear it, and the rail ignores the flag entirely, so collapse → expand round-trips right back to the empty view.The macOS App Management grant is coincidental — nothing in
apps/desktoporpackages/host-servicereads that permission, and no code path other than the header toggle writes this store.The fix
DashboardSidebarWorkspacesHeadernow keeps the chevron atopacity-100while the list is collapsed (hover-fade is retained only in the expanded state, where the rows already show the state) and exposesaria-expanded. The collapsed section is now self-explanatory and one click from restored.Tests
New
DashboardSidebarWorkspacesHeader.test.tsx(bun test,renderToStaticMarkup— matching the existingStepProgress.test.tsxpattern):opacity-0/hover-gated — failed before the fix, passes nowaria-expanded="false"when collapsed — the attribute was absent beforebun testinapps/desktop: 2282 pass, 0 fail. Zustand feedsgetInitialState()touseSyncExternalStoreduring SSR, so the test stands the store in with a plain selector to render both disclosure states — noted in a comment.Not fixed here (deliberately out of scope)
The accidental-toggle surface itself: the full-width row hit area (spacer included) and the Space-key handler are the likely trigger, and narrowing the toggle to the label + chevron is a UX call I'd rather leave to a maintainer. Left as-is too: the collapsed rail ignores the flag, which is what makes the reporter's collapse/expand workaround only temporary — but making the rail honor it would hide the project icons entirely, the very symptom they reported on v2.
Refs #6009
Summary by cubic
Fixes the empty Projects section in the expanded sidebar by keeping the chevron visible when collapsed and exposing the state via aria attributes. Fixes #6009.
opacity-100while collapsed; retain hover fade only when expanded; rotation unchanged.aria-expandedto the header for clear state and accessibility.aria-expandedbehavior; ensure expanded hover/rotation still works.Written for commit 56be667. Summary will update on new commits.