Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add open-issue-to-latest-comment feature #2028

Merged
merged 19 commits into from May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -3,3 +3,4 @@ source/features/tags-dropdown.tsx @HardikModha
source/features/tag-changelog-link.tsx @HardikModha
source/features/link-to-file-in-file-history.tsx @HardikModha
source/features/default-to-rich-diff.tsx @idasbiste
source/features/open-issue-to-latest-comment.tsx @dotconnor
1 change: 1 addition & 0 deletions readme.md
Expand Up @@ -206,6 +206,7 @@ GitHub Enterprise is also supported. More info in the options.
- [Search or select tags from a dropdown in the `Releases` page.](https://user-images.githubusercontent.com/22439276/56373231-27ee9980-621e-11e9-9b21-601919d3dddf.png)
- [Link to file itself in the history pages](https://user-images.githubusercontent.com/22439276/57195061-b88ddf00-6f6b-11e9-8ad9-13225d09266d.png)
- [See an automatic changelog for each tag or release.](https://user-images.githubusercontent.com/1402241/57081611-ad4a7180-6d27-11e9-9cb6-c54ec1ac18bb.png)
- [Open issues to the latest comment by clicking the comments icon.](https://user-images.githubusercontent.com/14323370/57962709-7019de00-78e8-11e9-8398-7e617ba7a96f.png)

### Previously part of Refined GitHub

Expand Down
1 change: 1 addition & 0 deletions source/content.ts
Expand Up @@ -102,6 +102,7 @@ import './features/hide-disabled-milestone-sorter';
import './features/tag-changelog-link';
import './features/link-to-file-in-file-history';
import './features/clean-sidebar';
import './features/open-issue-to-latest-comment';

import './features/scrollable-code-and-blockquote.css';
import './features/center-reactions-popup.css';
Expand Down
18 changes: 18 additions & 0 deletions source/features/open-issue-to-latest-comment.tsx
@@ -0,0 +1,18 @@
import select from 'select-dom';
import features from '../libs/features';

function init(): void {
for (const link of select.all<HTMLAnchorElement>('.js-issue-row a[aria-label*="comment"]')) {
link.hash = '#partial-timeline';
}
}

features.add({
id: 'open-issue-to-latest-comment',
description: 'Clicking the comments icon in issue lists will take you to latest comment.',
include: [
features.isDiscussionList
],
load: features.onAjaxedPages,
init
});