Skip to content

Commit 254bbd9

Browse files
committed
tweaked by me
1 parent d8aa8b9 commit 254bbd9

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

src/lib/enhancers/github/GitHubEditEnhancer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { logger } from "@/lib/logger"
99
import { fixupOvertype, modifyDOM } from "../overtype-misc"
1010
import {
1111
commonGitHubOptions,
12-
isGitHubProjectUrl,
12+
isProjectUrl,
1313
isInProjectCommentBox,
1414
parseProjectIssueParam,
1515
prepareGitHubHighlighter,
@@ -36,7 +36,7 @@ export class GitHubEditEnhancer implements CommentEnhancer<GitHubEditSpot> {
3636
}
3737

3838
// Check for project draft edit first
39-
if (isGitHubProjectUrl(location.pathname)) {
39+
if (isProjectUrl(location.pathname)) {
4040
const params = new URLSearchParams(location.search)
4141
const itemId = params.get("itemId")
4242

src/lib/enhancers/github/GitHubIssueAppendEnhancer.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { fixupOvertype, modifyDOM } from "../overtype-misc"
1212
import {
1313
commonGitHubOptions,
1414
extractProjectIssueTitle,
15-
isGitHubProjectUrl,
15+
isProjectUrl,
1616
isInProjectCommentBox,
1717
parseProjectIssueParam,
1818
prepareGitHubHighlighter,
@@ -29,8 +29,7 @@ export interface GitHubIssueAppendSpot extends CommentSpot {
2929
}
3030

3131
export class GitHubIssueAppendEnhancer
32-
implements CommentEnhancer<GitHubIssueAppendSpot>
33-
{
32+
implements CommentEnhancer<GitHubIssueAppendSpot> {
3433
forSpotTypes(): string[] {
3534
return [GH_ISSUE_APPEND]
3635
}
@@ -53,7 +52,7 @@ export class GitHubIssueAppendEnhancer
5352
}
5453

5554
// Check for project URLs with issue parameter first
56-
if (isGitHubProjectUrl(location.pathname)) {
55+
if (isProjectUrl(location.pathname)) {
5756
const params = new URLSearchParams(location.search)
5857
// Only match textareas within Shared-module__CommentBox (those are for adding new comments)
5958
if (isInProjectCommentBox(textarea)) {

src/lib/enhancers/github/GitHubIssueCreateEnhancer.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { fixupOvertype, modifyDOM } from "../overtype-misc"
1111
import {
1212
commonGitHubOptions,
1313
extractDialogSlug,
14-
isGitHubProjectUrl,
14+
isProjectUrl,
1515
prepareGitHubHighlighter,
1616
} from "./github-common"
1717

@@ -25,8 +25,7 @@ export interface GitHubIssueCreateSpot extends CommentSpot {
2525
}
2626

2727
export class GitHubIssueCreateEnhancer
28-
implements CommentEnhancer<GitHubIssueCreateSpot>
29-
{
28+
implements CommentEnhancer<GitHubIssueCreateSpot> {
3029
forSpotTypes(): string[] {
3130
return [GH_ISSUE_CREATE]
3231
}
@@ -43,7 +42,7 @@ export class GitHubIssueCreateEnhancer
4342
}
4443

4544
// Check for project board URLs first
46-
if (isGitHubProjectUrl(location.pathname)) {
45+
if (isProjectUrl(location.pathname)) {
4746
// Check if we're in a "Create new issue" dialog
4847
const dialog = textarea.closest('[role="dialog"]')
4948
if (dialog) {

src/lib/enhancers/github/github-common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function githubHighlighter(code: string, language?: string) {
6969
* Matches: /orgs/{org}/projects/{id} or /users/{user}/projects/{id}
7070
* Optional: /views/{viewId} suffix
7171
*/
72-
export function isGitHubProjectUrl(pathname: string): boolean {
72+
export function isProjectUrl(pathname: string): boolean {
7373
return /^\/(?:orgs|users)\/[^/]+\/projects\/\d+(?:\/views\/\d+)?/.test(
7474
pathname
7575
)

0 commit comments

Comments
 (0)