rubygems / rubygems.org

The Ruby community's gem hosting service.
https://rubygems.org
MIT License
2.33k stars 918 forks source link

Removing yourself from owner of a gem should confirm first #5058

Open martinemde opened 1 month ago

martinemde commented 1 month ago

When you're editing ownerships, it's possible to remove yourself. This is fine.

However, it's really easy to misclick and delete yourself, which could be an especially painful thing to correct depending on the gem and its owners.

Steps to Reproduce

  1. Be an owner of a gem with at least 1 other person
  2. Remove yourself as owner when you meant to remove someone else
  3. Wonder why you lost access to the ownership view of the gem.

Expected Behavior

I am presented with a more explicit confirmation about the irreversible thing I'm doing.

Another improvement would be to set the current user apart from the other owners, maybe always at the top and always with a separate border.

Current Behavior

With more than a couple owners, making sure you're clicking the right one is not foolproof.

Possible Solution

Since this is so painful to reverse and so unique compared to removing anyone else, maybe we should add a specific page for the "remove myself" action that says "this is irreversible. you will need to ask another owner to re-add to regain ownership" and offers a confirm.

colby-swandale commented 1 month ago

We have a dialog option for the delete action, is this not showing up? https://github.com/rubygems/rubygems.org/blob/078120bc3a6ef72178670f4985f52e0c796e2595/app/views/owners/_owners_table.html.erb#L47-L51

colby-swandale commented 1 month ago

A typical UI for dangerous actions is showing a popup that requires inputting the name of the thing (username) as confirmation would serve well?

martinemde commented 1 month ago

It does put the dialog but I already knew I was removing an ownership so the dialog was expected. Either entering the name or making a unique screen for removing yourself is probably what I'm expecting. Entering a name is more difficult but also, how often does anyone remove an owner? It's probably ok to do it that way.