godotengine / godot-proposals

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

Allow editing already-created tags in the project manager #10646

Open Maulve opened 2 weeks ago

Maulve commented 2 weeks ago

Describe the project you are working on

/

Describe the problem or limitation you are having in your project

The tagging system in the Project Manager is great. However after using it for the first time I noticed one core feature that is missing - editing tags. Currently, tags cannot even be deleted. I have not found any mention of this anywhere else (correct me if I'm wrong), hence why I'm here.

Note that when I'm talking about tags, I mean "All Tags" in the project manager's "Manage Tags" menu. image

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

So what do I mean by "editing" tags? Deleting and renaming would be the bare minimum. However, changing the color of the tag could also be talked about. For the sake of simplicity, we can ignore the latter for now and focus on the core features.

So the user can:

  1. Delete tags
  2. Rename tags

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

Logic:

Of course, with how tags are saved (in project.godot for every project), this would require some work. Each instance of a tag would need to be updated accordingly. I must admit that I neither know C++ much, nor know the code-base of Godot well, however this shouldn't be too much of a problem.

Let's say the user wanted to delete a tag: (pseudo-code with gdscript syntax)

func delete_tag(tag: String) -> void:
    var projects = get_projects()  # get all project.godot(s)
    for project in projects:
        if tag in project.tags:
            project.delete_tag(tag) # loop through tags array and delete tag

Note that this is an immense simplification.

For renaming it would essentially work the same, just changing the tags value instead of deleting it.

Design:

Obviously, this would require some sort of user interface . For deleting, an icon inside the tag (on the right side) would suffice. However, what about renaming?

I see two possible approaches towards this:

  1. Right-click menu
  2. Icon (similar to delete)

image (Mock-up of delete button, using Remove.svg from the Godot editor icons)

Alternatively, both options could be put into a right-click menu. image (Mock-up of right-click menu)

All these approaches come with their own drawbacks, so I'm in no position to decide how this should be handled.

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

No, as the project manager can't really be replaced.

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

Add-ons can't affect the project manager.

KoBeWi commented 2 weeks ago

The tag list just lists tags found in all projects. You can create a new tag to replace old one and if you remove all instances of the old tag, it will be gone after Project Manager restart.

Maulve commented 2 weeks ago

The tag list just lists tags found in all projects. You can create a new tag to replace old one and if you remove all instances of the old tag, it will be gone after Project Manager restart.

Technically true, but isn't that way too tedious? Especially when a lot of projects have a tag. In that case, at least a delete functionality would be good - to delete all instances of a tag.