Add a collapse-idle action to the sidebar#1210
Add a collapse-idle action to the sidebar#1210ponbac wants to merge 2 commits intopingdotgg:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1831722e98
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
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 |
faa7eed to
b3123eb
Compare
|
nice touch , hope they merge |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| const isActive = routeThreadId === thread.id; | ||
| const isSelected = selectedThreadIds.has(thread.id); | ||
| const isHighlighted = isActive || isSelected; | ||
| const threadStatus = resolveThreadStatusPill({ |
There was a problem hiding this comment.
Redundant recomputation of thread status in render loop
Low Severity
The new threadStatusById useMemo at line 348 already computes resolveThreadStatusPill (including derivePendingApprovals and derivePendingUserInputs) for every thread. However, the resolveProjectStatusIndicator call inside the projects.map() render loop still recomputes the same values from scratch per thread. This call site could simply read from threadStatusById (e.g., projectThreads.map(t => threadStatusById.get(t.id) ?? null)) instead of duplicating the work.


What Changed
Collapse idle projectsaction to the sidebar header.Why
The sidebar can accumulate a lot of expanded projects during normal use. This adds a one-click cleanup path without collapsing the project you are currently in or other projects that still have visible thread activity.
UI Changes
Video:
screenrecording-2026-03-19_16-33-08.mp4
Sorry that the mouse cursor is not visible in the recording.
Screenshot:
Added this tiny icon. Open for suggestions on a more fitting icon.
Checklist
Note
Add 'Collapse idle projects' button to the sidebar
FoldVerticalIconbutton to the projects header that collapses all expanded projects with no active thread status, no running terminals, and that are not the active project.collectSidebarNonIdleProjectIdsin Sidebar.logic.ts to compute the set of non-idle project IDs from thread status, running terminals, and the active project.Macroscope summarized 3480f72.
Note
Low Risk
Low risk UI/state change: adds a new sidebar action that programmatically toggles project expansion based on computed thread/terminal activity, with minimal impact outside the sidebar.
Overview
Adds a “Collapse idle projects” control to the sidebar Projects header, collapsing any expanded projects that are neither the current active project nor associated with threads that have a visible status pill or a running terminal.
Introduces
collectSidebarNonIdleProjectIds(with new unit tests) and refactors sidebar rendering to memoizethreadStatusByIdandrunningTerminalThreadIds, reusing those computed results both for the collapse behavior and per-thread indicators.Written by Cursor Bugbot for commit 3480f72. This will update automatically on new commits. Configure here.