Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ Thanks for contributing! 🦋🙌
- [](# "split-issue-pr-search-results") [Separates issues from PRs in the global search.](https://user-images.githubusercontent.com/1402241/52181103-35a09f80-2829-11e9-9c6f-57f2e08fc5b2.png)
- [](# "sticky-discussion-sidebar") [Makes the discussion sidebar sticky.](https://user-images.githubusercontent.com/10238474/62276723-5a2eaa80-b44d-11e9-810b-ff598d1c5c6a.gif)
- [](# "sticky-discussion-list-toolbar") [Makes the discussion list’s filters toolbar sticky.](https://user-images.githubusercontent.com/380914/39878141-7632e61a-542c-11e8-9c66-74fcd3a134aa.gif)
- [](# "highlight-own-issues-and-prs") [Highlights discussions opened by you.](https://user-images.githubusercontent.com/1402241/53065281-01560000-3506-11e9-9a51-0bdf69e20b4a.png)
- [](# "highlight-collaborators-in-lists") [Highlights discussions opened by the current repo’s collaborators.](https://user-images.githubusercontent.com/55841/64478536-0a5ca500-d1aa-11e9-8284-a39114d37824.png)
- [](# "highlight-collaborators-and-own-discussions") [Highlights discussions opened by you or the current repo’s collaborators.](https://user-images.githubusercontent.com/1402241/65013882-03225d80-d947-11e9-8eb8-5507bc1fc14b.png)
- [](# "align-issue-labels") [Aligns labels in lists to the left.](https://user-images.githubusercontent.com/1402241/28006237-070b8214-6581-11e7-94bc-2b01a007d00b.png)
- [](# "sort-issues-by-update-time") 🔥 Changes the default sort order of discussions to `Recently updated`.
- [](# "widen-search-field") [Widens the discussion search box.](https://user-images.githubusercontent.com/1402241/55069759-bceaf080-50bf-11e9-84d0-7707de2eb9e9.png)
Expand Down
3 changes: 1 addition & 2 deletions source/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ import './features/format-discussion-titles';
import './features/embed-gist-inline';
import './features/extend-status-labels';
import './features/highlight-closing-prs-in-open-issues';
import './features/highlight-own-issues-and-prs';
import './features/comments-time-machine-links';
import './features/hide-issue-list-autocomplete';
import './features/esc-to-deselect-line';
Expand Down Expand Up @@ -139,7 +138,7 @@ import './features/revert-file';
import './features/hidden-review-comments-indicator';
import './features/reload-failed-proxied-images';
import './features/clean-rich-text-editor';
import './features/highlight-collaborators-in-lists';
import './features/highlight-collaborators-and-own-discussions';
import './features/embed-gist-via-iframe';

// Add global for easier debugging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import './highlight-collaborators-in-lists.css';
import './highlight-collaborators-and-own-discussions.css';
import select from 'select-dom';
import features from '../libs/features';
import {getRepoURL, getUsername} from '../libs/utils';
import fetchDom from '../libs/fetch-dom';

async function init(): Promise<false | void> {
async function highlightCollaborators(): Promise<false | void> {
const authors = select.all('.js-issue-row [data-hovercard-type="user"]');
if (authors.length === 0) {
return false;
Expand All @@ -13,7 +13,7 @@ async function init(): Promise<false | void> {
const dom = await fetchDom(getRepoURL() + '/issues/show_menu_content?partial=issues/filters/authors_content');
const collaborators = select.all('.select-menu-item-text', dom).map(collaborator => {
return collaborator.firstChild!.textContent!.trim();
}).filter(collaborator => collaborator !== getUsername());
});

for (const author of authors) {
if (collaborators.includes(author.textContent!.trim())) {
Expand All @@ -22,13 +22,33 @@ async function init(): Promise<false | void> {
}
}

function highlightSelf(): void {
// "Opened by {user}" and "Created by {user}"
for (const author of select.all(`.opened-by a[title$="ed by ${CSS.escape(getUsername())}"]`)) {
author.classList.add('rgh-collaborator');
author.style.fontStyle = 'italic';
}
}

features.add({
id: __featureName__,
description: 'Highlights discussions opened by the current repo’s collaborators.',
screenshot: 'https://user-images.githubusercontent.com/55841/64478536-0a5ca500-d1aa-11e9-8284-a39114d37824.png',
description: 'Highlights discussions opened by you or the current repo’s collaborators.',
screenshot: 'https://user-images.githubusercontent.com/1402241/65013882-03225d80-d947-11e9-8eb8-5507bc1fc14b.png',
include: [
features.isRepoDiscussionList
],
load: features.onAjaxedPages,
init: highlightCollaborators
});

features.add({
id: __featureName__,
description: '',
screenshot: false,
include: [
features.isDiscussionList
],
load: features.onAjaxedPages,
init
init: highlightSelf
});

21 changes: 0 additions & 21 deletions source/features/highlight-own-issues-and-prs.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion source/options-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ for (const feature of __featuresList__) {
}

const migrations = [
featureWasRenamed('make-discussion-sidebar-sticky', 'sticky-discussion-sidebar'), // Merged on August 1st
featureWasRenamed('linkify-code', 'linkify-urls-in-code'), // Merged on September 1st
featureWasRenamed('highlight-collaborators-in-lists', 'highlight-collaborators-and-own-discussions'), // Merged on September 20th

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will just be dropped by removeUnused

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, so highlight-collaborators-in-lists will be leading.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Migration are just to preserve disabled features, and highlight-own-issues-and-prs is such a minor feature to disable it just does not matter.


// Removed features will be automatically removed from the options as well
OptionsSync.migrations.removeUnused
Expand Down