Skip to content

Add remove-unused-repo-tabs feature#4534

Merged
fregante merged 38 commits into
mainfrom
useless
Jul 12, 2021
Merged

Add remove-unused-repo-tabs feature#4534
fregante merged 38 commits into
mainfrom
useless

Conversation

@yakov116
Copy link
Copy Markdown
Member

@yakov116 yakov116 commented Jul 1, 2021

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

image

Co-authored-by: shine <4771718+shinenelson@users.noreply.github.com>
Copy link
Copy Markdown
Member

@fregante fregante left a 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):

Comment thread source/features/next-scheduled-github-action.tsx Outdated
Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
@yakov116
Copy link
Copy Markdown
Member Author

yakov116 commented Jul 6, 2021

Before

1

After

image

Good?

@yakov116
Copy link
Copy Markdown
Member Author

yakov116 commented Jul 6, 2021

In case you want to know what repo I used https://github.com/harvester/harvester

@fregante
Copy link
Copy Markdown
Member

fregante commented Jul 6, 2021

The second screenshot might be a good candidate for more-dropdown as is. 👍 That screenshot was old

@yakov116 yakov116 marked this pull request as ready for review July 7, 2021 00:15
@yakov116
Copy link
Copy Markdown
Member Author

yakov116 commented Jul 7, 2021

Migration needed?

Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
@yakov116 yakov116 requested a review from fregante July 7, 2021 10:59
Comment thread source/features/next-scheduled-github-action.tsx
Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
Comment thread readme.md Outdated
Copy link
Copy Markdown
Member

@fregante fregante left a 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 👌

Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
@yakov116
Copy link
Copy Markdown
Member Author

yakov116 commented Jul 9, 2021 via email

@yakov116 yakov116 requested a review from fregante July 11, 2021 13:16
Comment thread source/features/remove-unused-repo-tabs.tsx Outdated
@yakov116
Copy link
Copy Markdown
Member Author

Blocked by refined-github/github-url-detection#86

And then 🚀! ❤️ Please

@fregante
Copy link
Copy Markdown
Member

fregante commented Jul 12, 2021

Merging this, but canUserEditOrganization is not the exclusion we need. The previous one has a different meaning from GitHub-url-detection:

 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 canUserEditOrganization should be renamed to isUserTheOrganizationOwner in that package and here we need to restore the async function

Exact details in: #4534 (comment), it's not just "new repo"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Wiki: Show number of pages.

2 participants