Skip to content

Commit 0ba457b

Browse files
committed
Fix double-annotation of PR new comment.
1 parent d12fc37 commit 0ba457b

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

browser-extension/src/lib/enhancers/github/githubPRNewComment.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ export class GitHubPRNewCommentEnhancer implements CommentEnhancer<GitHubPRNewCo
1616
return ['GH_PR_NEW_COMMENT']
1717
}
1818

19-
tryToEnhance(_textarea: HTMLTextAreaElement): GitHubPRNewCommentSpot | null {
19+
tryToEnhance(textarea: HTMLTextAreaElement): GitHubPRNewCommentSpot | null {
20+
if (textarea.id == 'feedback') {
21+
return null
22+
}
2023
if (document.querySelector('meta[name="hostname"]')?.getAttribute('content') !== 'github.com') {
2124
return null
2225
}

browser-extension/tests/lib/enhancers/github.test.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,26 +69,8 @@ describe('github', () => {
6969
expect(enhancements(document)).toMatchInlineSnapshot(`
7070
[
7171
{
72-
"for": "id=feedback name=feedback className=form-control width-full mb-2 overtype-input",
73-
"spot": {
74-
"domain": "github.com",
75-
"slug": "diffplug/selfie/main...cavia-porcellus:selfie:main",
76-
"type": "GH_PR_NEW_COMMENT",
77-
"unique_key": "github.com:diffplug/selfie/main...cavia-porcellus:selfie:main",
78-
},
79-
"title": "TITLE_TODO",
80-
"upperDecoration": <React.Fragment>
81-
<span>
82-
New PR
83-
</span>
84-
<span
85-
className="font-mono text-muted-foreground text-sm"
86-
>
87-
88-
diffplug/selfie/main...cavia-porcellus:selfie:main
89-
90-
</span>
91-
</React.Fragment>,
72+
"for": "id=feedback name=feedback className=form-control width-full mb-2",
73+
"spot": "NO_SPOT",
9274
},
9375
{
9476
"for": "id=pull_request_body name=pull_request[body] className=js-comment-field js-paste-markdown js-task-list-field js-quick-submit FormControl-textarea CommentBox-input js-size-to-fit size-to-fit js-session-resumable js-saved-reply-shortcut-comment-field CommentBox-input--large overtype-input",

0 commit comments

Comments
 (0)