Use VS Code's worktree InputBox UI when checking out a PR in a worktree#8721
Conversation
…t: Create Worktree Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/a494f95c-24ab-4aca-b78a-cd2ee4cca5a3 Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Could you clarify which command you have in mind? The only worktree command exposed by VS Code's built-in Git extension is A few options I can see:
Which of these matches what you had in mind, or is it something else? |
alexr00
left a comment
There was a problem hiding this comment.
vscode-pull-request-github/src/@types/git.d.ts
Lines 302 to 303 in b6ef67b
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Got it — the |
"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 inlineInputBox.Changes —
src/github/worktree.tsshowSaveDialogwithcreateInputBoxincheckoutPRInWorktree, 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,foldercodicon) that opensshowOpenDialogto pick a parent directory and re-joins the worktree name.<parentDir>/<repoBasename>.worktrees/pr-<number>(was<parentDir>/pr-<number>), matching what users see fromGit: Create Worktree....pr-<number>segment viavalueSelectionfor quick rename.repository.state.worktreesandInputBoxValidationSeverity.Warning(non-blocking, matching built-in).Public signature of
checkoutPRInWorktreeand the subsequent "open in current/new window" prompt are unchanged.