diff options
Diffstat (limited to 'source/features')
36 files changed, 44 insertions, 34 deletions
diff --git a/source/features/avoid-accidental-submissions.tsx b/source/features/avoid-accidental-submissions.tsx index d4722c6f..071fb755 100644 --- a/source/features/avoid-accidental-submissions.tsx +++ b/source/features/avoid-accidental-submissions.tsx @@ -64,6 +64,6 @@ void features.add(import.meta.url, { exclude: [ pageDetect.isBlank, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/batch-mark-files-as-viewed.tsx b/source/features/batch-mark-files-as-viewed.tsx index 9038ec27..fc182232 100644 --- a/source/features/batch-mark-files-as-viewed.tsx +++ b/source/features/batch-mark-files-as-viewed.tsx @@ -82,6 +82,6 @@ void features.add(import.meta.url, { include: [ pageDetect.isPRFiles, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/clear-pr-merge-commit-message.tsx b/source/features/clear-pr-merge-commit-message.tsx index cf3bec31..29ee203c 100644 --- a/source/features/clear-pr-merge-commit-message.tsx +++ b/source/features/clear-pr-merge-commit-message.tsx @@ -29,6 +29,6 @@ void features.add(import.meta.url, { ], onlyAdditionalListeners: true, awaitDomReady: false, - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/convert-pr-to-draft-improvements.tsx b/source/features/convert-pr-to-draft-improvements.tsx index e4fc8c25..d2a9142a 100644 --- a/source/features/convert-pr-to-draft-improvements.tsx +++ b/source/features/convert-pr-to-draft-improvements.tsx @@ -39,6 +39,6 @@ void features.add(import.meta.url, { include: [ pageDetect.isPRConversation, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/easy-toggle-commit-messages.tsx b/source/features/easy-toggle-commit-messages.tsx index 22e34bd4..b4e37220 100644 --- a/source/features/easy-toggle-commit-messages.tsx +++ b/source/features/easy-toggle-commit-messages.tsx @@ -31,6 +31,6 @@ void features.add(import.meta.url, { pageDetect.isSingleFile, ], awaitDomReady: false, - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/easy-toggle-files.tsx b/source/features/easy-toggle-files.tsx index 283daf07..a2909f72 100644 --- a/source/features/easy-toggle-files.tsx +++ b/source/features/easy-toggle-files.tsx @@ -25,6 +25,6 @@ void features.add(import.meta.url, { pageDetect.isGistRevision, ], awaitDomReady: false, - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/enable-file-links-in-compare-view.tsx b/source/features/enable-file-links-in-compare-view.tsx index 9aeb122a..4b4da0e4 100644 --- a/source/features/enable-file-links-in-compare-view.tsx +++ b/source/features/enable-file-links-in-compare-view.tsx @@ -66,7 +66,7 @@ void features.add(import.meta.url, { // If you're viewing changes from partial commits, ensure you're on the latest one. () => select.exists('.js-commits-filtered') && !select.exists('[aria-label="You are viewing the latest commit"]'), ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }, { asLongAs: [ @@ -76,5 +76,6 @@ void features.add(import.meta.url, { include: [ pageDetect.isCompare, ], + deduplicate: false, init, }); diff --git a/source/features/expand-all-hidden-comments.tsx b/source/features/expand-all-hidden-comments.tsx index 6e2f43fd..24fd6249 100644 --- a/source/features/expand-all-hidden-comments.tsx +++ b/source/features/expand-all-hidden-comments.tsx @@ -37,6 +37,6 @@ void features.add(import.meta.url, { include: [ pageDetect.isConversation, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/extend-diff-expander.tsx b/source/features/extend-diff-expander.tsx index b42f3e4a..090bbcac 100644 --- a/source/features/extend-diff-expander.tsx +++ b/source/features/extend-diff-expander.tsx @@ -20,6 +20,6 @@ void features.add(import.meta.url, { include: [ pageDetect.hasFiles, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/first-published-tag-for-merged-pr.tsx b/source/features/first-published-tag-for-merged-pr.tsx index ff691f45..671b1c08 100644 --- a/source/features/first-published-tag-for-merged-pr.tsx +++ b/source/features/first-published-tag-for-merged-pr.tsx @@ -118,6 +118,7 @@ void features.add(import.meta.url, { onPrMerge, ], onlyAdditionalListeners: true, + deduplicate: false, init() { void addLinkToCreateRelease(); }, diff --git a/source/features/fit-textareas.tsx b/source/features/fit-textareas.tsx index 8cae8593..91435136 100644 --- a/source/features/fit-textareas.tsx +++ b/source/features/fit-textareas.tsx @@ -45,6 +45,7 @@ void features.add(import.meta.url, { exclude: [ isSafari, ], + deduplicate: false, init, }, { include: [ @@ -53,10 +54,10 @@ void features.add(import.meta.url, { exclude: [ isSafari, ], - deduplicate: 'has-rgh-inner', additionalListeners: [ onPrMergePanelOpen, ], onlyAdditionalListeners: true, + deduplicate: false, init: fitPrCommitMessageBox, }); diff --git a/source/features/hidden-review-comments-indicator.tsx b/source/features/hidden-review-comments-indicator.tsx index 3191fa2e..d77701eb 100644 --- a/source/features/hidden-review-comments-indicator.tsx +++ b/source/features/hidden-review-comments-indicator.tsx @@ -78,6 +78,6 @@ void features.add(import.meta.url, { pageDetect.isPRFiles, pageDetect.isPRCommit, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/highlight-deleted-and-added-files-in-diffs.tsx b/source/features/highlight-deleted-and-added-files-in-diffs.tsx index 082714f2..07b70478 100644 --- a/source/features/highlight-deleted-and-added-files-in-diffs.tsx +++ b/source/features/highlight-deleted-and-added-files-in-diffs.tsx @@ -84,6 +84,7 @@ void features.add(import.meta.url, { onDiffFileLoad, ], onlyAdditionalListeners: true, + deduplicate: false, init, }); diff --git a/source/features/more-file-links.tsx b/source/features/more-file-links.tsx index 6cfad9c8..bbbaecc8 100644 --- a/source/features/more-file-links.tsx +++ b/source/features/more-file-links.tsx @@ -36,6 +36,6 @@ void features.add(import.meta.url, { include: [ pageDetect.hasFiles, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/one-click-diff-options.tsx b/source/features/one-click-diff-options.tsx index 298d8392..0de97cc7 100644 --- a/source/features/one-click-diff-options.tsx +++ b/source/features/one-click-diff-options.tsx @@ -142,5 +142,6 @@ void features.add(import.meta.url, { onDiffFileLoad, ], onlyAdditionalListeners: true, + deduplicate: false, init: initCommitAndCompare, }); diff --git a/source/features/one-click-review-submission.tsx b/source/features/one-click-review-submission.tsx index 96ac7244..74fff96e 100644 --- a/source/features/one-click-review-submission.tsx +++ b/source/features/one-click-review-submission.tsx @@ -83,7 +83,7 @@ function init(signal: AbortSignal): false | void { control.disabled = true; } }); - }); + }, {signal}); // This will prevent submission when clicking "Comment" and "Request changes" without entering a comment and no other review comments are pending delegate(form, 'button', 'click', ({delegateTarget: {value}}) => { diff --git a/source/features/one-key-formatting.tsx b/source/features/one-key-formatting.tsx index 1a85a52a..9095cdd1 100644 --- a/source/features/one-key-formatting.tsx +++ b/source/features/one-key-formatting.tsx @@ -45,6 +45,6 @@ void features.add(import.meta.url, { pageDetect.isDeletingFile, ], awaitDomReady: false, - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/pr-branch-auto-delete.tsx b/source/features/pr-branch-auto-delete.tsx index 2041d2fb..93e8d4a5 100644 --- a/source/features/pr-branch-auto-delete.tsx +++ b/source/features/pr-branch-auto-delete.tsx @@ -45,5 +45,6 @@ void features.add(import.meta.url, { onPrMerge, ], onlyAdditionalListeners: true, + deduplicate: false, init, }); diff --git a/source/features/pr-jump-to-first-non-viewed-file.tsx b/source/features/pr-jump-to-first-non-viewed-file.tsx index 3fae7e02..9388e2ee 100644 --- a/source/features/pr-jump-to-first-non-viewed-file.tsx +++ b/source/features/pr-jump-to-first-non-viewed-file.tsx @@ -27,6 +27,6 @@ void features.add(import.meta.url, { exclude: [ pageDetect.isPRFile404, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/prevent-duplicate-pr-submission.tsx b/source/features/prevent-duplicate-pr-submission.tsx index 2b03eb1f..201ee44b 100644 --- a/source/features/prevent-duplicate-pr-submission.tsx +++ b/source/features/prevent-duplicate-pr-submission.tsx @@ -21,5 +21,6 @@ void features.add(import.meta.url, { include: [ pageDetect.isCompare, ], + deduplicate: false, init, }); diff --git a/source/features/prevent-link-loss.tsx b/source/features/prevent-link-loss.tsx index a1a50870..67a4bf1c 100644 --- a/source/features/prevent-link-loss.tsx +++ b/source/features/prevent-link-loss.tsx @@ -73,6 +73,6 @@ void features.add(import.meta.url, { include: [ pageDetect.hasRichTextEditor, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/quick-comment-hiding.tsx b/source/features/quick-comment-hiding.tsx index ceba9644..0fff6713 100644 --- a/source/features/quick-comment-hiding.tsx +++ b/source/features/quick-comment-hiding.tsx @@ -84,6 +84,6 @@ void features.add(import.meta.url, { include: [ pageDetect.hasComments, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/quick-label-removal.tsx b/source/features/quick-label-removal.tsx index 671c0efe..6905af6a 100644 --- a/source/features/quick-label-removal.tsx +++ b/source/features/quick-label-removal.tsx @@ -70,6 +70,6 @@ void features.add(import.meta.url, { canNotEditLabels, pageDetect.isArchivedRepo, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/quick-review-comment-deletion.tsx b/source/features/quick-review-comment-deletion.tsx index 606809c5..2b0ec171 100644 --- a/source/features/quick-review-comment-deletion.tsx +++ b/source/features/quick-review-comment-deletion.tsx @@ -43,7 +43,6 @@ void features.add(import.meta.url, { pageDetect.isPRConversation, pageDetect.isPRFiles, ], - awaitDomReady: false, - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/restore-file.tsx b/source/features/restore-file.tsx index e994f4aa..eda879d5 100644 --- a/source/features/restore-file.tsx +++ b/source/features/restore-file.tsx @@ -137,6 +137,6 @@ void features.add(import.meta.url, { pageDetect.isPRFiles, pageDetect.isPRCommit, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/rgh-sponsor-button.tsx b/source/features/rgh-sponsor-button.tsx index 160a0525..ce774705 100644 --- a/source/features/rgh-sponsor-button.tsx +++ b/source/features/rgh-sponsor-button.tsx @@ -112,5 +112,6 @@ void features.add(import.meta.url, { pageDetect.isOwnUserProfile, pageDetect.isPrivateUserProfile, ], + deduplicate: false, init: handleSponsorButton, }); diff --git a/source/features/same-page-definition-jump.tsx b/source/features/same-page-definition-jump.tsx index 59890165..a7e3f2d8 100644 --- a/source/features/same-page-definition-jump.tsx +++ b/source/features/same-page-definition-jump.tsx @@ -19,5 +19,6 @@ void features.add(import.meta.url, { include: [ pageDetect.isSingleFile, ], + deduplicate: false, init, }); diff --git a/source/features/show-names.tsx b/source/features/show-names.tsx index ce2bd886..6cfbe261 100644 --- a/source/features/show-names.tsx +++ b/source/features/show-names.tsx @@ -84,6 +84,7 @@ void features.add(import.meta.url, { include: [ pageDetect.hasComments, ], - deduplicate: 'has-rgh-inner', + onlyAdditionalListeners: true, + deduplicate: false, init, }); diff --git a/source/features/show-whitespace.tsx b/source/features/show-whitespace.tsx index 96fc6e5a..e4f86b95 100644 --- a/source/features/show-whitespace.tsx +++ b/source/features/show-whitespace.tsx @@ -44,7 +44,7 @@ void features.add(import.meta.url, { onNewComments, onDiffFileLoad, ], - deduplicate: '.rgh-observing-whitespace', + deduplicate: false, init, }); diff --git a/source/features/stop-redirecting-in-notification-bar.tsx b/source/features/stop-redirecting-in-notification-bar.tsx index 383381df..bb464183 100644 --- a/source/features/stop-redirecting-in-notification-bar.tsx +++ b/source/features/stop-redirecting-in-notification-bar.tsx @@ -24,5 +24,6 @@ void features.add(import.meta.url, { hasNotificationBar, ], awaitDomReady: false, + deduplicate: false, init, }); diff --git a/source/features/suggest-commit-title-limit.tsx b/source/features/suggest-commit-title-limit.tsx index 038caabe..c4df0306 100644 --- a/source/features/suggest-commit-title-limit.tsx +++ b/source/features/suggest-commit-title-limit.tsx @@ -25,7 +25,7 @@ void features.add(import.meta.url, { pageDetect.isEditingFile, pageDetect.isPRConversation, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }, { include: [ @@ -36,7 +36,7 @@ void features.add(import.meta.url, { onPrCommitMessageRestore, ], onlyAdditionalListeners: true, - deduplicate: 'has-rgh-inner', + deduplicate: false, init: validateInput, }); diff --git a/source/features/sync-pr-commit-title.tsx b/source/features/sync-pr-commit-title.tsx index 1ce96ee0..94e18898 100644 --- a/source/features/sync-pr-commit-title.tsx +++ b/source/features/sync-pr-commit-title.tsx @@ -94,6 +94,6 @@ void features.add(import.meta.url, { include: [ pageDetect.isPRConversation, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/toggle-everything-with-alt.tsx b/source/features/toggle-everything-with-alt.tsx index 7c461d74..9398d0a6 100644 --- a/source/features/toggle-everything-with-alt.tsx +++ b/source/features/toggle-everything-with-alt.tsx @@ -53,6 +53,6 @@ void features.add(import.meta.url, { pageDetect.hasFiles, pageDetect.isCommitList, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/unfinished-comments.tsx b/source/features/unfinished-comments.tsx index 0e2b37d5..7c008625 100644 --- a/source/features/unfinished-comments.tsx +++ b/source/features/unfinished-comments.tsx @@ -45,6 +45,6 @@ void features.add(import.meta.url, { include: [ pageDetect.hasRichTextEditor, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/update-pr-from-base-branch.tsx b/source/features/update-pr-from-base-branch.tsx index c3c7801c..5f5c11ac 100644 --- a/source/features/update-pr-from-base-branch.tsx +++ b/source/features/update-pr-from-base-branch.tsx @@ -10,7 +10,7 @@ import * as api from '../github-helpers/api'; import getPrInfo from '../github-helpers/get-pr-info'; import {getConversationNumber} from '../github-helpers'; -const selectorForPushablePRNotice = '.merge-pr > :is(.color-text-secondary, .color-fg-muted):first-child:not(.rgh-update-pr)'; +const selectorForPushablePRNotice = '.merge-pr > :is(.color-text-secondary, .color-fg-muted):first-child'; let observer: Observer; function getBranches(): {base: string; head: string} { @@ -69,20 +69,20 @@ async function addButton(position: Element): Promise<void> { async function init(signal: AbortSignal): Promise<false | Deinit> { await api.expectToken(); + delegate(document, '.rgh-update-pr-from-base-branch', 'click', handler, {signal}); + // Quick check before using selector-observer on it if (!select.exists(selectorForPushablePRNotice)) { return false; } - observer = observe(selectorForPushablePRNotice, { + observer = observe(`:is(${selectorForPushablePRNotice}):not(.rgh-update-pr)`, { add(position) { position.classList.add('rgh-update-pr'); void addButton(position); }, }); - delegate(document, '.rgh-update-pr-from-base-branch', 'click', handler, {signal}); - return observer; } @@ -97,7 +97,7 @@ void features.add(import.meta.url, { // Native button https://github.blog/changelog/2022-02-03-more-ways-to-keep-your-pull-request-branch-up-to-date/ () => select.exists('.js-update-branch-form'), ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); diff --git a/source/features/wait-for-checks.tsx b/source/features/wait-for-checks.tsx index c9a44a02..d2f1a48d 100644 --- a/source/features/wait-for-checks.tsx +++ b/source/features/wait-for-checks.tsx @@ -192,6 +192,6 @@ void features.add(import.meta.url, { exclude: [ pageDetect.isDraftPR, ], - deduplicate: 'has-rgh-inner', + deduplicate: false, init, }); |