godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 69 forks source link

Add an option to straight up delete a file from the File System panel #3049

Open Okxa opened 3 years ago

Okxa commented 3 years ago

Describe the project you are working on

When messing about in the engine, ie. testing asset import settings, I often have to delete the imported file to try again.

Describe the problem or limitation you are having in your project

AFAIK, there is no option to delete a file from the File System panel without moving it to trash or recycle bin. Most operating systems / file managers have this option, either hidden or behind a toggle.

By doing this repeatedly fills up the trash folder on my system with files I do not want to restore.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

By adding an another context menu item, with its own customizable keybinding, we could delete files from the File System -panel without moving them to the trash.

By adding it as an separate option, there is still a way to delete items by moving them to trash.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Add an menu item in the File System -panel which deletes the selected item without moving it to the trash.

If it's too volatile to have by default, maybe add an toggle in settings.

Also add an separate keybind for the option. (Default Shift+ Del ?)

It also seems that the existing option is being renamed back to Delete: https://github.com/godotengine/godot/pull/49519, So the naming of the options might need a rethink.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, this should be a core feature, as it is used often enough.

Is there a reason why this should be core and not an add-on in the asset library?

It is an essential feature found on all operating systems and most file managers.

zinnschlag commented 3 years ago

Do we really need both functions (delete directly and move to bin) at the same time? This menu is rather full already.

Maybe an editor setting instead that switches the single delete function between deleting directly and move to bin? The first option is probably okay for most of the people using version control, since they have more convenient ways to restore deleted files.

Okxa commented 3 years ago

Do we really need both functions (delete directly and move to bin) at the same time? This menu is rather full already.

It would be nice to not be restriced to one or the other, but it might be a niche case where that is necessary.

Maybe not the menu item, but on the other hand it would not hurt if there was separate keybinds for the different actions.

Calinou commented 3 years ago

I'd do it like it's done in most file managers:

Okxa commented 1 year ago

Calinous solution likely is the one that makes most sense, and probably the way to go, but I'll just add that being able to change which delete action (when clicking) is used by default (and which is used when shift is held) would be preferable.

At the least, both options should have hotkeys you can set, so you can swap between the default hotkey, eg. set delete without moving to trash to just delete key and vice versa.

RichardRobertson commented 4 months ago

I was actually confused when Godot's file browser didn't support shift+delete. That's how I would remove files without recycling in explorer and VSCode. I would vote for shift+delete changing the behavior to delete instead of recycle.