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)
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: Needs human review This PR introduces a new user-facing feature (collapse all menu and alt-click shortcut) rather than a simple fix or refactor. Additionally, there's an unresolved review comment identifying a bug in the alt-click behavior where clicks become no-ops when all projects are already collapsed. 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
Dismissing prior approval to re-evaluate b85ccb3
| if (event.altKey) { | ||
| collapseAllProjects(); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Alt-click blocks project toggle
Medium Severity
When a project header is clicked with Alt held, the handler always calls collapseAllProjects() and returns without running toggleProject. If every visible project is already collapsed, collapseAllProjects is a no-op, so the click does nothing—unlike a normal click, which would expand that project.
Reviewed by Cursor Bugbot for commit b85ccb3. Configure here.
There was a problem hiding this comment.
intentional, the Alt+click is strictly a collapse-all shortcut, not a toggle
Port collapse-all shortcut from PR pingdotgg#2307 per maintainer request. Co-authored-by: Bas Milius <978257+basmilius@users.noreply.github.com>
b85ccb3 to
490c08b
Compare
| () => sortedProjects.every((p) => (projectExpandedById[p.projectKey] ?? true) === false), | ||
| [sortedProjects, projectExpandedById], | ||
| ); | ||
| const allThreadListsMinimized = expandedThreadListsByProject.size === 0; |
There was a problem hiding this comment.
Wrong minimize-all disabled check
Low Severity
allThreadListsMinimized is defined as an empty expandedThreadListsByProject set, but that set can still contain keys when no sidebar row shows “Show less” (for example after raising sidebarThreadPreviewCount, archiving threads, or removing a grouped project). The bulk menu and “Minimize all thread lists” then stay enabled even though no visible thread list is expanded.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 490c08b. Configure here.
There was a problem hiding this comment.
pre-existing, not part of this change


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
Sidebar-only UI and persisted expand/collapse preferences; no auth, API, or data-model changes beyond local UI state.
Overview
Adds bulk collapse controls to the Projects sidebar header when at least one project is visible.
A new ChevronsDownUp menu offers Collapse all projects (persisted via
collapseAllProjectsinuiStateStorefor currently sorted/visible project keys) and Minimize all thread lists (clears localexpandedThreadListsByProject). The trigger and individual items disable when there is nothing left to collapse.Alt+click on a project header now collapses all projects instead of toggling that row only.
collapseAllProjectsis a pure store helper with a no-op when every listed project is already collapsed, plus unit tests for partial and full no-op behavior.Reviewed by Cursor Bugbot for commit b1e7671. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add collapse-all button to projects sidebar
projectExpandedByIdandexpandedThreadListsByProjectin the UI store.collapseAllProjectsaction to uiStateStore.ts that sets specified project IDs to collapsed, returning the original state unchanged if there is nothing to update.Macroscope summarized b1e7671.