You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(sidebar): add a bindable collapse / expand all projects command - #37718
With many projects in the sidebar, you had to click each arrow to fold them. Now one shortcut folds them all, or unfolds them all.
What Changed
New command sidebar.projects.toggleCollapseAll, "Collapse / Expand All Projects", listed under Global in Settings → Keyboard Shortcuts. No default binding.
If any visible project or project-group header is expanded, it collapses all. Otherwise it expands all and opens the sidebar.
Each header goes through toggleCollapsedGroup, the same action as the chevron click, so persistence and sync behave the same.
Works from the terminal under "Orca first", like sidebar.left.toggle. Yields while a modal, overlay, or the floating workspace has focus.
project-collapse-all-target.ts works out which header keys to flip from the rendered sidebar rows. Pinned and host sections are left alone.
The child-workspaces toggle handler moved into sidebar-group-collapse-shortcuts.ts next to the new handler, to keep app-command-handlers.ts under the max-lines limit. No behavior change there.
Why
No existing command changes group collapse state; only the chevron click does.
Reusing the chevron action avoids a second write path for collapsedGroups.
Taken from the real Electron app (Windows, electron-vite build --mode e2e) driven by a throwaway Playwright script, before = main at 312ce09.
Before (main): no command exists; each project only folds from its own chevron.
After: the command in Settings → Shortcuts, bound here to Ctrl+Alt+K for the demo (unbound by default).
After: one press of the shortcut folds every project. Pressing it again expands them all.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New app-command-handlers-project-collapse-all.test.ts (5 tests against the real store) and an unbound/terminal-match case in keybindings-unassigned-actions.test.ts.
vitest over app-shell: all pass except 2 in worktree-creation-chat-handoff.test.tsx, which fail the same way on clean main.
Full typecheck: pass. oxlint and oxfmt --check on changed files: pass.
Tested on Windows only.
Risk
Level: Low
Only acts when the sidebar is grouped by project. In status or PR grouping the key passes through.
Toggles each header separately, so N projects means N UI-state writes in one tick.
Non-English locale strings are machine-translated.
Back out: plain revert. Users who bound the command lose the binding.
AI Disclosure
Written with Claude Code (Claude Opus 5.5). I reviewed the diff and the test results.
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
Adds the sidebar.projects.toggleCollapseAll global keybinding action with no default platform binding and localized labels. The shortcut resolves eligible project groups, then collapses all when any eligible group is expanded or expands them when none are expanded. Shared shortcut handlers check modal, focus, overlay, and menu conditions and toggle group state. The command handler also delegates child-workspace toggling to the shared handlers. Tests cover toggle behavior, shortcut yielding, persisted state, and terminal notification.
Severity of issue fixed: Medium
Merge Risk: Low · up to 59dca
The shortcut can skip placeholder-only groups or choose the wrong direction. Manual controls remain available; this is suitable for a bounded follow-up.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: adding a bindable command to collapse or expand all sidebar projects.
Linked Issues check
Issue #37485 requires a bindable global command for the project-chevron action. The PR adds sidebar.projects.toggleCollapseAll under the Global scope with no default binding. `resolveProjectCollapse…
Out of Scope Changes check
The changes stay within issue #37485. Command metadata, localization, shortcut dispatch, target resolution, and automated tests implement the requested command. The child-workspaces handler move is a …
Description check
The description is mostly complete. It explains the change, links an issue, provides visual proof, and describes testing and risk. Testing lacks reproducible steps and does not confirm that each added…
Full details: Linked Issues check
Explanation
Issue #37485 requires a bindable global command for the project-chevron action. The PR adds sidebar.projects.toggleCollapseAll under the Global scope with no default binding. resolveProjectCollapseAllToggleKeys selects rendered project and project-group headers, collapses all when any selected header is expanded, and otherwise expands them. toggleSidebarGroups calls store.toggleCollapsedGroup for each key, which reuses the chevron action. The handler supports terminal use through the global keybinding path and yields for modal, overlay, floating-workspace, and owning-menu focus. The added tests cover the collapse, expand, visibility, grouping, and terminal cases.
Full details: Out of Scope Changes check
Explanation
The changes stay within issue #37485. Command metadata, localization, shortcut dispatch, target resolution, and automated tests implement the requested command. The child-workspaces handler move is a supporting refactor. Its behavior remains in the shared sidebar shortcut handler, with the existing gating, group toggle, sidebar opening, and scroll-anchor logic preserved. No unrelated functional change is shown.
Full details: Description check
Explanation
The description is mostly complete. It explains the change, links an issue, provides visual proof, and describes testing and risk. Testing lacks reproducible steps and does not confirm that each added test fails without the change.
Full details: Docstring Coverage
Explanation
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 9 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Adds sidebar.projects.toggleCollapseAll, listed under Global with no
default binding. If any visible project header is expanded it collapses
every project and project-group header; otherwise it expands them all.
It only claims the chord when the sidebar is grouped by project.
Each header flips through toggleCollapsedGroup, the chevron's own action.
The child-workspaces toggle now shares the same guard and toggle code.
Closesstablyai#37485
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Files skipped from review as they are similar to previous changes: 11
src/renderer/src/i18n/locales/de.json
src/renderer/src/i18n/locales/en.json
src/renderer/src/i18n/locales/pt.json
src/renderer/src/i18n/locales/ko.json
src/renderer/src/i18n/locales/tr.json
src/renderer/src/i18n/locales/zh-Hant.json
src/renderer/src/i18n/locales/zh.json
src/renderer/src/i18n/locales/fr.json
src/renderer/src/i18n/locales/es.json
src/renderer/src/i18n/locales/ja.json
src/renderer/src/i18n/locales/ru.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The key pass for collapse / expand all cleared every collapsed group,
host sections included. It could then flip projects hidden under a
collapsed host. Only project and project-group keys are cleared now.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
A collapsed project group shows a global header. Expanding it for the
second planning pass can move that header under a collapsed host, where
it drops out, so expand-all left the visible group collapsed. The target
set now also keeps the keys from the currently visible headers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Include placeholder repos in the target rows. · project-collapse-all-target.ts:17
src/renderer/src/components/sidebar/worktree-list/listing/project-collapse-all-target.ts:17 Minor · Functional Correctness · Quick win
Include placeholder repos in the target rows.
useSidebarSectionRows includes placeholder repos, but computeRenderedSidebarRows omits them. A project group containing only a repo with no visible worktrees therefore has a chevron in the sidebar but a count of zero here. The shortcut ignores that group and can choose the wrong toggle direction. Build target rows with the sidebar’s placeholder inputs. (raw.githubusercontent.com)
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 9dc3b9b7-9027-46d0-8280-e78111374ba8
Commits
Reviewing files that changed from the base of the PR and between df824f7 and 59dca58.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
The sidebar builds rows with empty-project placeholders, so a project
group whose projects have no workspaces still gets a chevron. The
collapse-all target rows left them out, gave that group a count of 0,
and skipped it. computeRenderedSidebarRows now takes an opt-in
includeEmptyProjects flag, and the collapse-all target uses it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai Fixed the outside-diff finding (project-collapse-all-target.ts:17, placeholder repos) in e2ce55e.
computeRenderedSidebarRows takes an opt-in includeEmptyProjects flag. It builds the same empty-project placeholders as useSidebarSectionRows (host-filtered repos, getEmptyProjectPlaceholderRepoIds).
The collapse-all target uses it, so a project group with only empty projects counts and is toggled.
The other caller (child-workspace toggle) reads item rows only and keeps the default.
Regression test collapses a project group whose only project has no workspaces fails without the fix. Typecheck, oxlint, oxfmt, and the sidebar + app-shell suites pass.
For best results, initiate chat on the files or code changes.
Analysis chain
Script executed:
#!/bin/bashset -euo pipefail
fd -t f '^project-collapse-all-target\.ts$' --exec ast-grep outline {}
fd -t f '^project-collapse-all-target\.ts$' --exec sed -n '1,180p' {}
rg -n -C 10 --type ts --type tsx 'includeEmptyProjects|collapses a project group whose only project has no workspaces' src/renderer/src
Length of output: 3263
Script executed:
#!/bin/bashset -euo pipefail
fd -t f '^rendered-sidebar-worktree-order\.ts$' --exec ast-grep outline {}
fd -t f '^rendered-sidebar-worktree-order\.ts$' --exec sed -n '1,250p' {}
rg -n -C 22 -g '*.ts' -g '*.tsx''collapses a project group whose only project has no workspaces' src/renderer/src
rg -n -C 5 -g '*.ts' -g '*.tsx''getEmptyProjectPlaceholderRepoIds|computeRenderedSidebarRows\(' src/renderer/src/components/sidebar
Length of output: 41838
@Mahdi-Hasan Thanks for the fix. Source inspection confirms that collapse-all now includes empty-project placeholders from host-filtered repos. The child-workspace toggle retains the default behavior.
The regression test covers the reported case and asserts that the project group collapses. This addresses the placeholder-repo finding. I did not rerun the checks; the passing results are from your report.
Learnings used
Learnt from: Jinwoo-H
Repo: stablyai/orca PR: 28997
File: mobile/src/host-screen/workspace-option-controls.tsx:0-0
Timestamp: 2026-10-15T22:17:27.950Z
Learning: In this TypeScript/React codebase, `src/renderer/src/components/sidebar/worktree-card-option-items.tsx` selects “Branch / folder path” when `projectGroups.length > 0`, independently of the Group by choice. The phone does not receive the project group list. A host lists folder workspaces only under project groups, so `mobile/src/host-screen/workspace-option-controls.tsx` can use the presence of any folder workspace row as a proxy. This proxy cannot detect project groups that contain no folder workspaces.
If you found this review helpful, would you consider giving us a shout-out on X?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
With many projects in the sidebar, you had to click each arrow to fold them. Now one shortcut folds them all, or unfolds them all.
What Changed
sidebar.projects.toggleCollapseAll, "Collapse / Expand All Projects", listed under Global in Settings → Keyboard Shortcuts. No default binding.toggleCollapsedGroup, the same action as the chevron click, so persistence and sync behave the same.sidebar.left.toggle. Yields while a modal, overlay, or the floating workspace has focus.project-collapse-all-target.tsworks out which header keys to flip from the rendered sidebar rows. Pinned and host sections are left alone.sidebar-group-collapse-shortcuts.tsnext to the new handler, to keepapp-command-handlers.tsunder the max-lines limit. No behavior change there.Why
collapsedGroups.Linked Issue
Fixes #37485
Visual Proof
Taken from the real Electron app (Windows,
electron-vite build --mode e2e) driven by a throwaway Playwright script, before =mainat 312ce09.Before (
main): no command exists; each project only folds from its own chevron.After: the command in Settings → Shortcuts, bound here to Ctrl+Alt+K for the demo (unbound by default).
After: one press of the shortcut folds every project. Pressing it again expands them all.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New
app-command-handlers-project-collapse-all.test.ts(5 tests against the real store) and an unbound/terminal-match case inkeybindings-unassigned-actions.test.ts.vitestoverapp-shell: all pass except 2 inworktree-creation-chat-handoff.test.tsx, which fail the same way on cleanmain.Full typecheck: pass.
oxlintandoxfmt --checkon changed files: pass.Tested on Windows only.
Risk
Level: Low
AI Disclosure
Written with Claude Code (Claude Opus 5.5). I reviewed the diff and the test results.
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)