Skip to content

fix(sidebar): reveal collapsed workspaces without clearing filters - #19398

Merged
nwparker merged 1 commit into
mainfrom
nwparker/reveal-bug
Sep 8, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/reveal-bug

Conversation

@nwparker

@nwparker nwparker commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​80 $\color{#cf222e}{\Huge{\mathbf{−}}}$​36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 $\color{#cf222e}{\Huge{\mathbf{−}}}$​11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​24

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:
Before

After (workspace revealed, filter badge retained):
After

Testing

  • macOS background Electron reproduction and rendered before/after validation; actual filter exclusion still confirms, clears, and reveals.
  • 25 targeted tests passed: reveal requests, folder reveal, card memo stability, and lineage child rendering. Regression cases failed before the fix.
  • Renderer typecheck, targeted oxlint, formatting, and diff checks passed.
  • SSH host isolation and folder cases covered in unit tests; live SSH, Windows, and Linux were not exercised.

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

  • Not applicable.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 6ff45bcd-9d1d-480f-96a0-a9be587ea41d

📥 Commits

Reviewing files that changed from the base of the PR and between 9f04403 and 1f0026e.

📒 Files selected for processing (3)
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/worktree-list/navigation/use-reveal-requests.test.tsx
  • src/renderer/src/components/sidebar/worktree-list/navigation/use-reveal-requests.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The 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 1f002

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)

Check name Status Explanation Resolution
Description check ⚠️ Warning 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… Add a valid issue reference after “Fixes #”. Include the Notes section and complete the required Checklist items, or explain any exceptions.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: revealing collapsed workspaces without clearing sidebar filters.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

  • workspacePassesFilters helper — a new module-level predicate in use-reveal-requests.ts that matches the active worktree's host-qualified identity against the visible worktrees, or matches a folder workspace by folderWorkspaceKey, preserving host isolation and folder-workspace support.
  • Arg swap in WorktreeList.tsx — useSidebarRevealRequests now receives visibleWorktrees and visibleScope.visibleFolderWorkspacesForRows instead of selection.renderedWorktreeIdentities.
  • Stale-confirmation recheck — the post-confirm() re-evaluation now reuses the same workspacePassesFilters against latestArgs, 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker merged commit 5882400 into main Sep 8, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant