Skip to content

Keep sidebar section collapse independent across execution hosts - #25944

Merged
nwparker merged 3 commits into
mainfrom
nwparker/sidebar-host-section-collapse
Oct 6, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/sidebar-host-section-collapse

Conversation

@nwparker

@nwparker nwparker commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​540 $\color{#cf222e}{\Huge{\mathbf{−}}}$​219 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​321
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​108 $\color{#cf222e}{\Huge{\mathbf{−}}}$​71 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37

ELI5

Revealing a remote workspace should open its section while leaving the local section as you set it.

What Changed

All, workspace-status, and review sections previously reused one saved collapse key across hosts. They now use the host-specific collapse mechanism already used by Pinned. Rows are split by host before applying collapse; clicks, normal Reveal, folder-workspace Reveal, and the send picker use the same section keys. The default combined view keeps its single shared section.

A separate test-only commit repairs a readiness race found by CI on main: the source-control cancellation fixture now publishes its PID after installing its signal handler. Cancellation could previously land between those steps, killing the fixture before it could write its shutdown marker. Production shutdown behavior and the assertions are unchanged.

Why

The cause is shared section ownership, so expanding and then restoring local state would leave clicks and other reveal paths inconsistent. Generalizing the existing Pinned mechanism fixes those paths together and hides every row within a collapsed section, including folder workspaces.

Linked Issue

Internal follow-up to #25836. First behavior PR in the sidebar fix stack; based on main with its CI repairs already merged (#25933 and #25949).

Visual Proof

Workspace-status example: same real Reveal button, selected remote workspace, and initial collapsed sections on both builds. All and review status use the same host-owned section mechanism and have matching rendered regression coverage. Before: local rows expand too. After: only the remote section opens.

Grouping Before fix After fix
Workspace status Status before Status after

Testing

  • Rendered in isolated hidden Electron windows on macOS: all 16 Pinned/All/status/review cases passed, then passed again on the final stack for SSH and paired hosts, with both expanded and collapsed hosts, plus 3 existing Reveal tests.
  • Initial sidebar verification: 2,880 passed, plus 12 focused Reveal tests after adding combined-view controls. Final stack verification on updated main: 330 files and 2,896 tests pass, including the picker PR. Folder-workspace coverage verifies independent collapse and matching reveal keys.
  • Full pnpm tc, changed-file lint, and changed-code quality gate passed on the updated main base.
  • CI readiness repair: all 9 source-control process tests pass, and the real cancellation test passes 10 consecutive runs.
  • Before-fix builds fail the local-section regression in all three groupings.
  • Remote catalogs and connection status are seeded; this verifies the actual rendered sidebar, not a live SSH or paired connection. CI checks Linux rendering and Windows packaging.

Review

Local legacy keys, combined grouping, project/lineage collapse, pinned policy, and row identities are preserved. No wire format, production process control, paths, shortcuts, or styling changed.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Checklist

  • Focused change; cause, mechanism, and choice explained.
  • Before/after rendered proof attached.
  • Self-reviewed, including folder workspaces, remote hosts, and combined views.
  • Local typecheck, lint, tests, and e2e build passed; remaining platform checks run in CI.

@nwparker
nwparker force-pushed the nwparker/sidebar-host-section-collapse branch from 318619d to d72a40d Compare October 6, 2026 19:29
@nwparker
nwparker requested a review from brennanb2025 as a code owner October 6, 2026 19:29
@nwparker
nwparker changed the base branch from nwparker/main-ci-chat-test-contracts to main October 6, 2026 19:29
@nwparker nwparker closed this Oct 6, 2026
@nwparker nwparker reopened this Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 612443ff-9577-4dce-9329-c2443ae3834e
📥 Commits

Reviewing files that changed from the base of the PR and between 4c35516 and d72a40d.

📒 Files selected for processing (13)
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/host-pinned-sections.test.ts
  • src/renderer/src/components/sidebar/host-pinned-sections.ts
  • src/renderer/src/components/sidebar/host-section-collapse-folders.test.ts
  • src/renderer/src/components/sidebar/host-section-collapse.test.ts
  • src/renderer/src/components/sidebar/host-section-collapse.ts
  • src/renderer/src/components/sidebar/host-section-reveal.test.tsx
  • src/renderer/src/components/sidebar/worktree-list/listing/use-collapsed-groups.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.ts
  • src/renderer/src/components/sidebar/worktree-list/navigation/folder-reveal.ts
  • src/renderer/src/components/sidebar/worktree-list/navigation/pending-reveal-inputs.ts
  • tests/e2e/worktree-reveal-host-pinned.spec.ts
  • tests/e2e/worktree-reveal-host-sections.spec.ts
💤 Files with no reviewable changes (3)
  • tests/e2e/worktree-reveal-host-pinned.spec.ts
  • src/renderer/src/components/sidebar/host-pinned-sections.ts
  • src/renderer/src/components/sidebar/host-pinned-sections.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The sidebar now scopes collapse keys for pinned and regular worktree sections by execution host. Folder-workspace and worktree reveal logic uses host-qualified keys when host-scoped groups are active. New unit and end-to-end tests cover collapse and reveal behavior across host types and grouping modes.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to d72a4

Remote section toggles retain their independent collapse state. No identified issue blocks merging after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: independent sidebar section collapse across execution hosts.
Description check ✅ Passed The description covers the user impact, implementation, rationale, linked follow-up, visual proof, testing, and review notes. The AI Disclosure section may be omitted for internal contributors under t…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

❤️ Share

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

@nwparker
nwparker merged commit 6a71732 into main Oct 6, 2026
36 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