Skip to content

Unify isolation checkbox into shared BranchPicker#326414

Draft
benvillalobos wants to merge 18 commits into
mainfrom
bv/branchpicker-isolation-checkbox
Draft

Unify isolation checkbox into shared BranchPicker#326414
benvillalobos wants to merge 18 commits into
mainfrom
bv/branchpicker-isolation-checkbox

Conversation

@benvillalobos

@benvillalobos benvillalobos commented Jul 17, 2026

Copy link
Copy Markdown
Member

The standalone IsolationPicker widget and the automation dialog's chip/dropdown were two separate implementations of the same isolation mode control. This PR merges them into a single optional checkbox rendered by the shared BranchPicker widget.

What changed

The shared BranchPicker (contrib/chat/browser/branchPicker.ts) now accepts optional isolation configuration. When supplied, it renders a "New Worktree" checkbox before the branch trigger. When omitted, behavior is unchanged.

  • copilotChatSessions: The copilot adapter drives the checkbox (config gating, git repo detection, context key, telemetry, onboarding target). The standalone action + registration are removed.
  • Automation dialog: The chip/dropdown is replaced by the same checkbox wired to AutomationIsolationModel. The IActionWidgetService dependency and super.render() call are removed since neither is needed.
  • Deleted: isolationPicker.ts, isolationPicker.css, isolationPicker.test.ts. The IsolationMode type moved to copilotChatSessionsProvider.ts.
  • Tests: Isolation checkbox tests folded into branchPicker.test.ts. Two automation dialog tests rewritten to assert checkbox state.

Notes

  • SessionIsolationPickerVisibleContext is preserved — ownership moved to the copilot adapter.
  • The automation dialog's isolation state (disabled when session type doesn't support worktrees) is unchanged.

cc @sandy081

benvillalobos and others added 12 commits July 17, 2026 11:40
Largely a migration from the standalone IsolationPicker ahead of its
deletion. The copilot adapter now drives the isolation checkbox added
to the shared BranchPicker, connecting session state (config gating,
git repo detection, context key, telemetry) to the new checkbox slot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The branch picker now renders the isolation checkbox internally, so
the separate isolationPicker action, view-item factory, and import
are no longer needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The type was defined in isolationPicker.ts which is being deleted.
Relocated next to the STORAGE_KEY_ISOLATION_MODE constant where all
isolation-mode session logic lives.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The chip-and-dropdown isolation UI is replaced by the same checkbox
the shared BranchPicker now renders, unifying the isolation control
across copilotChatSessions and automations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The chip element no longer exists — its styles are dead code. Branch-
slot styles and the divider box-shadow between slots are preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fold isolation picker checkbox tests into the copilot branchPicker
test. Rewrite automation dialog tests to assert checkbox state instead
of the removed chip/dropdown.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fully replaced by the isolation checkbox in the shared BranchPicker.
The IsolationMode type now lives in copilotChatSessionsProvider.ts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When isolation is configured, wrap both slots in a flex-row container
so the checkbox and branch trigger sit side by side.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BaseActionViewItem.render() registers a MOUSE_DOWN listener that adds
an .active class to the container, which triggers the workbench toolbar
rule that highlights all .action-label descendants. Since the container
now holds two action-labels (the isolation checkbox and the branch
trigger), clicking either one highlighted both.

The copilot PickerActionViewItem already skips super.render() for
the same reason. The automation dialog called it but immediately wiped
the DOM with clearNode — the only lasting side effect was the unwanted
.active listener.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removing super.render() dropped the MOUSE_DOWN preventDefault that
was suppressing native text selection. Add user-select: none to the
wrapper instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 17, 2026 22:03

Copilot AI 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.

Pull request overview

Unifies worktree isolation into the shared branch picker across Copilot sessions and automation dialogs.

Changes:

  • Adds an optional isolation checkbox to BranchPicker.
  • Migrates Copilot and automation isolation controls to it.
  • Removes the standalone isolation picker and consolidates tests.
Show a summary per file
File Description
aiCustomizationManagement.css Removes obsolete automation chip styling.
isolationPicker.test.ts Deletes standalone picker tests.
branchPicker.test.ts Adds Copilot isolation checkbox tests.
isolationPicker.css Deletes standalone picker styles.
isolationPicker.ts Removes the standalone picker.
copilotChatSessionsProvider.ts Relocates IsolationMode.
copilotChatSessionsActions.ts Removes standalone picker registration.
Copilot branchPicker.ts Adapts session isolation state to the shared picker.
Shared branchPicker.css Adds grouped checkbox styling.
Shared branchPicker.ts Implements optional isolation checkbox support.
automationDialog.test.ts Updates automation isolation assertions.
automationDialog.ts Replaces the isolation dropdown with the checkbox.

Review details

  • Files reviewed: 12/12 changed files
  • Comments generated: 5
  • Review effort level: Medium

Comment thread src/vs/sessions/contrib/chat/browser/branchPicker.ts
Comment thread src/vs/sessions/contrib/chat/browser/media/branchPicker.css
Comment thread src/vs/sessions/contrib/chat/browser/branchPicker.ts
benvillalobos and others added 6 commits July 17, 2026 15:21
The onboarding tours reference 'sessions.newSession.isolation' and
need a DOM element registered as the target. Wire markOnboardingTarget
through the IBranchPickerIsolationOptions.markTarget option.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use 'a.action-label' to disambiguate the branch trigger (an <a>) from
the isolation checkbox row (a <div>), matching codebase convention.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Checkbox.disable() sets tabIndex=-1, making it unreachable via
keyboard. Override to tabIndex=0 so users can tab to it and
discover the disabled reason via the tooltip.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Restore span.sessions-chat-branch-picker-group as the layout owner
  (inline-flex + min-width:0) instead of inline styles on the caller.
- Fix automation divider: drop direct-child selector so box-shadow
  matches through the wrapper.
- Add min-width:0 so labels can ellipsize in narrow toolbars.
- Revert PickerActionViewItem inline styles (not its responsibility).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tion-checkbox

# Conflicts:
#	src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.ts
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.

2 participants