diff options
author | 2023-09-21 09:03:57 +0800 | |
---|---|---|
committer | 2023-09-21 01:03:57 +0000 | |
commit | e9e650da9918a1af25c36c59249badfe3f8e0508 (patch) | |
tree | 67b1c75cc6a2b0dd1e749432c9e96970babb77d8 | |
parent | 78e4b2d1db40caa55af973196f22f054f66f594b (diff) | |
download | refined-github-e9e650da9918a1af25c36c59249badfe3f8e0508.tar.gz refined-github-e9e650da9918a1af25c36c59249badfe3f8e0508.tar.zst refined-github-e9e650da9918a1af25c36c59249badfe3f8e0508.zip |
`clean-repo-header` - Let users disable it (#6941)23.9.21
-rw-r--r-- | source/features/clean-repo-header.css | 34 | ||||
-rw-r--r-- | source/features/clean-repo-header.tsx | 14 | ||||
-rw-r--r-- | source/features/conversation-activity-filter.css | 20 | ||||
-rw-r--r-- | source/refined-github.ts | 2 |
4 files changed, 46 insertions, 24 deletions
diff --git a/source/features/clean-repo-header.css b/source/features/clean-repo-header.css index 8f423acb..95deff2e 100644 --- a/source/features/clean-repo-header.css +++ b/source/features/clean-repo-header.css @@ -1,19 +1,21 @@ -#repository-container-header:not(:has(.js-repo-nav)) /* Excludes pre-Global Navigation Update header */ -:is( - #repo-stars-counter-star, - #repo-stars-counter-unstar, - #repo-network-counter, /* Forks */ - #repo-notifications-counter, /* Watchers */ - .js-codespaces-details-container summary .Button-label /* Green "Code" button label */ -) { - display: none; -} +[rgh-clean-repo-header] { + #repository-container-header:not(:has(.js-repo-nav)) /* Excludes pre-Global Navigation Update header */ + :is( + #repo-stars-counter-star, + #repo-stars-counter-unstar, + #repo-network-counter, /* Forks */ + #repo-notifications-counter, /* Watchers */ + .js-codespaces-details-container summary .Button-label /* Green "Code" button label */ + ) { + display: none; + } -/* Hide text of "Edit Pins" dropdown button in header of organization repos https://github.com/refined-github/refined-github/pull/5612 */ -.pagehead-actions pin-organization-repo summary { - font-size: 0 !important; -} + /* Hide text of "Edit Pins" dropdown button in header of organization repos https://github.com/refined-github/refined-github/pull/5612 */ + .pagehead-actions pin-organization-repo summary { + font-size: 0 !important; + } -.pagehead-actions pin-organization-repo .octicon-pin { - vertical-align: middle !important; + .pagehead-actions pin-organization-repo .octicon-pin { + vertical-align: middle !important; + } } diff --git a/source/features/clean-repo-header.tsx b/source/features/clean-repo-header.tsx new file mode 100644 index 00000000..ddb56e5d --- /dev/null +++ b/source/features/clean-repo-header.tsx @@ -0,0 +1,14 @@ +import './clean-repo-header.css'; +import * as pageDetect from 'github-url-detection'; + +import features from '../feature-manager.js'; + +void features.addCssFeature(import.meta.url, [pageDetect.isRepoRoot]); + +/* + +## Test URLs + +https://github.com/refined-github/refined-github + +*/ diff --git a/source/features/conversation-activity-filter.css b/source/features/conversation-activity-filter.css index 29dab24e..6e766705 100644 --- a/source/features/conversation-activity-filter.css +++ b/source/features/conversation-activity-filter.css @@ -1,11 +1,17 @@ .rgh-conversation-activity-is-filtered .rgh-conversation-activity-filtered, -.rgh-conversation-activity-is-collapsed-filtered :is( - .rgh-conversation-activity-collapsed, - .js-resolvable-timeline-thread-container[data-resolved='true'], /* Resolved review thread */ - .js-resolvable-timeline-thread-container[data-resolved='false'] .minimized-comment, /* Minimized review thread comment */ -), -.rgh-conversation-activity-is-filtered .rgh-conversation-activity-filter-dropdown .octicon-eye, -.js-issues-results:not(.rgh-conversation-activity-is-filtered) .rgh-conversation-activity-filter-dropdown .octicon-eye-closed { +.rgh-conversation-activity-is-collapsed-filtered + :is( + .rgh-conversation-activity-collapsed, + .js-resolvable-timeline-thread-container[data-resolved='true'], + .js-resolvable-timeline-thread-container[data-resolved='false'] + .minimized-comment + ), +.rgh-conversation-activity-is-filtered + .rgh-conversation-activity-filter-dropdown + .octicon-eye, +.js-issues-results:not(.rgh-conversation-activity-is-filtered) + .rgh-conversation-activity-filter-dropdown + .octicon-eye-closed { display: none !important; /* For debugging purposes only */ /* display: block !important; */ diff --git a/source/refined-github.ts b/source/refined-github.ts index 2093c5e0..398a8646 100644 --- a/source/refined-github.ts +++ b/source/refined-github.ts @@ -21,7 +21,6 @@ import './features/readable-title-change-events.css'; import './features/clean-checks-list.css'; import './features/sticky-csv-header.css'; import './features/mark-private-repos.css'; -import './features/clean-repo-header.css'; // DO NOT add CSS files here if they are part of a JavaScript feature. // Import the `.css` file from the `.tsx` instead. @@ -33,6 +32,7 @@ import './features/hide-newsfeed-noise.js'; import './features/minimize-upload-bar.js'; import './features/hide-diff-signs.js'; import './features/clean-rich-text-editor.js'; +import './features/clean-repo-header.js'; // Disableable features import './features/useful-not-found-page.js'; |