Repository navigation
fix(sidebar): reveal collapsed workspaces without clearing filters - #19398
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe sidebar reveal flow now uses visible worktrees and folder workspaces instead of rendered worktree identities. Visibility checks use host-qualified worktree identities and folder workspace keys before and after confirmation. Tests cover collapsed workspaces, execution hosts, same-id workspaces on different hosts, changing visibility during confirmation, and folder-workspace rename flows. Merge Risk: ⚪ Minimal · up to Sidebar reveal now expands collapsed workspaces that already pass filters while retaining filters, and requests confirmation only for filtered-out workspaces. The covered behavior is ready to merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the change, rationale, visual behavior, testing, and review details. However, it does not provide the required linked issue, and it omits the Notes and Checklist sections from the repository template.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This PR fixes the "reveal active workspace" flow so a workspace hidden only by a collapsed group is revealed directly instead of prompting to clear filters. The reveal decision now reads the pre-collapse filter results rather than the post-collapse rendered rows.
workspacePassesFiltershelper — a new module-level predicate inuse-reveal-requests.tsthat matches the active worktree's host-qualified identity against the visible worktrees, or matches a folder workspace byfolderWorkspaceKey, preserving host isolation and folder-workspace support.- Arg swap in
WorktreeList.tsx—useSidebarRevealRequestsnow receivesvisibleWorktreesandvisibleScope.visibleFolderWorkspacesForRowsinstead ofselection.renderedWorktreeIdentities. - Stale-confirmation recheck — the post-
confirm()re-evaluation now reuses the sameworkspacePassesFiltersagainstlatestArgs, so a target that becomes included while the dialog is open no longer clears filters. - Regression tests — covers collapsed-but-filter-passing worktrees (both host and null host), same-id worktree on another host, folder workspaces (filtered and not), and the confirmation-race cases.
Verified visibleWorktrees (via computeVisibleWorktrees) correctly includes injected lineage ancestors and forced-visible worktrees, which are all rendered, so treating them as passing filters is sound. Folder workspaces are only filtered by host scope and other-devices — both reflected in visibleFolderWorkspacesForRows — and archived active workspaces early-return before the check. Tests pass (11/11) and the changed files lint clean.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

ELI5
Reveal active workspace incorrectly asked to clear sidebar filters when the workspace was merely inside a collapsed project. It now expands and reveals the workspace while preserving those filters.
What Changed / Why
Check the existing sidebar filter results before group collapse, instead of using the rendered row list. Compare the resolved worktree's host-qualified identity and include the folder workspace filter results. Workspaces actually excluded by filters still require confirmation.
Linked Issue
User-reported screenshot and reproduction; no separate issue.
Visual Proof
Reproduced on a freshly created worktree with Hide default branch enabled and its project collapsed. Clicked the actual Reveal active workspace button in a background Electron instance via Playwright CDP.
Before:

After (workspace revealed, filter badge retained):

Testing
Review
Self-reviewed the filter/collapse distinction, host identity matching, folder support, and confirmation state changes. Reuses the existing filter pipeline and reveal action; no execution or wire protocol changes.
Agent skill upstream boundary