summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar shine <4771718+shinenelson@users.noreply.github.com> 2021-10-07 20:26:39 +0530
committerGravatar GitHub <noreply@github.com> 2021-10-07 16:56:39 +0200
commite69a7872ce0479f35daef9fc5183b02b51d065ac (patch)
tree94fb0fe8448a203295d40e68662dadc7a8e84530
parent90ad3b20c70681ca0ee85ef341e1818a887f9462 (diff)
downloadrefined-github-e69a7872ce0479f35daef9fc5183b02b51d065ac.tar.gz
refined-github-e69a7872ce0479f35daef9fc5183b02b51d065ac.tar.zst
refined-github-e69a7872ce0479f35daef9fc5183b02b51d065ac.zip
Rename `navigate-pages-with-arrow-keys` to `pagination-hotkey` (#4743)
-rw-r--r--readme.md2
-rw-r--r--source/features/pagination-hotkey.tsx (renamed from source/features/navigate-pages-with-arrow-keys.tsx)15
-rw-r--r--source/options-storage.ts1
-rw-r--r--source/refined-github.ts2
4 files changed, 16 insertions, 4 deletions
diff --git a/readme.md b/readme.md
index 4645af36..c7c16175 100644
--- a/readme.md
+++ b/readme.md
@@ -373,7 +373,7 @@ Thanks for contributing! πŸ¦‹πŸ™Œ
- [](# "deprioritize-marketplace-link") Moves the "Marketplace" link from the black header bar to the profile dropdown.
- [](# "parse-backticks") [Renders `` `text in backticks` `` in issue titles, commit titles and more places.](https://user-images.githubusercontent.com/170270/55060505-31179b00-50a4-11e9-99a9-c3691ba38d66.png)
- [](# "trending-menu-item") Adds a `Trending` link to the global navbar and a keyboard shortcut: <kbd>g</kbd> <kbd>t</kbd>.
-- [](# "navigate-pages-with-arrow-keys") Adds shortcuts to navigate through pages with pagination: <kbd>←</kbd> and <kbd>β†’</kbd>.
+- [](# "pagination-hotkey") Adds shortcuts to navigate through pages with pagination: <kbd>←</kbd> and <kbd>β†’</kbd>.
- [](# "action-used-by-link") [Lets you see how others are using the current Action in the Marketplace.](https://user-images.githubusercontent.com/8360597/80250140-86d9c080-8673-11ea-9d28-f62faf9fd3d4.png)
- [](# "improve-shortcut-help") [Shows all of Refined GitHub’s new keyboard shortcuts in the help modal (<kbd>?</kbd> hotkey).](https://user-images.githubusercontent.com/29176678/36999174-9f07d33e-20bf-11e8-83e3-b3a9908a4b5f.png)
- [](# "global-search-filters") [Adds search filters in global search page: forks, private repos, own repos, authored commits.](https://user-images.githubusercontent.com/44045911/112261285-88a66c80-8ca6-11eb-82cb-933b72c57abd.png)
diff --git a/source/features/navigate-pages-with-arrow-keys.tsx b/source/features/pagination-hotkey.tsx
index 058b9dcb..77862e7e 100644
--- a/source/features/navigate-pages-with-arrow-keys.tsx
+++ b/source/features/pagination-hotkey.tsx
@@ -1,20 +1,21 @@
import select from 'select-dom';
+import * as pageDetect from 'github-url-detection';
import features from '.';
const nextPageButtonSelectors = [
'a.next_page', // Issue/PR list, Search
+ '.paginate-container.BtnGroup > :last-child', // Notifications
'.paginate-container > .BtnGroup > :last-child', // Commits
'.paginate-container > .pagination > :last-child', // Releases
- '.js-notifications-list-paginator-buttons > :last-child', // Notifications
'.prh-commit > .BtnGroup > :last-child', // PR Commits
];
const previousPageButtonSelectors = [
'a.previous_page', // Issue/PR list, Search
+ '.paginate-container.BtnGroup > :first-child', // Notifications
'.paginate-container > .BtnGroup > :first-child', // Commits
'.paginate-container > .pagination > :first-child', // Releases
- '.js-notifications-list-paginator-buttons > :first-child', // Notifications
'.prh-commit > .BtnGroup > :first-child', // PR Commits
];
@@ -35,5 +36,15 @@ void features.add(__filebasename, {
'β†’': 'Go to the next page',
'←': 'Go to the previous page',
},
+ // TODO: enable for isDiscussionList after #4695 is fixed
+ include: [
+ pageDetect.isConversationList,
+ pageDetect.isGlobalSearchResults,
+ pageDetect.isLabelList,
+ pageDetect.isNotifications,
+ pageDetect.isRepoCommitList,
+ pageDetect.isPRCommit,
+ pageDetect.isUserProfileRepoTab,
+ ],
init,
});
diff --git a/source/options-storage.ts b/source/options-storage.ts
index f18a2b13..59b5ce6f 100644
--- a/source/options-storage.ts
+++ b/source/options-storage.ts
@@ -36,6 +36,7 @@ const migrations = [
featureWasRenamed('hide-useless-newsfeed-events', 'hide-noisy-newsfeed-events'), // Merged in August
featureWasRenamed('no-useless-split-diff-view', 'no-unnecessary-split-diff-view'), // Merged in August
featureWasRenamed('unwrap-useless-dropdowns', 'unwrap-unnecessary-dropdowns'), // Merged in August
+ featureWasRenamed('navigate-pages-with-arrow-keys', 'pagination-hotkey'), // Merged in September
// Removed features will be automatically removed from the options as well
OptionsSyncPerDomain.migrations.removeUnused,
diff --git a/source/refined-github.ts b/source/refined-github.ts
index 902a3fc2..c6b9e88a 100644
--- a/source/refined-github.ts
+++ b/source/refined-github.ts
@@ -62,7 +62,7 @@ import './features/linkify-code';
import './features/download-folder-button';
import './features/linkify-branch-references';
import './features/open-all-conversations';
-import './features/navigate-pages-with-arrow-keys';
+import './features/pagination-hotkey';
import './features/conversation-links-on-repo-lists';
import './features/global-conversation-list-filters';
import './features/conversation-filters';