Add a --background opt-out to CLI and deeplink focus-follow - #739
Merged
Conversation
Every socket/CLI worktree and tab action moved the sidebar selection and keyboard focus to the affected worktree, so a session driving Supacode programmatically lost focus on every create and teardown (#722). `--background` (and the matching `background=true` deeplink parameter) keeps the selection and keyboard focus where they are: new tabs, splits, and script tabs land in the background instead of activating, and closes no longer pull focus back. The intent survives the interactive worktree-creation prompt, the input-confirmation dialog, and the archive and delete lifecycle scripts. Omitting the flag reproduces the previous behavior exactly, and the dedicated focus commands do not accept it. Tab creation expresses selection and keyboard focus as one `TabActivation` value, since the initial-tab path needs a selected but unfocused tab. Background tabs append rather than inserting after the selection, so a run of them keeps its order, and the very first tab still selects. Also fixes bare `worktree run` and `worktree stop` resolving their target from the selected worktree instead of the one the command names, which suppressing the selection would otherwise have turned into running the wrong script.
Covers the in-app CLI and deeplink reference panes plus the installable skill content, so the flag is discoverable from every surface that lists commands.
sbertix
enabled auto-merge (squash)
July 29, 2026 21:47
|
Huge, thank you! ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #722
Summary
Every socket/CLI worktree and tab action moved the sidebar selection and
keyboard focus to the affected worktree, so a session driving Supacode
programmatically lost focus on every create and teardown.
This adds a
--backgroundflag (and a matchingbackground=truedeeplinkparameter) to every action that would otherwise focus its target:
repo worktree-new,worktree run/stop/archive/unarchive/delete/pin/unpin,tab new/close, andsurface split/close. It suppressesboth the cross-worktree selection and the intra-worktree activation: new
tabs, splits, and script tabs land in the background, and closes do not pull
focus back. The intent survives the interactive worktree-creation prompt,
the input-confirmation dialog, and the archive/delete lifecycle scripts.
Omitting the flag reproduces the previous behavior exactly, and the
dedicated
focuscommands do not accept it. Tab creation now expressesselection and keyboard focus as one
TabActivationvalue; background tabsappend so a run of them keeps its order, and the very first tab still
selects.
Also fixes bare
worktree run/stopresolving their target from theselected worktree instead of the one the command names, which suppressing
the selection would otherwise have turned into running the wrong script.
Known limitation: closing the focused surface of the currently selected tab
still transfers focus to the surviving pane, preserving the invariant that a
tab with visible leaves keeps a focused surface.
Type of change
ready)How was this tested?
Reducer tests cover the deeplink gate in both directions, the confirmation
round-trip, the pending-worktree path, malformed
backgroundvalues, thetab-selection axis (ordering, first-tab selection), and the corrected
run/stoptargeting against a non-selected worktree. Verified manually bydriving a second worktree from a live session with
--backgroundon tabcreation, splits, scripts, and lifecycle actions.
make checkpasses (format + lint)make testpassesChecklist
Closes #above.ready.