-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Show "Confirm Delete" dialog for files, too #10258
Conversation
@marcelgerber It was a conscious decision by Brackets team to not display a confirmation dialog when deleting files (because they can be retrieved from Trash/Recycle Bin). I know that some people would like this, but showing this dialog needs to controlled by a preference which is off by default. |
As I've already pointed out in #8651 (comment), there are not-too-edgy cases where there's no trash available. So the best solution would be to not have a prompt shown if trash is available for the current file, and to have it shown in the other case or if the user set a pref. But I don't think we can determine whether trash is available, so imo the best solution is to always show a prompt. Also, the way we do it right now is a little odd as well, as we show a prompt for folders but not files, even though you can (usually) recover both. Why folders? And if it matters, what Windows does is this, at least with my configuration:
|
@@ -129,6 +129,8 @@ define({ | |||
"SAVE_CLOSE_MESSAGE" : "Do you want to save the changes you made in the document <span class='dialog-filename'>{0}</span>?", | |||
"SAVE_CLOSE_MULTI_MESSAGE" : "Do you want to save your changes to the following files?", | |||
"EXT_MODIFIED_TITLE" : "External Changes", | |||
"CONFIRM_FILE_DELETE_TITLE" : "Confirm Delete", |
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.
Do we need 2 strings with the same text?
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.
I could think of another wording in other languages, like Delete file
/Delete folder
. That's what Windows does, too.
But it's not a problem to use only one if that's what you want.
I agree with @marcelgerber that we should always show the prompt by default. If we really need it, we can add a pref for it, but disabled by default. I know that we discussed this before, but since then, there have been several request to add a prompt, so we should reconsider it. Even if is easy to recover from the trash (when it is possible), it is easier to say "no" if you clicked delete by mistake. |
What if we add a "Prompt on Delete" (or something like that) menu item to make this setting easy to toggle? If we have an easy way to turn it off (i.e. not everyone knows how to edit JSON) then I can live with the preference being true by default. How does everyone else feel about that? I think this would belong in the File menu. |
My idea would be a "Don't show this again" checkbox in the dialog, but we've never used checkboxes in dialogs before, so I'm not sure if this needs extra work. But still, I think in cases where there's no trash available, a warning is a must-have. |
@marcelgerber The problem with "Don't show again" is people will then need to know how to get back to showing the prompt, so I think we'd still need a menu toggle in that case. |
We probably shouldn't make it too easy to turn the dialog off if we can't reliably detect which cases are non-undoable (in that case we'd want to ignore the setting and show the dialog anyway). Until then, IMHO it'd be ok to just have this dialog be always-on with no option to disable. If the user is doing a lot of delete operations, it's faster to use the OS anyway (since you can multi-select), so I'm not too worried about slowing down the workflow here a tad. |
Atom, VSCode and Eclipse have the dialog. If people didn't change their system preferences, the deleted file should go to the Recycle Bin: I think the confirmation message should say something about it. |
@ficristo I've changed the string, but I'm not to keen on the current wording, either. I feel like "In most cases" is too vague. |
Actually Restore the description and LGTM. |
774d78e
to
75b4ff0
Compare
I've now decided to unite Also reverted the string change. |
Thank you, LGTM. |
For #8651 and #10190