Collapse all button for projects sidebar#2308
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved This PR adds a straightforward 'Collapse all' button for the projects sidebar with corresponding state management and unit tests. The changes are purely additive UI functionality with no backend or security implications. You can customize Macroscope's approvability policy. Learn more. |
|
what do you tihnk of making this 3 states:
|
|
thanks for your reply julius! looked at vscode, jetbrains, github. all have collapse-all only, no minimize. so my first thought was to keep it simple. but you have a point, minimize-all is actually useful here since projects can hold many threads with overflow, lets you reset it without losing your place If we want both, I think a dropdown trigger (single header slot) feels cleaner than two adjacent buttons or one single button that does all. what do you think? |
|
prototyped the dropdown: t3code-05052026.mp4
happy either way. can revert to collapse-all only if you prefer minimal. |
What Changed
ChevronsDownUpIcon) to the Projects section header, alongside the existing sort and add-project buttonscollapseAllProjects(state, projectIds[])inuiStateStore— only targets currently visible projects, not stale state entriesWhy
With multiple projects open in the sidebar, collapsing each one individually is tedious. This adds a single-click way to reset the sidebar to a clean state.
UI Changes
Screenshots
No project
Will not show the button

Video
Zen.mp4
Checklist
Closes #2306
Note
Low Risk
Low risk UI/state change limited to toggling
projectExpandedByIdfor visible sidebar projects; main risk is minor UX/state regressions around grouped project keys or expansion defaults.Overview
Adds a “Collapse all” control to the Projects sidebar header that collapses every currently listed project, hides itself when there are no projects, and disables itself when everything is already collapsed.
Introduces a
collapseAllProjectsaction inuiStateStore(with a no-op return when state is unchanged) and wires it throughSidebar.tsx, along with unit tests covering the collapse, non-target, and no-op cases.Reviewed by Cursor Bugbot for commit 82362d4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
[!NOTE]
Add 'Collapse all' button to the projects sidebar
collapseAllProjectsaction to uiStateStore.ts that sets all specified project IDs to collapsed in a single operation, no-op if nothing changes.Macroscope summarized 82362d4.