sindresorhus/refined-github

`quick-repo-deletion` activating by default seems overly aggressive #3832

jacobwgillespie posted onGitHub

It appears that #3795 enabled the quick-repo-deletion button for all repositories - the PR title and linked issue reference enabling the feature for "empty" repositories, but it appears that the feature code actually defines empty as "has not been starred":

https://github.com/sindresorhus/refined-github/blob/eb79224b4dbf0852651c42cca2ff770ae185d100/source/features/quick-repo-deletion.tsx#L111-L119

This means that the delete button appears for all private repositories, especially organization repos, where users are unlikely to star an internal company repo. It would also appear for any personal repositories that haven't been starred, regardless of how many commits said repo has (like, you can have 100s of commits in a repo, and if nobody has starred it, this button still appears).

This doesn't seem like intended behavior. Having a very prominent Delete button for any repo that has no stars isn't quite the same as making it easy to clean up empty repositories.

Would it be possible to change the activation criteria? Perhaps it could take into account whether or not the repo actually contained commits (is it really empty, especially if it's not a fork), or whether it was a private repo. Or perhaps there's a better criteria all together for the intent of this feature. There's probably a narrower range of repos where having a featured delete button makes UX sense.


tl;dr - seeing a red DELETE button at the top of all our company repos is slightly concerning šŸ˜…


This is meant for test, demo or ā€œreproā€ repositories, so the number of commits (unless itā€™s substantial) shouldnā€™t preclude it.

Perhaps ā€œdeletable reposā€ arenā€™t common enough to warrant such a dangerous button on every page, regardless of the logic we use to detect ā€œdeletable repos.ā€

Maybe #3795 should be reverted. In its place, we could add a ā€œQuick deletionā€ button in the settings page with the current conditions.

posted by fregante over 4 years ago

What if we only show on public and only if the owner is the viewer?

Also maybe it should be added to the more drop down?

posted by yakov116 over 4 years ago

I like the idea of moving the button to the dropdown for non-forked repos. It's one more click but still a win compared to the whole copy/paste thing. Having the button on the settings page is also an option, but the loading adds some annoying delay that could be avoided.

posted by cheap-glitch over 4 years ago

Also maybe it should be added to the more drop down?

I think that should be exclusively for navigation, not actions.

Having the button on the settings page is also an option, but the loading adds some annoying delay that could be avoided.

How often would one experience this delay? Only once per repository. I think having to dig into the settings is fine (for non-fork repositories).

posted by FloEdelmann over 4 years ago

I think that should be exclusively for navigation, not actions.

Agree

posted by yakov116 over 4 years ago

I limited the feature to forked repos for the time being. PR welcome for an alternative, once fleshed out

posted by fregante over 4 years ago

I released a new version/hotfix that includes the above change.

posted by fregante over 4 years ago

tl;dr - seeing a red DELETE button at the top of all our company repos is slightly concerning

This is a little disappointing. GitHub makes it a pain to clean up temporary/abandoned repos. Your button is guarded behind a confirmation dialog anyway.

What if we only show on public and only if the owner is the viewer?

Could this have resolved the poster's specific complaint?

Having the button on the settings page is also an option, but the loading adds some annoying delay that could be avoided.

This is arguably the most straightforward solution. The quick delete button could be rendered in its current location whenever the standard delete button exists. Yes, settings take a moment to load, but a big improvement over scrolling then copy/pasting the repo name.

posted by texastoland about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests