summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Timon Jurschitsch <103483059+DerTimonius@users.noreply.github.com> 2023-11-07 13:19:22 +0100
committerGravatar GitHub <noreply@github.com> 2023-11-07 20:19:22 +0800
commit4bf9306fd02592ab851cd1a5d85b900817ad4d04 (patch)
tree703492c059a548f54ae9a76e344879cd9cff4e55
parent539980750d8dd745f080c25400b0cf85855903a3 (diff)
downloadrefined-github-4bf9306fd02592ab851cd1a5d85b900817ad4d04.tar.gz
refined-github-4bf9306fd02592ab851cd1a5d85b900817ad4d04.tar.zst
refined-github-4bf9306fd02592ab851cd1a5d85b900817ad4d04.zip
`pr-jump-to-first-non-viewed-file` - Restore feature in all PRs (#7033)
Co-authored-by: Federico Brigante <me@fregante.com>
-rw-r--r--source/features/pr-jump-to-first-non-viewed-file.tsx11
1 files changed, 10 insertions, 1 deletions
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 eb1f2d2c..59859c51 100644
--- a/source/features/pr-jump-to-first-non-viewed-file.tsx
+++ b/source/features/pr-jump-to-first-non-viewed-file.tsx
@@ -6,7 +6,7 @@ import * as pageDetect from 'github-url-detection';
import features from '../feature-manager.js';
function jumpToFirstNonViewed(): void {
- const firstNonViewedFile = $('.file:not([data-file-user-viewed])')!;
+ const firstNonViewedFile = $('[id][data-details-container-group="file"]:not([data-file-user-viewed])')!;
if (firstNonViewedFile) {
// Scroll to file without pushing to history
location.replace('#' + firstNonViewedFile.id);
@@ -32,3 +32,12 @@ void features.add(import.meta.url, {
],
init,
});
+
+/*
+
+Test URLs:
+
+PR: https://github.com/refined-github/sandbox/pull/55/files
+Large PR https://github.com/pixiebrix/pixiebrix-extension/pull/6808/files
+
+*/