Skip to content

Use VS Code's worktree InputBox UI when checking out a PR in a worktree#8721

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/use-custom-ui-for-checkout
Draft

Use VS Code's worktree InputBox UI when checking out a PR in a worktree#8721
Copilot wants to merge 2 commits intomainfrom
copilot/use-custom-ui-for-checkout

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

"Checkout in Worktree" opened the OS save dialog, which is awkward (especially on Windows) and inconsistent with VS Code's built-in Git: Create Worktree... flow that uses an inline InputBox.

Changes — src/github/worktree.ts

  • Replace showSaveDialog with createInputBox in checkoutPRInWorktree, mirroring the built-in worktree UI: pre-filled editable path, prompt "Please provide a worktree path", ignoreFocusOut, and an inline folder-picker button (QuickInputButtonLocation.Inline, folder codicon) that opens showOpenDialog to pick a parent directory and re-joins the worktree name.
  • Default path now follows the built-in convention <parentDir>/<repoBasename>.worktrees/pr-<number> (was <parentDir>/pr-<number>), matching what users see from Git: Create Worktree....
  • Pre-select the trailing pr-<number> segment via valueSelection for quick rename.
  • Warn on collision with an existing worktree using repository.state.worktrees and InputBoxValidationSeverity.Warning (non-blocking, matching built-in).

Public signature of checkoutPRInWorktree and the subsequent "open in current/new window" prompt are unchanged.

const worktreePath = await promptForWorktreePath(repositoryToUse, worktreeName, defaultWorktreePath);
if (!worktreePath) {
    return; // User cancelled
}
const worktreeUri = vscode.Uri.file(worktreePath);

Copilot AI changed the title [WIP] Update checkout UI for worktree to match built-in feature Use VS Code's worktree InputBox UI when checking out a PR in a worktree May 5, 2026
Copilot finished work on behalf of alexr00 May 5, 2026 08:48
Copilot AI requested a review from alexr00 May 5, 2026 08:48
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.

Use same UI for checkout in worktree as built-in VS Code worktree feature

2 participants