Skip to content

Commit 6d9f7a1

Browse files
authored
FIx github issue titles (#111 fixes #109)
2 parents 5431df8 + 9ee017b commit 6d9f7a1

File tree

5 files changed

+170
-893
lines changed

5 files changed

+170
-893
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Version must be kept in-sync between [`package.json`](package.json) and [`wxt.co
66

77
## [Unreleased]
88
### Fixed
9+
- GitHub issues were not scraping the correct title. ([#109](https://github.com/diffplug/gitcasso/issues/109))
910
- We don't show edited comments in the popup table anymore. ([#110](https://github.com/diffplug/gitcasso/pull/110))
1011

1112
## [1.1.0] - 2025-10-07

src/lib/enhancers/github/GitHubIssueAppendEnhancer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class GitHubIssueAppendEnhancer
9191
const number = parseInt(numberStr!, 10)
9292
const unique_key = `github.com:${slug}:${number}`
9393
const title = document
94-
.querySelector("main h2")!
94+
.querySelector("main h1")!
9595
.textContent!.replace(/\s*#\d+$/, "")
9696
.trim()
9797
return {

tests/corpus/gh_issue.html

Lines changed: 164 additions & 888 deletions
Large diffs are not rendered by default.

tests/lib/enhancers/__snapshots__/gh-detection.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports[`github detection > gh_issue_edit:should detect correct spots 1`] = `
3232
"domain": "github.com",
3333
"number": 56,
3434
"slug": "diffplug/gitcasso",
35-
"title": "Description",
35+
"title": "what about the draft?",
3636
"type": "GH_ISSUE_APPEND",
3737
"unique_key": "github.com:diffplug/gitcasso:56",
3838
},
@@ -64,7 +64,7 @@ exports[`github detection > gh_issue_edit_multiple:should detect correct spots 1
6464
"domain": "github.com",
6565
"number": 3,
6666
"slug": "diffplug/testing-deletable",
67-
"title": "Description",
67+
"title": "Test 3",
6868
"type": "GH_ISSUE_APPEND",
6969
"unique_key": "github.com:diffplug/testing-deletable:3",
7070
},

tests/lib/enhancers/__snapshots__/gh-ui.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports[`github ui > gh_issue_edit:should render correct UI elements 1`] = `
3232
[
3333
{
3434
"for": "id=:ra7: name=null className=prc-Textarea-TextArea-13q4j overtype-input",
35-
"title": "Description",
35+
"title": "what about the draft?",
3636
"upperDecoration": <React.Fragment>
3737
<span
3838
className="flex h-4 w-4 flex-shrink-0 items-center justify-center"
@@ -60,7 +60,7 @@ exports[`github ui > gh_issue_edit_multiple:should render correct UI elements 1`
6060
[
6161
{
6262
"for": "id=:r5b: name=null className=prc-Textarea-TextArea-13q4j overtype-input",
63-
"title": "Description",
63+
"title": "Test 3",
6464
"upperDecoration": <React.Fragment>
6565
<span
6666
className="flex h-4 w-4 flex-shrink-0 items-center justify-center"

0 commit comments

Comments
 (0)