Skip to content

Close worktree ready notification when its workspace opens - #28238

Merged
nwparker merged 4 commits into
mainfrom
nwparker/wt-ready-dialog
Oct 13, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/wt-ready-dialog

Conversation

@nwparker

@nwparker nwparker commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​271 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​261
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​55 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​50

ELI5

Opening a newly created worktree now closes its “is ready” notification automatically.

What Changed

Previously, selecting the worktree in the sidebar left the persistent notification covering the screen. The notification now watches the existing navigation state and dismisses itself once its workspace is displayed on the host that created it. Dismissal rechecks the settled state so an intermediate switch from Tasks cannot close the wrong notification. Notifications for other workspaces remain available. Closing the notification or using its button releases the listener, and a late notification is skipped when the workspace is already open.

Why

Once you have opened the worktree, the notification has done its job. Watching the existing navigation state covers every route into the workspace without adding dismissal logic to each navigation control. It preserves the persistent reminder while you are elsewhere.

Linked Issue

Requested directly by a maintainer; no linked issue.

Visual Proof

Captured from this worktree's hidden Electron renderer through Playwright CDP on macOS. Both screenshots show the same worktree after selecting it in the sidebar. The ready notification was invoked directly to reproduce a background creation completing.

Before: the notification remains after opening the worktree.

Before

After: opening the worktree dismisses the notification.

After

Testing

  • I manually tested these changes locally

  • Automated tests added/updated

  • ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/lib/worktree-creation src/renderer/src/store/slices/worktrees-create-base-status.test.ts — 123 tests pass across 16 files.

  • ORCA_BACKGROUND_LAUNCH=1 pnpm tc:web — passes.

  • pnpm run check:code-quality:changed — passes, including the design system gate.

  • Commit hooks: lint, React Doctor rules, and formatting pass.

  • macOS Electron CDP: reproduced the original bug, selected the target through the sidebar, asserted the notification disappeared, and inspected before/after screenshots. Also exercised Tasks → unrelated workspace (notification stays) and “Go to worktree” (target opens and notification closes).

  • Unit coverage includes unrelated workspaces, multiple notifications, folder workspace wording/dismissal, equivalent remote Windows paths, same-ID workspaces on different hosts, paired response host mapping, nested SSH ownership, legacy rows without a host, host-qualified button navigation, another app view, transient navigation updates, the pending creation panel, already-open workspaces, and listener cleanup including queued callbacks.

Review

Adversarial sub-agent review reproduced issues in host collisions, intermediate navigation updates, paired response host mapping, and legacy rows without a host. All were fixed and covered with regression tests. The final independent review reports no remaining findings (27 toast/creation-flow tests pass). No new IPC or host operations.

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

The change is renderer navigation policy and uses the existing workspace identity comparison. No platform-specific APIs, shortcuts, paths, or remote protocol changes. Linux, Windows, live SSH, and mobile were not exercised locally. Full lint, typecheck, test suite, and production build are left to CI; the dev Electron build and focused checks passed locally.

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)
  • 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)

@coderabbitai

coderabbitai Bot commented Oct 13, 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: 6ad8eda0-7435-4d48-907d-632b9d8af574
📥 Commits

Reviewing files that changed from the base of the PR and between 1b9a408 and 4c07372.

📒 Files selected for processing (3)
  • src/renderer/src/lib/worktree-creation-flow-ready-toast.test.ts
  • src/renderer/src/lib/worktree-creation-ready-toast.test.tsx
  • src/renderer/src/lib/worktree-creation-ready-toast.tsx

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

📝 Walkthrough

showWorktreeCreationReadyToast now accepts worktree host and identity fields. It skips the toast when the terminal already shows that worktree, tracks store updates to dismiss the toast after navigation, and retires its subscription on dismissal, auto-close, or action. The action passes the execution host ID when available. Tests cover these behaviors and subscription cleanup.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 4c073

The notification behavior is ready to merge after normal checks; no concrete issue requiring a change was established.

Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files.
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 primary change: closing the worktree-ready notification when its workspace opens.
Description check Passed The description is complete and directly addresses the template. It explains the user impact, implementation, rationale, testing, visual proof, review status, platform considerations, and checklist it…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • 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.

❤️ Share

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

@nwparker
nwparker merged commit 93e66e1 into main Oct 13, 2026
3 checks passed
@nwparker
nwparker deleted the nwparker/wt-ready-dialog branch October 13, 2026 08:09
nwparker added a commit that referenced this pull request Oct 13, 2026
…#28265)

The ready toast added in #28238 read the Active Server setting through
getKnownExecutionHostIdForWorktree, which the focus-read ratchet rejects,
so every PR's static-analysis job failed on main.
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