-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve cleanup-repo-filelist-actions’s reliability
#3531
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
5305582
a8bb89a
cb4c5fd
083ee43
5437e4b
2902cca
c1be24d
e082eef
0a4ef6d
dc52cfb
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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import React from 'dom-chef'; | ||
| import onetime from 'onetime'; | ||
| import {observe} from 'selector-observer'; | ||
| import PlusIcon from 'octicon/plus.svg'; | ||
| import SearchIcon from 'octicon/search.svg'; | ||
| import * as pageDetect from 'github-url-detection'; | ||
|
|
||
| import features from '.'; | ||
|
|
||
| function init(): void { | ||
| // Only select desktop version of the button | ||
| observe('.d-flex > [data-hotkey="t"]:not(.rgh-clean-actions)', { | ||
| add(searchButton) { | ||
| searchButton.classList.add('tooltipped', 'tooltipped-ne', 'rgh-clean-actions'); | ||
| searchButton.setAttribute('aria-label', 'Go to file'); | ||
|
|
||
| searchButton.firstChild!.replaceWith(<SearchIcon/>); | ||
|
|
||
| // Exclude logged out, mobile or file pages | ||
| const addButtonText = searchButton.nextElementSibling?.querySelector('.d-md-flex'); | ||
| if (addButtonText) { | ||
| addButtonText.parentElement!.classList.add('tooltipped', 'tooltipped-ne'); | ||
|
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. 👇 (if
Member
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. In what case it's not a summary? My understanding is that it's a summary when it's a dropdown, and it always is. |
||
| addButtonText.parentElement!.setAttribute('aria-label', 'Add file'); | ||
|
|
||
| addButtonText.classList.replace('d-md-flex', 'd-md-block'); | ||
| addButtonText.firstChild!.replaceWith(<PlusIcon/>); | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| observe('get-repo summary:not(.rgh-clean-actions)', { | ||
| add(button) { | ||
| button.classList.add('tooltipped', 'tooltipped-ne', 'rgh-clean-actions'); | ||
|
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. Could you check if click outside to close works?. That's the reason I moved that classes from |
||
| button.setAttribute('aria-label', 'Clone, open or download'); | ||
|
|
||
| button.firstElementChild!.nextSibling!.remove(); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| void features.add({ | ||
| id: __filebasename, | ||
| description: 'Replaces the labels of some simple buttons on repository filelists with icons, making them take less space.', | ||
| screenshot: 'https://user-images.githubusercontent.com/44045911/96283396-bbb94580-100e-11eb-9480-17954bb3a811.png' | ||
| }, { | ||
| include: [ | ||
| pageDetect.isRepoTree, | ||
| pageDetect.isSingleFile | ||
| ], | ||
| exclude: [ | ||
| pageDetect.isEmptyRepo | ||
| ], | ||
| init: onetime(init) | ||
| }); | ||
This file was deleted.
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.
Some padding is ok, but this is excessive. Can you avoid it and instead use higher-resolution screenshots? Zoom the page at 200% if possible before taking a screenshot