Skip to content

Commit 5f65fda

Browse files
Copilotalexr00
andauthored
feat: use modal dialog with new window and current window options for worktree
Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/b2dbdafb-3aa3-4d09-8555-21772c09c7e9 Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent db793c6 commit 5f65fda

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/commands.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -936,15 +936,20 @@ export function registerCommands(
936936
}
937937
);
938938

939-
// Ask user if they want to open the worktree (after progress is finished)
940-
const openAction = vscode.l10n.t('Open in New Window');
939+
// Ask user how they want to open the worktree (modal dialog)
940+
const openInNewWindow = vscode.l10n.t('New Window');
941+
const openInCurrentWindow = vscode.l10n.t('Current Window');
941942
const result = await vscode.window.showInformationMessage(
942-
vscode.l10n.t('Worktree created for Pull Request #{0}', pullRequestModel.number),
943-
openAction
943+
vscode.l10n.t('Worktree created for Pull Request #{0}. How would you like to open it?', pullRequestModel.number),
944+
{ modal: true },
945+
openInNewWindow,
946+
openInCurrentWindow
944947
);
945948

946-
if (result === openAction) {
949+
if (result === openInNewWindow) {
947950
await commands.openFolder(worktreeUri, { forceNewWindow: true });
951+
} else if (result === openInCurrentWindow) {
952+
await commands.openFolder(worktreeUri, { forceNewWindow: false });
948953
}
949954
} catch (e) {
950955
const errorMessage = e instanceof Error ? e.message : String(e);

0 commit comments

Comments
 (0)