Skip to content

fix(desktop): solve #6009 — expanded sidebar Projects section silently collapsed with no visible chevron - #6010

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
triage/issue-6009-30326940459
Closed

github-actions[bot] wants to merge 1 commit into
mainfrom
triage/issue-6009-30326940459

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

What the bug is

The expanded sidebar renders the PROJECTS header 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

DashboardSidebar gates both the pinned section and every project group on one flag:

// DashboardSidebar.tsx:213,220
{(isCollapsed || !workspacesListCollapsed) && ( ... )}

workspacesListCollapsed comes from renderer/stores/sidebar-workspaces-collapse, which is used in exactly two places: this gate and DashboardSidebarWorkspacesHeader. Both the rail and the expanded list render the same orderedGroups, so this gate is the only difference between the two views — a blank expanded Projects section means the flag is true, and nothing else in the codebase can set it.

Three things turn that state into a sidebar that reads as broken:

  1. The whole header row is the toggle. DashboardSidebarWorkspacesHeader is a full-width role="button" (including the flex spacer next to the + button) with an onClick and an Enter/Space onKeyDown, so one stray click or a Space press while the row has focus empties the list.
  2. The state was invisible. The chevron was opacity-0 until group-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.
  3. It's persisted (zustand 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/desktop or packages/host-service reads that permission, and no code path other than the header toggle writes this store.

The fix

DashboardSidebarWorkspacesHeader now keeps the chevron at opacity-100 while the list is collapsed (hover-fade is retained only in the expanded state, where the rows already show the state) and exposes aria-expanded. The collapsed section is now self-explanatory and one click from restored.

Tests

New DashboardSidebarWorkspacesHeader.test.tsx (bun test, renderToStaticMarkup — matching the existing StepProgress.test.tsx pattern):

  • reproduction: with the list collapsed, the chevron class list must not be opacity-0/hover-gated — failed before the fix, passes now
  • reproduction: the header must report aria-expanded="false" when collapsed — the attribute was absent before
  • guard: the expanded state still fades the chevron in on hover and rotates it

bun test in apps/desktop: 2282 pass, 0 fail. Zustand feeds getInitialState() to useSyncExternalStore during 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


Open in Stage

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.

  • Bug Fixes
    • Keep the Projects chevron opacity-100 while collapsed; retain hover fade only when expanded; rotation unchanged.
    • Add aria-expanded to the header for clear state and accessibility.
    • Add tests to verify chevron visibility when collapsed and aria-expanded behavior; ensure expanded hover/rotation still works.

Written for commit 56be667. Summary will update on new commits.

Review in cubic

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
@github-actions github-actions Bot changed the title fix: solve #6009 — expanded sidebar Projects section silently collapsed with no visible chevron fix(desktop): solve #6009 — expanded sidebar Projects section silently collapsed with no visible chevron Jul 28, 2026
@ghost

ghost commented Jul 28, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 2 individual chapters for you:

Title
1 Improve visibility and accessibility of Projects disclosure
2 Verify Projects header disclosure state and visibility
Open in Stage

Chapters generated by Stage for commit 56be667 on Jul 28, 2026 3:56am UTC.

@Kitenite

Kitenite commented Aug 1, 2026

Copy link
Copy Markdown
Member

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 isV2CloudEnabled, and the report specifies the v2 sidebar toggle was off — so the change cannot affect the reported configuration. The one non-deliberate trigger for the collapsed state was already fixed by #6000, which this branch is built on top of.

#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.

@Kitenite Kitenite closed this Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

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.

[bug] Expanded sidebar shows empty Projects section

1 participant