Skip to content

fix(orchestration): focus a newly opened Orcastrator window - #38

Merged
zaridan merged 1 commit into
mainfrom
zaridan/fix-orchestration-focus-new-orcastrator-window
Jun 25, 2026
Merged

fix(orchestration): focus a newly opened Orcastrator window#38
zaridan merged 1 commit into
mainfrom
zaridan/fix-orchestration-focus-new-orcastrator-window

Conversation

@zaridan

@zaridan zaridan commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Problem

#29 added a suppressActivation flag so a director wouldn't yank the user off their active tab when it spawns a worker programmatically. That flag was also applied to launchOrchestratorForProject, which is reached from exactly one place: the user clicking "+" in the ORCASTRATORS sidebar section (OrchestratorLaunchModal.tsx:128). That is a deliberate, manual action and the new Orcastrator window SHOULD be focused — exactly like the "+" for a regular worktree. The regression: after #29, opening a new Orcastrator silently left the user on their current worktree.

Change (user-facing, one line)

Opening a new Orcastrator now activates (focuses) it.

  • orchestrator-launch.ts — stop passing suppressActivation: true to activateAndRevealWorktree.
  • director-worktree-shell.ts — drop the trailing { suppressActivation: true } on the store createWorktree call so the host-side (SSH/remote) activate gate (worktrees.ts, activate: options?.suppressActivation !== true) also focuses the new director. launchOrchestratorForProject is createDirectorWorktreeShell's only caller (confirmed by grep after the recipe-director layer was removed in 71041c0db), so no per-caller option threading is needed.

Untouched: worker-spawn focus suppression

A director spawning a worker must still not steal focus. This PR leaves intact:

Tests

  • orchestrator-launch.test.ts — flipped to assert the launch now activates (suppressActivation falsy, sidebarRevealBehavior still 'auto').
  • director-worktree-shell.test.ts — asserts no trailing suppressActivation option is passed to the host create.
  • worktree-activation-suppress.test.ts — unchanged, still green (proves worker-spawn suppression is unaffected).

Verified: touched vitest files pass (6/6), oxlint clean, tsgo web typecheck passes.

🤖 Generated with Claude Code

#29 added a `suppressActivation` flag to keep a director from yanking the
user's active tab when a worker is spawned programmatically. That flag was
also applied to `launchOrchestratorForProject`, which is reached only by the
user clicking "+" in the ORCASTRATORS sidebar section — a deliberate, manual
action that SHOULD focus the new window, exactly like the "+" for a regular
worktree. As a result, opening a new Orcastrator silently left the user on
their current worktree.

User-facing change: opening a new Orcastrator now activates (focuses) it.

- orchestrator-launch.ts: stop passing `suppressActivation: true` to
  `activateAndRevealWorktree`.
- director-worktree-shell.ts: drop the trailing `{ suppressActivation: true }`
  on the store create so the host-side (SSH/remote) `activate` gate also
  focuses the new director. `launchOrchestratorForProject` is its only caller,
  so no per-caller threading is needed.

Worker-spawn focus suppression is untouched: the CLI worker-spawn path (#35)
and any renderer worker-create path still suppress activation. A director
spawning a WORKER must still not steal focus.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zaridan
zaridan merged commit 6731d01 into main Jun 25, 2026
1 check passed
@zaridan
zaridan deleted the zaridan/fix-orchestration-focus-new-orcastrator-window branch June 25, 2026 04:13
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