godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 97 forks source link

Move node and file favorites from `.godot/` to the per-project editor metadata directory #10746

Open karomapu opened 1 month ago

karomapu commented 1 month ago

Describe the project you are working on

The proposal is for the editor and not project-specific.

Describe the problem or limitation you are having in your project

If the user needs to remove the .godot folder for any reason (say, to force reimport of the whole project) that also means favorites are removed along with it. This can be a huge issue in the middle of development where the user is reliant on favorites to quickly navigate around the file system.

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

It will prevent favorites from being carelessly deleted from the project. Since it is something that is created and maintained by the user, and not auto-generated by Godot, it doesn't belong in the .godot directory.

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

As stated in the title, store favorites in the Editor Data/Settings folder instead. It seems some project-specific settings are also already stored there, why not favorites too?

Alternatively, maybe give users the option to save it in project settings if they want it to be shared across multiple team members/machines.

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

Sure, but this feature really should be available out of the box.

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

The favorites feature is built-in to godot. I don't see why this needs to be an add-on to improve core functionality.

tetrapod00 commented 1 month ago

Wherever this is stored, it should be a per-user setting, not a per-project setting, right? Otherwise you'll run into the problem of multiple team members overwriting each other's favorites, and adding noise to version control history.

karomapu commented 1 month ago

right, I initially thought that favorites could be project-wide and wouldn't need to be updated often, but now I realize individual members would still want their own user-defined favorites and kinda defeats the purpose. Maybe users can override the project's favorites locally, but that could make things messy

Calinou commented 1 month ago

If this is to be stored in the editor settings (which I think makes the most sense), it should still be scoped on a per-project basis so that identical nodes or file paths in multiple projects aren't considered favorites in all projects. There is a way to define per-project metadata that is still stored in the editor settings folder: EditorSettings::get_singleton()->get_project_metadata().