Open and-rad opened 1 year ago
I think the tree interface with checkboxes will be more convenient. Resources that can be removed are automatically checked. Otherwise the checkbox is unfilled and a tree of its reverse dependencies is displayed. When you check the box next to a resource, all resources that depend on it are also marked.
For example, if the dependency graph looks like this
and the user has selected resources 1, 2, 3 to delete, then the initial state of the dialog should look like this:
When the user checks a resource, all the resources that depend on it are also checked. Or we can allow dependent resources not to be removed, but display a warning that they will be broken due to dependency removal.
I like that idea even more. There's more work upfront with recursively finding all dependencies, but a list of checkboxes representing the entire dependency tree right away would speed up this process even more.
Describe the project you are working on
A project that uses refactoring and blockout assets heavily.
Describe the problem or limitation you are having in your project
When trying to delete a file from the FileSystem dock, Godot checks for assets that use that file and lists them in the Delete dialog. This is an important step to prevent accidental dependency breakage. When it then turns out that some of these assets can also be deleted, the only option is to cancel the operation, select the assets and try to delete this new set of files with the possibility that these steps have to be repeated a bunch of times.
It would be a minor, but very convenient time-saving improvement if there was an option to add the assets to the list of items to be deleted right there in the dialog.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Refer to the next section.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
A file is selected for deletion and the Delete key is hit. The confirm dialog pops up and warns about dependencies.
Right-clicking of any of the assets listed provides an option to add it to the list of pending items to be deleted:
After this, the dialog refreshes and an updated list of dependencies is shown. Users can continue adding dependencies until they are satisfied with the selection.
Alternatively, there could be a single button in the button area that allows users to add all dependent assets to the list of pending deletes. After all, why would I want to go ahead with deleting a file if there are still dependencies left that would break if I went through with it.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be easily worked around by doing what I described in the opening paragraph. The main reason to implement this feature would be the time saved compared to that.
Is there a reason why this should be core and not an add-on in the asset library?
It's core functionality. If the file removal dialog can be replaced with a custom one via existing add-on capabilities, there is no reason not to do it in an add-on.