Skip to content

Commit a0c5757

Browse files
enhance issue reporter with title and required description prompts (microsoft#1389)
Co-authored-by: Eduardo Villalpando Mello <eduardo.villalpando.mello@gmail.com>
1 parent ba93146 commit a0c5757

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

src/extension.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,40 @@ export async function activate(context: ExtensionContext): Promise<PythonEnviron
447447
),
448448
commands.registerCommand('python-envs.reportIssue', async () => {
449449
try {
450+
// Prompt for issue title
451+
const rawTitle = await window.showInputBox({
452+
title: l10n.t('Report Issue - Title'),
453+
prompt: l10n.t('Enter a brief title for the issue'),
454+
placeHolder: l10n.t('e.g., Environment not detected, activation fails, etc.'),
455+
ignoreFocusOut: true,
456+
});
457+
const title = rawTitle?.trim();
458+
459+
if (!title) {
460+
// User cancelled or provided empty title
461+
return;
462+
}
463+
464+
// Prompt for issue description
465+
const rawDescription = await window.showInputBox({
466+
title: l10n.t('Report Issue - Description'),
467+
prompt: l10n.t('Describe the issue in more detail'),
468+
placeHolder: l10n.t('Provide additional context about what happened...'),
469+
ignoreFocusOut: true,
470+
});
471+
const description = rawDescription?.trim();
472+
473+
if (!description) {
474+
// User cancelled or provided empty description
475+
return;
476+
}
477+
450478
const issueData = await collectEnvironmentInfo(context, envManagers, projectManager);
451479

452480
await commands.executeCommand('workbench.action.openIssueReporter', {
453481
extensionId: 'ms-python.vscode-python-envs',
454-
issueTitle: '[Python Environments] ',
455-
issueBody: `<!-- Please describe the issue you're experiencing -->\n\n<!-- The following information was automatically generated -->\n\n<details>\n<summary>Environment Information</summary>\n\n\`\`\`\n${issueData}\n\`\`\`\n\n</details>`,
482+
issueTitle: `[Python Environments] ${title}`,
483+
issueBody: `## Description\n${description}\n\n## Steps to Reproduce\n1. \n2. \n3. \n\n## Expected Behavior\n\n\n## Actual Behavior\n\n\n<!-- The following information was automatically generated -->\n\n<details>\n<summary>Environment Information</summary>\n\n\`\`\`\n${issueData}\n\`\`\`\n\n</details>`,
456484
});
457485
} catch (error) {
458486
window.showErrorMessage(`Failed to open issue reporter: ${error}`);

0 commit comments

Comments
 (0)