godotengine / godot-proposals

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

Scene tabs go dark with script editor #3697

Open Torguen opened 2 years ago

Torguen commented 2 years ago

Describe the project you are working on

tests projects

Describe the problem or limitation you are having in your project

I have recently used GDScript and its editor built into Godot. Something that seems confusing to me is that the scene tabs still appear to be in focus even when the script editor is in focus. Makes me wonder is that the name of the script or the scene or what does it mean?

I think scene tabs should be put to sleep when script editor is in focus.

I think this can get confusing:

Captura

I think all tabs should look like this, showing they are not active:

Captura2

There is no consistency between the tabs and the scripts area. Notice, if I select the script directly, the associated tab does not light up.

Animation

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

It would make using the script editor a little less confusing

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

Just make all scene tabs inactive when script editor is active

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

No

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

Not possible with an add-on

YuriSizov commented 2 years ago

I agree that scene tabs can be confusing when you are working with scripts, especially for someone who has a lot of experience with code editors and IDEs where tabs are normally code files you edit, and if there are other types of documents, they also share tabs. In Godot instead there were initially two sets of tabs, but in Godot 3 it was changed that the set of open scripts is a list to the left instead.

That said, we can't really de-emphasize the scene tabs, as the selected scene still provides context to other areas of the editor, such as the scene dock. For myself, I made a plugin that hides the scene tabs and moves the scene selection to the scene dock, and that helped me with the confusion.

image

I can make a PR for this, but as far as I understand, it's not everyone's cup of tea.

Torguen commented 2 years ago

Well, the problem can also be solved if the tabs respond properly to the direct script selection via the script dock, if a script has no tab because it is not assigned to a scene, then all scene tabs should be disabled. The script files dock must be in sync with the scene tabs. If the user selects a script from the ".gd" files dock then the corresponding tab must be enabled, otherwise the tabs remain disabled. The problem is the current operation, there is that bug, when you select a ".gd" script from the script dock, the corresponding tab is not enabled and a wrong tab remains enabled, which leads to a failure.

Perhaps the bug should be reported and that is enough, if that bug is solved the tabs should work as I said before, that is, synchronized, I think they should work like this.

I'd be happy with that PR, I don't use scene tabs at all when editing a script. I'd even like to auto-hide them when editing a script.

This is what I mean, my script "moto_ver_3.gd" has nothing to do with the scene tab "Proyectil", however that tab appears active, that's confusing. Captura

dalexeev commented 2 years ago

For myself, I made a plugin that hides the scene tabs and moves the scene selection to the scene dock, and that helped me with the confusion.

Your option is more logical, but less convenient, since it requires 2 clicks instead of 1 and wastes time choosing from a drop-down menu instead of instantly switching scenes.

Personally, I have never had any confusion with this, although in all other applications I use horizontal tabs and not vertical lists.

YuriSizov commented 2 years ago

Personally, I have never had any confusion with this, although in all other applications I use horizontal tabs and not vertical lists.

There is definitely a period for adaptation. Time and time again I clicked on tabs just out of the habit/old expectations when editing code. I think by now, I've outgrown that problem, and manage to work without the plugin on the latest project, but I can confirm that the problem does in fact exist for some of us.

Your option is more logical, but less convenient, since it requires 2 clicks instead of 1 and wastes time choosing from a drop-down menu instead of instantly switching scenes.

I didn't work much on it and its usability could definitely be improved, but the time wasted on clicking tabs was much greater than the time it takes to switch scenes with the plugin. And in case I still need that tab bar, there is a button there that toggles it back on.

That said, I would probably be happier with that other proposal that makes scripts and scenes (and maybe resources) all go into the same tab bar. That would be more convenient to me, I think. Maybe with some way to group tabs... But that's way outside of what can be easily achieved by a plugin, or even would be possible with an average PR.

Calinou commented 2 years ago

That said, we can't really de-emphasize the scene tabs, as the selected scene still provides context to other areas of the editor, such as the scene dock. For myself, I made a plugin that hides the scene tabs and moves the scene selection to the scene dock, and that helped me with the confusion.

image

I can make a PR for this, but as far as I understand, it's not everyone's cup of tea.

I like the sound of this, as it would save a non-negligible amount of vertical screen space. My only concern is that it removes the ability to switch between scene tabs quickly (2 clicks or one click-release operation is required now). I guess this could be alleviated if a full-fledged Ctrl + Tab scene switcher is implemented (similar to JetBrains IDEs).

MarioLiebisch commented 2 years ago

@Calinou Experimented a bit with something similar (before seeing this issue), although I added a new has_scene_tabs() function to EditorPlugin to ask it, whether it utilizes the tabs or not (right now only the 2D/3D editors react/use them properly I think).

For any other tab/editor they're hidden by default, which only applies if they provide a "main scene", i.e. are placed in the main view.

This would look like this: godot-scene-tabs

Definitely not perfect, but I absolutely remember the tab behavior one of the most confusing parts to me, having used mutli-document/tabbed editors for years.

I'm totally aware this is not perfect, e.g. the "maximize" button moving to the left side etc.

As an alternative, I could also think of all tabs becoming inactive or disabled once you switch to any non-tabs view.

YuriSizov commented 2 years ago

That said, we can't really de-emphasize the scene tabs, as the selected scene still provides context to other areas of the editor, such as the scene dock. For myself, I made a plugin that hides the scene tabs and moves the scene selection to the scene dock, and that helped me with the confusion.

image

By the way, I made this plugin public a few days ago: https://github.com/pycbouh/godot-editor-scene-selector