Skip to content

Collapse all button for projects sidebar#2308

Open
kyziq wants to merge 7 commits into
pingdotgg:mainfrom
kyziq:feat/sidebar-collapse-all-projects
Open

Collapse all button for projects sidebar#2308
kyziq wants to merge 7 commits into
pingdotgg:mainfrom
kyziq:feat/sidebar-collapse-all-projects

Conversation

@kyziq
Copy link
Copy Markdown

@kyziq kyziq commented Apr 23, 2026

What Changed

  • Added "Collapse all" button (ChevronsDownUpIcon) to the Projects section header, alongside the existing sort and add-project buttons
  • Button hidden when no projects exist
  • Button disabled (dimmed) when all projects are already collapsed — visual feedback that the action is a no-op
  • New pure function collapseAllProjects(state, projectIds[]) in uiStateStore — only targets currently visible projects, not stale state entries
  • No-op guard returns same state reference when nothing changes, preventing unnecessary re-renders
  • Three unit tests covering collapse behavior and no-op case

Why

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

Before After
Before After

No project

Will not show the button
CleanShot 2026-04-23 at 23 02 15@2x

Video

Zen.mp4

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

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 projects and Minimize all thread lists, and disables the trigger when both are already fully collapsed/minimized.

Introduces a uiStateStore action/pure function collapseAllProjects(state, projectIds) (with no-op state preservation) and wires it into Sidebar to 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

  • Adds a bulk actions menu to the projects sidebar header with two options: 'Collapse all projects' and 'Minimize all thread lists'.
  • Introduces collapseAllProjects in uiStateStore.ts as a pure reducer that sets all provided project IDs to collapsed.
  • The menu trigger is disabled when both all projects are already collapsed and all thread lists are minimized; individual menu items disable independently based on current state.

Macroscope summarized 9151a02.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ef62643e-7d45-4be1-b0f9-f644d14e62b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 23, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Apr 23, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 23, 2026

Approvability

Verdict: 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.

@juliusmarminge
Copy link
Copy Markdown
Member

what do you tihnk of making this 3 states:

  • minimize all - collapses every project down to the "show less" state
  • collapse all - collapses every project completely
  • disabled - when everything's collapsed

@kyziq
Copy link
Copy Markdown
Author

kyziq commented May 5, 2026

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?

@kyziq
Copy link
Copy Markdown
Author

kyziq commented May 5, 2026

prototyped the dropdown:

t3code-05052026.mp4
  • collapse-all enabled when any project is expanded
  • minimize-all enabled when any thread list is expanded
  • trigger enabled when either applies

happy either way. can revert to collapse-all only if you prefer minimal.

@macroscopeapp macroscopeapp Bot dismissed their stale review May 16, 2026 09:15

Dismissing prior approval to re-evaluate 9151a02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Collapse all projects button in sidebar

2 participants