Skip to content

Commit 0126bf1

Browse files
authored
modal for non continue case (#7106)
1 parent f40186c commit 0126bf1

1 file changed

Lines changed: 29 additions & 5 deletions

File tree

src/github/copilotRemoteAgent.ts

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ export interface IAPISessionLogs {
2424
logs: string;
2525
}
2626

27+
const LEARN_MORE = vscode.l10n.t('Learn about Coding Agent');
28+
// Without Pending Changes
29+
const CONTINUE = vscode.l10n.t('Continue');
30+
// With Pending Changes
2731
const PUSH_CHANGES = vscode.l10n.t('Include changes');
2832
const CONTINUE_WITHOUT_PUSHING = vscode.l10n.t('Ignore changes');
29-
const LEARN_MORE = vscode.l10n.t('Learn about Coding Agent');
3033

3134
export class CopilotRemoteAgentManager extends Disposable {
3235
public static ID = 'CopilotRemoteAgentManager';
@@ -128,13 +131,18 @@ export class CopilotRemoteAgentManager extends Disposable {
128131

129132
const hasChanges = repository.state.workingTreeChanges.length > 0 || repository.state.indexChanges.length > 0;
130133

134+
const learnMoreCb = async () => {
135+
vscode.env.openExternal(vscode.Uri.parse('https://docs.github.com/copilot/using-github-copilot/coding-agent'));
136+
};
137+
131138
let autoPushAndCommit = false;
139+
const message = vscode.l10n.t('GitHub Coding Agent will continue your work in \'{0}\'', repoName);
132140
if (hasChanges && this.autoCommitAndPushEnabled()) {
133141
const modalResult = await vscode.window.showInformationMessage(
134-
vscode.l10n.t('GitHub Coding Agent will continue your work in \'{0}\'', repoName),
142+
message,
135143
{
136144
modal: true,
137-
detail: vscode.l10n.t('Uncommitted local changes detected'),
145+
detail: vscode.l10n.t('Local changes detected'),
138146
},
139147
PUSH_CHANGES,
140148
CONTINUE_WITHOUT_PUSHING,
@@ -146,15 +154,31 @@ export class CopilotRemoteAgentManager extends Disposable {
146154
}
147155

148156
if (modalResult === LEARN_MORE) {
149-
vscode.env.openExternal(vscode.Uri.parse('https://docs.github.com/copilot/using-github-copilot/coding-agent'));
157+
learnMoreCb();
150158
return;
151159
}
152160

153161
if (modalResult === PUSH_CHANGES) {
154162
autoPushAndCommit = true;
155163
}
156-
}
164+
} else {
165+
const modalResult = await vscode.window.showInformationMessage(
166+
message,
167+
{
168+
modal: true,
169+
},
170+
CONTINUE,
171+
LEARN_MORE,
172+
);
173+
if (!modalResult) {
174+
return;
175+
}
157176

177+
if (modalResult === LEARN_MORE) {
178+
learnMoreCb();
179+
return;
180+
}
181+
}
158182

159183
await vscode.window.withProgress({
160184
location: vscode.ProgressLocation.Notification,

0 commit comments

Comments
 (0)