-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Minor code fixes and tweaks #9418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6214368
1b0221d
8682659
3166f02
4f40e5a
7f5b0c6
035947e
779511d
462be4d
f748ed5
d4d945c
d2f9d4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| import * as pageDetect from 'github-url-detection'; | ||
| import {elementExists, $$} from 'select-dom'; | ||
| import {elementExists, $$optional} from 'select-dom'; | ||
|
|
||
| import features from '../feature-manager.js'; | ||
|
|
||
| // This feature doesn't need an active observer | ||
| function init(): void { | ||
| // Selects all the deployments first so that we can leave the last one on the page | ||
| const deployments = $$('.js-socket-channel[data-gid^="PR"]:has(.octicon-rocket)'); | ||
| const deployments = $$optional('.js-socket-channel[data-gid^="PR"]:has(.octicon-rocket)'); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #9256 broke it |
||
| deployments.pop(); // Don't hide the last deployment, even if it is inactive | ||
|
|
||
| for (const deployment of deployments) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import './reactions-avatars.css'; | |
| import React from 'dom-chef'; | ||
| import {flatZip} from 'flat-zip'; | ||
| import * as pageDetect from 'github-url-detection'; | ||
| import {$$} from 'select-dom'; | ||
| import {$$optional} from 'select-dom'; | ||
|
|
||
| import {onAbort} from 'abort-utils'; | ||
|
|
||
|
|
@@ -73,12 +73,16 @@ const viewportObserver = new IntersectionObserver(changes => { | |
| rootMargin: '500px', | ||
| }); | ||
|
|
||
| function showAvatarsOn(commentReactions: Element): void { | ||
| const reactions = $$([ | ||
| 'button[aria-pressed]', // Discussions, releases, PRs, old issues | ||
| 'button[aria-checked]', // React issues | ||
| ], commentReactions) | ||
| function showAvatarsOn(reactionsContainer: Element): void { | ||
| const reactions = $$optional([ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #9256 broke it |
||
| 'button[aria-pressed]', // Discussions, releases, PRs | ||
| 'button[aria-checked]', // Issues | ||
| ], reactionsContainer) | ||
| .map(button => getParticipants(button)); // Get all participants for each reaction | ||
| if (reactions.length === 0) { | ||
| return; | ||
| } | ||
|
|
||
| const avatarLimit = arbitraryAvatarLimit - (reactions.length * approximateHeaderLength); | ||
| const flatParticipants = flatZip(reactions, avatarLimit); | ||
|
|
||
|
|
@@ -107,7 +111,7 @@ function init(signal: AbortSignal): void { | |
| [ | ||
| // `batch-deferred-content` means the participant list hasn't loaded yet | ||
| '.has-reactions .js-comment-reactions-options:not(batch-deferred-content .js-comment-reactions-options)', | ||
| '[aria-label="Reactions"]', | ||
| 'div[aria-label="Reactions"]', | ||
| ], | ||
| observeCommentReactions, | ||
| {signal}, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,11 +46,7 @@ export const branchSelector_ = [ | |
| export const branchSelectorParent = 'details#branch-select-menu'; | ||
| export const branchSelectorParent_ = branchSelector_; | ||
|
|
||
| export const directoryListingFileIcon = [ | ||
| // .color-fg-muted selects only files; some icon extensions use `img` tags | ||
| '.react-directory-filename-column > :is(svg, img).color-fg-muted', | ||
| '.js-navigation-container .octicon-file', | ||
| ]; | ||
| export const directoryListingFileIcon = '.react-directory-filename-column > .octicon-file'; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extracted from #9110
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tested with "Catppuccin" and "Material Icons" extensions |
||
| export const directoryListingFileIcon_ = [ | ||
| [18, 'https://github.com/refined-github/refined-github'], | ||
| [3, 'https://github.com/refined-github/refined-github/tree/main/.github'], | ||
|
|
||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't fix anything |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes #9401