-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add remove-unused-repo-tabs
feature
#4534
Conversation
Co-authored-by: shine <4771718+shinenelson@users.noreply.github.com>
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.
Are we keeping the "new project dropdown"?
Probably not, let's drop it. We have onlyShowInDropdown
now.
If yes are we adding new actions or new wiki to it.
Nope, onlyShowInDropdown
is a good solution.
What should the screenshot be of?
Before: show the tabs of a repo that has 0 projects and 0 packages, but maybe some wikis
After: hide projects and packages, ad count to wiki, show open dropdown menu with projects and packages
When taking the screenshot of the open dropdown:
- drop other unrelated items to make it easier to focus on the 2 items
- add margin below the tab bar so it doesn't overlap over content, like (old screenshot):
Co-authored-by: Federico Brigante <me@fregante.com>
In case you want to know what repo I used https://github.com/harvester/harvester |
The second screenshot might be a good candidate for |
Migration needed? |
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.
Untested but it looks pretty straightforward now 👌
Co-authored-by: Federico Brigante <me@fregante.com>
It's not DOM ready safe
…On Fri, Jul 9, 2021, 12:56 PM Federico Brigante ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In source/features/remove-unused-repo-tabs.tsx
<#4534 (comment)>
:
> + }
+}
+
+async function initProjects(): Promise<void | false> {
+ const projectsTab = await elementReady('[data-hotkey="g b"]');
+ if (await getTabCount(projectsTab!) > 0 || mustKeepTab(projectsTab)) {
+ return false;
+ }
+
+ if (pageDetect.isRepo()) {
+ onlyShowInDropdown('projects-tab');
+ return;
+ }
+
+ // .isOrganizationProfile
+ if (await elementReady('a.btn-primary[href$="repositories/new"]')) {
uhmmm there's already a pageDetect.canUserEditOrganization, so what is
this line for exactly?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4534 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEAXKWNP3DDSUGHMPNANT5TTW4S4XANCNFSM47UKJNNA>
.
|
This reverts commit 30ecddf.
Blocked by refined-github/github-url-detection#86 And then 🚀! ❤️ Please |
Merging this, but async function canUserEditOrganization(): Promise<boolean> {
return Boolean(await elementReady('.btn-primary[href$="repositories/new"]'));
} This exists for any collaborator while the settings tab just points to the org owner, as far as I know. Actually I think Exact details in: #4534 (comment), it's not just "new repo" |
Closes #4246
What this feature does it if there are actions/wiki's/projects it leaves the tabs. if not it moves it to the
more-dropdown
.it also adds the tab count (actions the workflow count and wiki's the page count)
Test on
Has actions
https://github.com/sindresorhus/eslint-plugin-unicorn
https://github.com/sindresorhus/refined-github
Has actions and wiki
https://github.com/pixiebrix/pixiebrix-extension
has Projects
https://github.com/twbs/bootstrap
Has no projects/actions/wiki's
https://github.com/twschiller/dslfin-www
when going to the tab it does not get hidden
https://github.com/twschiller/dslfin-www/projects
Org
https://github.com/tc39 //No projects
https://github.com/microsoft // has projects