Skip to content

Commit f660240

Browse files
authored
finetune issue troubleshooting (microsoft#184907)
1 parent 4dd7a52 commit f660240

File tree

1 file changed

+43
-38
lines changed

1 file changed

+43
-38
lines changed

src/vs/workbench/services/issue/browser/issueTroubleshoot.ts

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class TroubleshootIssueService extends Disposable implements ITroubleshootIssueS
108108

109109
const res = await this.dialogService.confirm({
110110
message: localize('troubleshoot issue', "Troubleshoot Issue"),
111-
detail: localize('detail.start', "Issue troubleshooting is a process to help you identify if the issue is with {0} or caused by an extension.\n\nDuring the process the window reloads repeatedly. Each time you must confirm if you are still seeing problems.", this.productService.nameShort),
111+
detail: localize('detail.start', "Issue troubleshooting is a process to help you identify if the issue is with {0} or caused by an extension.\n\nDuring the process the window reloads repeatedly. Each time you must confirm if you are still seeing problems.", this.productService.nameLong),
112112
primaryButton: localize({ key: 'msg', comment: ['&& denotes a mnemonic'] }, "&&Troubleshoot Issue"),
113113
custom: true
114114
});
@@ -159,7 +159,7 @@ class TroubleshootIssueService extends Disposable implements ITroubleshootIssueS
159159
}
160160

161161
private async reproduceIssueWithExtensionsDisabled(): Promise<void> {
162-
const result = await this.askToReproduceIssue(localize('profile.extensions.disabled', "Issue troubleshooting is active and has temprarily disabled all extensions. Check if you can still reproduce the problem and proceed by selecting from these options."));
162+
const result = await this.askToReproduceIssue(localize('profile.extensions.disabled', "Issue troubleshooting is active and has temprarily disabled all installed extensions. Check if you can still reproduce the problem and proceed by selecting from these options."));
163163
if (result === 'good') {
164164
const profile = this.userDataProfilesService.profiles.find(p => p.id === this.state!.profile) ?? this.userDataProfilesService.defaultProfile;
165165
await this.reproduceIssueWithExtensionsBisect(profile);
@@ -180,10 +180,10 @@ class TroubleshootIssueService extends Disposable implements ITroubleshootIssueS
180180
await this.stop();
181181
}
182182
if (result === 'good') {
183-
await this.askToReportIssue(localize('issue is with configuration', "Issue troubleshooting is done and has identified that the issue is caused by your settings. Please report the issue by sharing your settings."));
183+
await this.askToReportIssue(localize('issue is with configuration', "Issue troubleshooting has identified that the issue is caused by your settings. Please report the issue by sharing your settings."));
184184
}
185185
if (result === 'bad') {
186-
await this.askToReportIssue(localize('issue is in core', "Issue troubleshooting is done and has identified that the issue is with {0}.", this.productService.nameShort));
186+
await this.askToReportIssue(localize('issue is in core', "Issue troubleshooting has identified that the issue is with {0}.", this.productService.nameLong));
187187
}
188188
}
189189

@@ -217,45 +217,45 @@ class TroubleshootIssueService extends Disposable implements ITroubleshootIssueS
217217
});
218218
}
219219

220-
private async askToReportIssue(detail: string): Promise<void> {
221-
const isStable = this.productService.quality === 'stable';
222-
if (isStable) {
220+
private async askToReportIssue(message: string): Promise<void> {
221+
let isCheckedInInsiders = false;
222+
if (this.productService.quality === 'stable') {
223223
const res = await this.askToReproduceIssueWithInsiders();
224-
if (res === undefined) {
225-
return this.reportIssue(false);
226-
}
227-
if (res) {
224+
if (res === 'good') {
228225
await this.dialogService.prompt({
229226
type: Severity.Info,
230227
message: localize('troubleshoot issue', "Troubleshoot Issue"),
231-
detail: localize('use insiders', "This likely means that the issue has been addressed already and will be available in an upcoming release. You can safely use {0} insiders until the new stable version is available.", this.productService.nameShort),
228+
detail: localize('use insiders', "This likely means that the issue has been addressed already and will be available in an upcoming release. You can safely use {0} insiders until the new stable version is available.", this.productService.nameLong),
232229
custom: true
233230
});
234231
return;
235232
}
233+
if (res === 'stop') {
234+
await this.stop();
235+
return;
236+
}
237+
if (res === 'bad') {
238+
isCheckedInInsiders = true;
239+
}
236240
}
237-
const res = await this.dialogService.confirm({
238-
type: Severity.Info,
239-
message: localize('troubleshoot issue', "Troubleshoot Issue"),
240-
primaryButton: localize({ key: 'report', comment: ['&& denotes a mnemonic'] }, "&&Report Issue & Continue"),
241-
cancelButton: localize('continue', "Continue"),
242-
detail,
243-
custom: true
241+
242+
await this.issueService.openReporter({
243+
issueBody: `> ${message} ${isCheckedInInsiders ? `It is confirmed that the issue exists in ${this.productService.nameLong} Insiders` : ''}`,
244244
});
245-
if (res.confirmed) {
246-
await this.reportIssue(isStable);
247-
}
248245
}
249246

250-
private async askToReproduceIssueWithInsiders(): Promise<boolean | undefined> {
247+
private async askToReproduceIssueWithInsiders(): Promise<TroubleShootResult | undefined> {
251248
const confirmRes = await this.dialogService.confirm({
252249
type: 'info',
253250
message: localize('troubleshoot issue', "Troubleshoot Issue"),
254-
primaryButton: localize('download insiders', "Download {0} Insiders", this.productService.nameShort),
251+
primaryButton: localize('download insiders', "Download {0} Insiders", this.productService.nameLong),
255252
cancelButton: localize('report anyway', "Report Issue Anyway"),
256-
detail: localize('ask to download insiders', "Please try to download and reproduce the issue in {0} insiders.", this.productService.nameShort),
257-
custom: true
253+
detail: localize('ask to download insiders', "Please try to download and reproduce the issue in {0} insiders.", this.productService.nameLong),
254+
custom: {
255+
disableCloseAction: true,
256+
}
258257
});
258+
259259
if (!confirmRes.confirmed) {
260260
return undefined;
261261
}
@@ -265,22 +265,27 @@ class TroubleshootIssueService extends Disposable implements ITroubleshootIssueS
265265
return undefined;
266266
}
267267

268-
const res = await this.dialogService.confirm({
268+
const res = await this.dialogService.prompt<TroubleShootResult>({
269269
type: 'info',
270270
message: localize('troubleshoot issue', "Troubleshoot Issue"),
271-
primaryButton: localize('good', "I can't reproduce"),
272-
cancelButton: localize('bad', "I can reproduce"),
273-
detail: localize('ask to reproduce issue', "Please try to reproduce the issue in {0} insiders and confirm if the issue exists there.", this.productService.nameShort),
274-
custom: true
271+
buttons: [{
272+
label: localize('good', "I can't reproduce"),
273+
run: () => 'good'
274+
}, {
275+
label: localize('bad', "I can reproduce"),
276+
run: () => 'bad'
277+
}],
278+
cancelButton: {
279+
label: localize('stop', "Stop"),
280+
run: () => 'stop'
281+
},
282+
detail: localize('ask to reproduce issue', "Please try to reproduce the issue in {0} insiders and confirm if the issue exists there.", this.productService.nameLong),
283+
custom: {
284+
disableCloseAction: true,
285+
}
275286
});
276287

277-
return !!res.confirmed;
278-
}
279-
280-
private reportIssue(checkedInInsiders: boolean): Promise<void> {
281-
return this.issueService.openReporter({
282-
issueBody: `> This issue is reported using the **Troubleshoot Issue** feature. ${checkedInInsiders ? localize('confirmed in insiders', "It is confirmed that the issue exists in Insiders.") : ''}`,
283-
});
288+
return res.result;
284289
}
285290

286291
private _state: TroubleShootState | undefined | null;

0 commit comments

Comments
 (0)