fix(desktop): collapse the Cloud sidebar section's rows like every other section

Merged
KI
3mo ago
+12-7

Summary

  • Clicking the Cloud section header in the dashboard sidebar now hides its rows, the same way Pinned / Sessions / Projects do.

Why / Context

The Cloud header was already wired to the shared sidebar-sections-collapse store (it has a cloud key and the header toggled it), but DashboardSidebarCloudSection never read the flag back. So the chevron rotated and the state persisted while the five cloud rows stayed put.

How It Works

DashboardSidebarCloudSection subscribes to collapsed.cloud and skips rendering the rows while it's set, the exact gate DashboardSidebarPinnedSection and DashboardSidebarSessionsSection use. The collapsed-rail mode is untouched; no section has chrome there.

Manual QA (CDP, real dev app on this worktree, 5 cloud workspaces in the sidebar)

Before (pre-fix file checked out): click Cloud header → store cloud: true, chevron turned, 5 rows still in DOM, section 192px.

After:

  • Click Cloud header → 0 rows in DOM, section 32px (header only), chevron points right
  • Reload → stays collapsed (persisted store)
  • Click again → 5 rows back, 192px
  • 6 rapid toggles → ends expanded, console.error hook stayed empty

Testing

  • bun run typecheck (desktop)
  • biome check on the changed file

Summary by cubic

Collapse the Cloud sidebar section’s rows when its header is toggled, matching Pinned/Sessions/Projects. Previously the chevron rotated and the collapse state persisted, but the rows stayed visible; now they hide and restore on toggle.

  • Subscribes to useSidebarSectionsCollapseStore and gates rendering on collapsed.cloud, mirroring other sections.
  • No changes to collapsed-rail mode; only affects the expanded sidebar.

Summary by CodeRabbit

  • Bug Fixes
    • Cloud workspace entries in the dashboard sidebar now correctly hide when the cloud section is collapsed.
    • Existing workspace data and filtering behavior remain unchanged.