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 simple UI convenience feature (collapse all projects button) with proper unit tests. The implementation follows existing patterns in the codebase and is fully additive without modifying existing behavior. 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. |
Dismissing prior approval to re-evaluate 9151a02
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 sidebar expand/collapse behavior; main risk is unintended collapsed state if the wrong project keys are passed to the new bulk action.
Overview
Adds a new bulk collapse menu to the sidebar Projects header (hidden when there are no projects) with actions to
Collapse all projectsandMinimize all thread lists, and disables the trigger when both are already fully collapsed/minimized.Introduces a
uiStateStoreaction/pure functioncollapseAllProjects(state, projectIds)(with no-op state preservation) and wires it intoSidebarto collapse only the currently visible/ordered project groups; adds unit tests covering the bulk-collapse behavior and no-op case.Reviewed by Cursor Bugbot for commit 9151a02. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add collapse all button to projects sidebar
collapseAllProjectsin uiStateStore.ts as a pure reducer that sets all provided project IDs to collapsed.Macroscope summarized 9151a02.