Skip to content

Commit 5f0056b

Browse files
author
Brian Vaughn
committed
Improve DevTools bug template text
1 parent 79740da commit 5f0056b

File tree

1 file changed

+37
-19
lines changed

1 file changed

+37
-19
lines changed

packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ReportNewIssue.js

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import * as React from 'react';
1111
import Icon from '../Icon';
1212
import styles from './shared.css';
1313

14+
function encodeURIWrapper(string: string): string {
15+
return encodeURI(string).replace(/#/g, '%23');
16+
}
17+
1418
type Props = {|
1519
callStack: string | null,
1620
componentStack: string | null,
@@ -28,26 +32,40 @@ export default function ReportNewIssue({
2832
}
2933

3034
const title = `Error: "${errorMessage || ''}"`;
31-
const label = 'Component: Developer Tools';
32-
33-
let body = 'Describe what you were doing when the bug occurred:';
34-
body += '\n1. ';
35-
body += '\n2. ';
36-
body += '\n3. ';
37-
body += '\n\n---------------------------------------------';
38-
body += '\nPlease do not remove the text below this line';
39-
body += '\n---------------------------------------------';
40-
body += `\n\nDevTools version: ${process.env.DEVTOOLS_VERSION || ''}`;
41-
if (callStack) {
42-
body += `\n\nCall stack: ${callStack.trim()}`;
43-
}
44-
if (componentStack) {
45-
body += `\n\nComponent stack: ${componentStack.trim()}`;
46-
}
35+
const labels = ['Component: Developer Tools', 'Status: Unconfirmed'];
36+
37+
const body = `
38+
<!-- Please answer both questions below before submitting this issue. -->
39+
40+
### Which website or app were you using when the bug happened?
41+
42+
Please provide a link to the URL of the website (if it is public), a CodeSandbox (https://codesandbox.io/s/new) example that reproduces the bug, or a project on GitHub that we can checkout and run locally.
43+
44+
### What were you doing on the website or app when the bug happened?
45+
46+
If possible, please describe how to reproduce this bug on the website or app mentioned above:
47+
1. <!-- FILL THIS IN -->
48+
2. <!-- FILL THIS IN -->
49+
3. <!-- FILL THIS IN -->
50+
51+
<!--------------------------------------------------->
52+
<!-- Please do not remove the text below this line -->
53+
<!--------------------------------------------------->
54+
55+
### Generated information
56+
57+
DevTools version: ${process.env.DEVTOOLS_VERSION || ''}
58+
59+
Call stack:
60+
${callStack || '(not available)'}
61+
62+
Component stack:
63+
${componentStack || '(not available)'}
64+
`;
4765

48-
bugURL += `/issues/new?labels=${encodeURI(label)}&title=${encodeURI(
49-
title,
50-
)}&body=${encodeURI(body)}`;
66+
bugURL += `/issues/new?labels=${encodeURIWrapper(
67+
labels.join(','),
68+
)}&title=${encodeURIWrapper(title)}&body=${encodeURIWrapper(body.trim())}`;
5169

5270
return (
5371
<div className={styles.GitHubLinkRow}>

0 commit comments

Comments
 (0)