Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Co-authored-by: Federico <[email protected]>
  • Loading branch information
yakov116 and fregante authored Oct 1, 2020
1 parent 6e7bf4f commit d7d700a
Show file tree
Hide file tree
Showing 40 changed files with 71 additions and 124 deletions.
4 changes: 2 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function init () {

features.add({
id: __filebasename,
description: 'Simplify the GitHub interface and adds useful features',
description: 'Simplify the GitHub interface and adds useful features.',
screenshot: 'https://user-images.githubusercontent.com/1402241/58238638-3cbcd080-7d7a-11e9-80f6-be6c0520cfed.jpg',
}, {
include: [
Expand Down Expand Up @@ -58,7 +58,7 @@ function init(): void {

features.add({
id: __filebasename,
description: 'Simplify the GitHub interface and adds useful features',
description: 'Simplify the GitHub interface and adds useful features.',
screenshot: 'https://user-images.githubusercontent.com/1402241/58238638-3cbcd080-7d7a-11e9-80f6-be6c0520cfed.jpg',
shortcuts: { // This only adds the shortcut to the help screen, it doesn't enable it
'': 'Edit your last comment'
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"fit-textarea": "^2.0.0",
"flat-zip": "^1.0.1",
"github-reserved-names": "^2.0.0",
"github-url-detection": "^3.0.0",
"github-url-detection": "^4.0.0",
"image-promise": "^7.0.1",
"indent-textarea": "^2.0.2",
"linkify-issues": "^2.0.0",
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Thanks for contributing! 🦋🙌
- [](# "swap-branches-on-compare") [Adds link to swap branches in the branch compare view.](https://user-images.githubusercontent.com/857700/42854438-821096f2-8a01-11e8-8752-76f7563b5e18.png)
- [](# "hide-zero-packages") [Hides the `Packages` tab in repositories if it’s empty.](https://user-images.githubusercontent.com/44045911/93543684-d1473b00-f98e-11ea-9957-e4464400f81b.png)
- [](# "forked-to") [Adds a shortcut to your forks next to the `Fork` button on the current repo.](https://user-images.githubusercontent.com/55841/64077281-17bbf000-cccf-11e9-9123-092063f65357.png)
- [](# "repo-age") [Adds the age of the repository to the statistics bar.](https://user-images.githubusercontent.com/3848317/69494069-7d2b1180-0eb7-11ea-9aa1-d4194e566340.png)
- [](# "repo-age") [Displays the age of the repository in the sidebar.](https://user-images.githubusercontent.com/3848317/69494069-7d2b1180-0eb7-11ea-9aa1-d4194e566340.png)
- [](# "show-open-prs-of-forks") [In your forked repos, shows number of your open PRs to the original repo.](https://user-images.githubusercontent.com/1922624/76398271-e0648500-637c-11ea-8210-53dda1be9d51.png)
- [](# "go-to-action-from-file") [Adds a link to access the past runs of a GitHub Action workflow when seeing the workflow configuration file.](https://user-images.githubusercontent.com/1402241/80146153-ab6d6400-85b1-11ea-9f38-e87950692a62.png)
- [](# "clone-branch") [Clone a branch from the branches list.](https://user-images.githubusercontent.com/16872793/76802029-2a020500-67ad-11ea-95dc-bee1b1352976.png)
Expand Down Expand Up @@ -248,7 +248,7 @@ Thanks for contributing! 🦋🙌
- [](# "quick-review-buttons") [Simplifies the PR review form: Approve or reject reviews faster with one-click review-type buttons.](https://user-images.githubusercontent.com/1402241/34326942-529cb7c0-e8f3-11e7-9bee-98b667e18a90.png)
- [](# "warn-pr-from-master") [Warns you when creating a pull request from the default branch, as it’s an anti-pattern.](https://user-images.githubusercontent.com/1402241/52543516-3ca94e00-2de5-11e9-9f80-ff8f9fe8bdc4.png)
- [](# "warning-for-disallow-edits") [Warns you when unchecking `Allow edits from maintainers`, as it’s maintainer-hostile.](https://user-images.githubusercontent.com/1402241/53151888-24101380-35ef-11e9-8d30-d6315ad97325.gif)
- [](# "pull-request-hotkey") Adds keyboard shortcuts to cycle through PR tabs: <kbd>g</kbd> <kbd>←</kbd> and <kbd>g</kbd> <kbd>→</kbd>, or <kbd>g</kbd> <kbd>1</kbd>, <kbd>g</kbd> <kbd>2</kbd>, <kbd>g</kbd> <kbd>3</kbd> and <kbd>g</kbd> <kbd>4</kbd>.
- [](# "pull-request-hotkey") [Adds keyboard shortcuts to cycle through PR tabs: <kbd>g</kbd> <kbd>←</kbd> and <kbd>g</kbd> <kbd>→</kbd>, or <kbd>g</kbd> <kbd>1</kbd>, <kbd>g</kbd> <kbd>2</kbd>, <kbd>g</kbd> <kbd>3</kbd> and <kbd>g</kbd> <kbd>4</kbd>](https://user-images.githubusercontent.com/16872793/94634958-7e7b5680-029f-11eb-82ea-1f96cd11e4cd.png).
- [](# "pr-branch-auto-delete") Automatically deletes the branch right after merging a PR, if possible.
- [](# "separate-draft-pr-button") [Lets you create draft pull requests in one click.](https://user-images.githubusercontent.com/202916/67269317-cd791300-f4b6-11e9-89d1-392de7ef71e1.png)
- [](# "clear-pr-merge-commit-message") [Clears the PR merge commit message of clutter, leaving only deduplicated co-authors.](https://user-images.githubusercontent.com/1402241/79257078-62b6fc00-7e89-11ea-8798-c06f33baa94b.png)
Expand All @@ -269,7 +269,7 @@ Thanks for contributing! 🦋🙌
- [](# "remove-diff-signs") [Hides diff signs](https://user-images.githubusercontent.com/1402241/54807718-149cec80-4cb9-11e9-869c-e265863211e3.png) (since diffs are color coded already.)
- [](# "suggest-commit-title-limit") [Suggest limiting commit titles to 72 characters.](https://user-images.githubusercontent.com/37769974/60379478-106b3280-9a51-11e9-88b9-0e3607f214cd.gif)
- [](# "expand-all-collapsed-code") [Expands the entire file when you <kbd>alt</kbd> <kbd>click</kbd> on any "Expand code" button in diffs.](https://user-images.githubusercontent.com/44227187/64923605-d0138900-d7e3-11e9-9dc2-461aba81c1cb.gif)
- [](# "add-tag-to-commits") [Displays the corresponding tags next to commits.](https://user-images.githubusercontent.com/14323370/66400400-64ba7280-e9af-11e9-8d6c-07b35afde91f.png)
- [](# "tags-on-commits-list") [Displays the corresponding tags next to commits.](https://user-images.githubusercontent.com/14323370/66400400-64ba7280-e9af-11e9-8d6c-07b35afde91f.png)
- [](# "mark-merge-commits-in-list") [Marks merge commits in commit lists.](https://user-images.githubusercontent.com/16872793/75561016-457eb900-5a14-11ea-95e1-a89e81ee7390.png)
- [](# "deep-reblame") [When exploring blames, `Alt`-clicking the “Reblame” buttons will extract the associated PR’s commits first, instead of treating the commit a single change.](https://user-images.githubusercontent.com/16872793/77248541-8e3f2180-6c10-11ea-91d4-221ccc0ecebb.png)
- [](# "highlight-deleted-and-added-files-in-diffs") [Indicates with an icon whether files in commits and pull requests being added or removed.](https://user-images.githubusercontent.com/1402241/90332474-23262b00-dfb5-11ea-9a03-8fd676ea0fdd.png)
Expand All @@ -296,7 +296,7 @@ Thanks for contributing! 🦋🙌
- [](# "mark-private-orgs") [Marks private organizations on your own profile.](https://user-images.githubusercontent.com/6775216/44633467-d5dcc900-a959-11e8-9116-e6b0ffef66af.png)
- [](# "profile-hotkey") Adds a keyboard shortcut to visit your own profile: <kbd>g</kbd> <kbd>m</kbd>.
- [](# "show-user-top-repositories") [Adds a link to the user’s most starred repositories.](https://user-images.githubusercontent.com/1402241/48474026-43e3ae80-e82c-11e8-93de-159ad4c6f283.png)
- [](# "set-default-repositories-type-to-sources") [Hides forks and archived repos from profiles (but they can still be shown.)](https://user-images.githubusercontent.com/1402241/45133648-fe21be80-b1c8-11e8-9052-e38cb443efa9.png)
- [](# "set-default-repositories-type-to-sources") [Hides forks and archived repos from profiles (but they can still be shown).](https://user-images.githubusercontent.com/1402241/45133648-fe21be80-b1c8-11e8-9052-e38cb443efa9.png)
- [](# "linkify-user-location") [Linkifies the user location in their hovercard and profile page.](https://user-images.githubusercontent.com/1402241/69076885-00d3a100-0a67-11ea-952a-690acec0826f.png)
- [](# "user-local-time") [Shows the user local time in their hovercard (based on their last commit).](https://user-images.githubusercontent.com/1402241/69863648-ef449180-12cf-11ea-8f36-7c92fc487f31.gif)
- [](# "hide-zero-packages") [Hides the `Packages` tab on user profiles if it’s empty.](https://user-images.githubusercontent.com/35382021/62426530-688ef780-b6d5-11e9-93f2-515110aed1eb.jpg)
Expand Down
2 changes: 1 addition & 1 deletion source/features/action-used-by-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void features.add({
screenshot: 'https://user-images.githubusercontent.com/8360597/80250140-86d9c080-8673-11ea-9d28-f62faf9fd3d4.png'
}, {
include: [
pageDetect.isActionPage
pageDetect.isMarketplaceAction
],
init
});
8 changes: 2 additions & 6 deletions source/features/bugs-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ const countBugs = cache.function(async (): Promise<number> => {

return search.issueCount;
}, {
maxAge: {
minutes: 30
},
staleWhileRevalidate: {
days: 4
},
maxAge: {minutes: 30},
staleWhileRevalidate: {days: 4},
cacheKey: (): string => __filebasename + ':' + getRepoURL()
});

Expand Down
8 changes: 2 additions & 6 deletions source/features/clean-conversation-filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ const hasAnyProjects = cache.function(async (): Promise<boolean> => {

return Boolean(repository.projects.totalCount) && Boolean(organization?.projects?.totalCount);
}, {
maxAge: {
days: 1
},
staleWhileRevalidate: {
days: 20
},
maxAge: {days: 1},
staleWhileRevalidate: {days: 20},
cacheKey: () => `has-projects:${getRepoURL()}`
});

Expand Down
2 changes: 1 addition & 1 deletion source/features/conflict-marker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async function init(): Promise<false | void> {

void features.add({
id: __filebasename,
description: 'Shows which PRs have conflicts in PR lists',
description: 'Shows which PRs have conflicts in PR lists.',
screenshot:
'https://user-images.githubusercontent.com/9092510/62777551-2affe500-baae-11e9-8ba4-67f078347913.png'
}, {
Expand Down
3 changes: 1 addition & 2 deletions source/features/conversation-links-on-repo-lists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ void features.add({
}, {
include: [
pageDetect.isUserProfileRepoTab,
pageDetect.isGlobalSearchResults,
pageDetect.isUserProfileRepoTab
pageDetect.isGlobalSearchResults
],
init: onetime(init)
});
2 changes: 1 addition & 1 deletion source/features/cross-deleted-pr-branches.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function init(): void | false {

void features.add({
id: __filebasename,
description: 'Adds a line-through to the deleted branches in PRs',
description: 'Adds a line-through to the deleted branches in PRs.',
screenshot: 'https://user-images.githubusercontent.com/16872793/75619638-9bef1300-5b4c-11ea-850e-3a8f95c86d83.png'
}, {
include: [
Expand Down
2 changes: 1 addition & 1 deletion source/features/download-folder-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function init(): void {

void features.add({
id: __filebasename,
description: 'Adds a button to a download button entire folders, via https://download-directory.github.io',
description: 'Adds a button to a download button entire folders, via https://download-directory.github.io.',
screenshot: 'https://user-images.githubusercontent.com/1402241/35044451-fd3e2326-fbc2-11e7-82e1-61ec7bee612b.png'
}, {
include: [
Expand Down
8 changes: 2 additions & 6 deletions source/features/forked-to.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ const updateCache = cache.function(async (): Promise<string[] | undefined> => {

return forks.length > 0 ? forks : undefined;
}, {
maxAge: {
hours: 1
},
staleWhileRevalidate: {
days: 5
},
maxAge: {hours: 1},
staleWhileRevalidate: {days: 5},
cacheKey: getCacheKey
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ const getCollaborators = cache.function(async (): Promise<string[]> => {
.all<HTMLImageElement>('.SelectMenu-item [alt]', dom)
.map(avatar => avatar.alt.slice(1));
}, {
maxAge: {
days: 1
},
staleWhileRevalidate: {
days: 20
},
maxAge: {days: 1},
staleWhileRevalidate: {days: 20},
cacheKey: () => 'repo-collaborators:' + getRepoURL()
});

Expand Down
2 changes: 1 addition & 1 deletion source/features/improve-shortcut-help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function init(): void {

void features.add({
id: __filebasename,
description: 'Show Refined GitHub’s keyboard shortcuts in the help modal (`?` hotkey)',
description: 'Show Refined GitHub’s keyboard shortcuts in the help modal (`?` hotkey).',
screenshot: 'https://user-images.githubusercontent.com/29176678/36999174-9f07d33e-20bf-11e8-83e3-b3a9908a4b5f.png'
}, {
awaitDomReady: false,
Expand Down
4 changes: 1 addition & 3 deletions source/features/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ const checkForHotfixes = cache.function(async () => {

return hotfixes;
}, {
maxAge: {
hours: 6
},
maxAge: {hours: 6},
cacheKey: () => 'hotfix'
});

Expand Down
8 changes: 2 additions & 6 deletions source/features/latest-tag-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,8 @@ const getRepoPublishState = cache.function(async (): Promise<RepoPublishState> =

return {latestTag, aheadBy};
}, {
maxAge: {
hours: 1
},
staleWhileRevalidate: {
days: 2
},
maxAge: {hours: 1},
staleWhileRevalidate: {days: 2},
cacheKey: () => `tag-ahead-by:${getRepoURL()}`
});

Expand Down
8 changes: 2 additions & 6 deletions source/features/list-prs-for-file.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,8 @@ const getPrsByFile = cache.function(async (): Promise<Record<string, number[]>>

return files;
}, {
maxAge: {
hours: 2
},
staleWhileRevalidate: {
days: 9
},
maxAge: {hours: 2},
staleWhileRevalidate: {days: 9},
cacheKey: () => __filebasename + ':' + getRepoURL()
});

Expand Down
4 changes: 1 addition & 3 deletions source/features/mark-private-orgs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const getPublicOrganizationsNames = cache.function(async (username: string): Pro
const response = await api.v3(`users/${username}/orgs`);
return response.map((organization: AnyObject) => organization.login);
}, {
maxAge: {
days: 10
},
maxAge: {days: 10},
cacheKey: ([username]) => __filebasename + ':' + username
});

Expand Down
2 changes: 1 addition & 1 deletion source/features/parse-backticks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function init(): void {
'.release-header', // `isReleasesOrTags` Headers
'.existing-pull-contents .list-group-item-link', // `isCompare` with existing PR
'#pull-requests a.link-gray-dark', // `isPulse` issue and PR title
'[id^="check_suite"] a.link-gray-dark', // `isActions`
'[id^="check_suite"] a.link-gray-dark', // `isRepositoryActions`
'.checks-summary-conclusion + .flex-auto .f3', // `isActions` run
'.js-wiki-sidebar-toggle-display a', // `isWiki` sidebar pages title
'.wiki-wrapper .gh-header-title', // `isWiki` page title
Expand Down
4 changes: 1 addition & 3 deletions source/features/pinned-issues-update-time.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const getLastUpdated = cache.function(async (issueNumbers: number[]): Promise<Re

return repository;
}, {
maxAge: {
minutes: 30
},
maxAge: {minutes: 30},
cacheKey: ([issues]) => __filebasename + ':' + getRepoURL() + ':' + String(issues)
});

Expand Down
4 changes: 1 addition & 3 deletions source/features/pr-filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ const hasChecks = cache.function(async (): Promise<boolean> => {

return repository.head.history.nodes.some((commit: AnyObject) => commit.statusCheckRollup);
}, {
maxAge: {
days: 3
},
maxAge: {days: 3},
cacheKey: () => __filebasename + ':' + getRepoURL()
});

Expand Down
8 changes: 2 additions & 6 deletions source/features/profile-gists-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ const getGistCount = cache.function(async (username: string): Promise<number> =>
`);
return user.gists.totalCount;
}, {
maxAge: {
days: 1
},
staleWhileRevalidate: {
days: 3
},
maxAge: {days: 1},
staleWhileRevalidate: {days: 3},
cacheKey: ([username]) => 'gist-count:' + username
});

Expand Down
9 changes: 6 additions & 3 deletions source/features/pull-request-hotkey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ function init(): void {
'.tabnav-pr .tabnav-tab', // Pre "Repository refresh" layout
'.tabnav-tabs .tabnav-tab'
]);
const selectedIndex = tabs.indexOf(select('.tabnav-pr .selected')!);
const selectedIndex = tabs.indexOf(select([
'.tabnav-pr .selected', // Pre "Repository refresh" layout
'.tabnav-tabs .selected'
])!);
const lastTab = tabs.length - 1;

for (const [index, tab] of tabs.entries()) {
Expand All @@ -25,8 +28,8 @@ function init(): void {

void features.add({
id: __filebasename,
description: 'Adds keyboard shortcuts to cycle through PR tabs: `g` `←` and `g` `→`, or `g` `1`, `g` `2`, `g` `3` and `g` `4`',
screenshot: false,
description: 'Adds keyboard shortcuts to cycle through PR tabs: `g` `←` and `g` `→`, or `g` `1`, `g` `2`, `g` `3` and `g` `4`.',
screenshot: 'https://user-images.githubusercontent.com/16872793/94634958-7e7b5680-029f-11eb-82ea-1f96cd11e4cd.png',
shortcuts: {
'g 1': 'Go to Conversation',
'g 2': 'Go to Commits',
Expand Down
2 changes: 1 addition & 1 deletion source/features/reactions-avatars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function init(): void {

void features.add({
id: __filebasename,
description: 'Adds reaction avatars showing *who* reacted to a comment',
description: 'Adds reaction avatars showing *who* reacted to a comment.',
screenshot: 'https://user-images.githubusercontent.com/1402241/34438653-f66535a4-ecda-11e7-9406-2e1258050cfa.png'
}, {
include: [
Expand Down
8 changes: 2 additions & 6 deletions source/features/releases-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,8 @@ async function fetchFromApi(): Promise<number> {
}

const getReleaseCount = cache.function(async () => pageDetect.isRepoRoot() ? parseCountFromDom() : fetchFromApi(), {
maxAge: {
hours: 1
},
staleWhileRevalidate: {
days: 3
},
maxAge: {hours: 1},
staleWhileRevalidate: {days: 3},
cacheKey: () => cacheKey
});

Expand Down
2 changes: 1 addition & 1 deletion source/features/repo-age.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async function init(): Promise<void> {

void features.add({
id: __filebasename,
description: 'Adds the age of the repository to the stats/numbers bar',
description: 'Displays the age of the repository in the sidebar.',
screenshot: 'https://user-images.githubusercontent.com/3848317/69256318-95e6af00-0bb9-11ea-84c8-c6996d39da80.png'
}, {
include: [
Expand Down
2 changes: 1 addition & 1 deletion source/features/resolve-conflicts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function init(): Promise<void> {

void features.add({
id: __filebasename,
description: 'Fix merge conflicts in a click',
description: 'Fix merge conflicts in a click.',
screenshot: 'https://user-images.githubusercontent.com/1402241/54978791-45906080-4fdc-11e9-8fe1-45374f8ff636.png'
}, {
include: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function init(): void {

void features.add({
id: __filebasename,
description: 'Hides forks and archived repos from profiles (but they can still be shown.)',
description: 'Hides forks and archived repos from profiles (but they can still be shown).',
screenshot: 'https://user-images.githubusercontent.com/1402241/45133648-fe21be80-b1c8-11e8-9052-e38cb443efa9.png'
}, {
init
Expand Down
8 changes: 2 additions & 6 deletions source/features/show-associated-branch-prs-on-fork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ const getPullRequestsAssociatedWithBranch = cache.function(async (): Promise<Rec

return pullRequests;
}, {
maxAge: {
hours: 1
},
staleWhileRevalidate: {
days: 4
},
maxAge: {hours: 1},
staleWhileRevalidate: {days: 4},
cacheKey: () => 'associatedBranchPullRequests:' + getRepoURL()
});

Expand Down
2 changes: 1 addition & 1 deletion source/features/show-followers-you-know.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function init(): Promise<false | void> {
void features.add({
id: __filebasename,
disabled: '#3345',
description: 'Followers you know are shown on profile pages',
description: 'Followers you know are shown on profile pages.',
screenshot: 'https://user-images.githubusercontent.com/2906365/42009293-b1503f62-7a57-11e8-88f5-9c2fb3651a14.png'
}, {
include: [
Expand Down
Loading

0 comments on commit d7d700a

Please sign in to comment.