Skip to content

Commit

Permalink
Restore 3 features on the first comment of issues (refined-github#8277)
Browse files Browse the repository at this point in the history
Co-authored-by: fregante <me@fregante.com>
  • Loading branch information
kovsu and fregante authored Feb 13, 2025
1 parent 26948f5 commit 3e851c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/features/comments-time-machine-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ async function init(signal: AbortSignal): Promise<void> {
}, {signal});

observe([
'div.react-issue-comment',
'div.react-issue-comment', // Comments
'div.react-issue-body', // First comment
'[data-testid="review-thread"] > div',
], comment => {
const timestamp = $('relative-time', comment).attributes.datetime.value;
Expand Down
1 change: 1 addition & 0 deletions source/features/shorten-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function initOnce(): void {
observe([
`.comment-body a[href]:not(.${linkifiedURLClass})`,
`.react-issue-comment .markdown-body a[href]:not(.${linkifiedURLClass})`, // Issue comments
`.react-issue-body .markdown-body a[href]:not(.${linkifiedURLClass})`, // First issue comment
`[data-testid="review-thread"] .markdown-body a[href]:not(.${linkifiedURLClass})`, // React commit view
], shortenLink);
}
Expand Down
1 change: 1 addition & 0 deletions source/github-helpers/get-comment-author.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function getCommentAuthor(anyElementInsideComment: Element): stri
.closest([
'.TimelineItem', // PR comments (and pre-issue redesign issue comments)
'.review-comment', // PR review comments
'.react-issue-body', // First issue comment
'.react-issue-comment', // Issue comments
'[data-testid="comment-header"]', // Commit comments
])!
Expand Down

0 comments on commit 3e851c9

Please sign in to comment.