lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Confirmation popup for destructive actions

Open no-more-secrets opened this issue 5 years ago • 7 comments

Hello,

In the two menus containing "destructive" actions (d and D) can we have the "cancel" item first in the list? That way one doesn't accidentally hit enter and nuke their tree. Especially important since when you select one of those destructive actions there is not an "are you sure?" box that pops up. I think that the best solution which will keep the UI streamlined but make it a tad safer would just be to have the "cancel" item first in the list. That way, in order to nuke your tree, you have to press shift-d, down arrow, then enter, i.e., a key sequence that will only ever be typed intentionally. What say you?

no-more-secrets avatar Jun 13 '20 02:06 no-more-secrets

I'm currently leaning towards leaving it as-is given that the fact you already have to press two keys is sufficient friction in my mind (i.e. d + enter), but I'm interested in other people's thoughts

jesseduffield avatar Jul 18 '20 10:07 jesseduffield

If changing the order of the menu items is not desirable, then can we add an "are you sure" box? I don't know any UI in any system that would not present an "are you sure" box in response to a user action that discards all of their changes :)

no-more-secrets avatar Jul 19 '20 20:07 no-more-secrets

Good point, I think that makes sense

jesseduffield avatar Jul 19 '20 23:07 jesseduffield

Great, thank you

no-more-secrets avatar Jul 22 '20 13:07 no-more-secrets

I think we have this rn

guerinoni avatar Dec 25 '22 11:12 guerinoni

@guerinoni Are you referring to PR #874? It looks like that was not merged, but closed due to staleness. @sstiglitz Any plans to finish that PR?

no-more-secrets avatar Jan 11 '23 20:01 no-more-secrets

Hello @jesseduffield

I just checked when I try to delete files or branches and there is already cancel option shown but it's still not default focus.

I see this issue is good for noobs like me and wonder if I can still contribute? Or are there other plans for this?

Thank you in advance

ikorason avatar Jun 08 '24 04:06 ikorason