Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Thanks for contributing! 🦋🙌
- [](# "go-to-action-from-file") [Adds a link to access the past runs of a GitHub Action workflow when seeing the workflow configuration file.](https://user-images.githubusercontent.com/1402241/80146153-ab6d6400-85b1-11ea-9f38-e87950692a62.png)
- [](# "clone-branch") [Clone a branch from the branches list.](https://user-images.githubusercontent.com/16872793/76802029-2a020500-67ad-11ea-95dc-bee1b1352976.png)
- [](# "fork-source-link-same-view") [Points the “Forked from user/repository” link to current folder or file in the upstream repository.](https://user-images.githubusercontent.com/1402241/84795784-3722d000-aff8-11ea-9b34-97c01acf4fd4.png)
- [](# "cleanup-repo-filelist-actions") [Replaces the labels of some simple buttons on repository filelists with icons, making them take less space.](https://user-images.githubusercontent.com/44045911/88551471-7a3f7c80-d055-11ea-82f1-c558b7871824.png)
- [](# "clean-repo-filelist-actions") [Replaces the labels of some simple buttons on repository filelists with icons, making them take less space.](https://user-images.githubusercontent.com/44045911/96283396-bbb94580-100e-11eb-9480-17954bb3a811.png)
Copy link
Member

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

- [](# "new-repo-disable-projects-and-wikis") [Automatically disables projects and wikis when creating a repository.](https://user-images.githubusercontent.com/16872793/92803886-dc460e00-f385-11ea-8af6-d6b7a0d3bf91.png)
- [](# "sticky-sidebar") [Makes conversation sidebars and repository sidebars sticky, if they fit the viewport.](https://user-images.githubusercontent.com/10238474/62276723-5a2eaa80-b44d-11e9-810b-ff598d1c5c6a.gif)
- [](# "link-to-github-io") [Add a link to visit the user’s github.io website from its repo.](https://user-images.githubusercontent.com/31387795/94045261-dbcd5e80-fdec-11ea-83fa-30bb673cc26e.jpg)
Expand Down
54 changes: 54 additions & 0 deletions source/features/clean-repo-filelist-actions.tsx
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');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👇 (if parentElement is a <summary>)

Copy link
Member

Choose a reason for hiding this comment

The 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');

Choose a reason for hiding this comment

The 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 <summary> to <details> here.

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)
});
46 changes: 0 additions & 46 deletions source/features/cleanup-repo-filelist-actions.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions source/features/download-folder-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ function init(): void {
// "Repository refresh" layout
select('.file-navigation > .d-flex:last-child')!.append(
<a
className="btn ml-2"
className="btn ml-2 tooltipped tooltipped-ne"
href={downloadUrl.href}
aria-label="Download folder"
>
<DownloadIcon className="mr-1"/>
Download
</a>
);
}
Expand Down
1 change: 1 addition & 0 deletions source/options-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const defaults = Object.assign({
const migrations = [
featureWasRenamed('sticky-conversation-sidebar', 'sticky-sidebar'), // Merged in September
featureWasRenamed('add-tags-to-commits', 'tags-on-commits-list'), // Merged in October
featureWasRenamed('cleanup-repo-filelist-actions', 'clean-repo-filelist-actions'), // Merged in October

// Removed features will be automatically removed from the options as well
OptionsSyncPerDomain.migrations.removeUnused
Expand Down
2 changes: 1 addition & 1 deletion source/refined-github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ import './features/keyboard-navigation';
import './features/vertical-front-matter';
import './features/use-first-commit-message-for-new-prs';
import './features/linkify-user-edit-history-popup';
import './features/cleanup-repo-filelist-actions';
import './features/clean-repo-filelist-actions';
import './features/prevent-duplicate-pr-submission';
import './features/remove-label-faster';
import './features/clean-conversation-headers';
Expand Down