Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to sort script list by most recent #8125

Open
L4Vo5 opened this issue Oct 15, 2023 · 0 comments · May be fixed by godotengine/godot#83608
Open

Add an option to sort script list by most recent #8125

L4Vo5 opened this issue Oct 15, 2023 · 0 comments · May be fixed by godotengine/godot#83608

Comments

@L4Vo5
Copy link

L4Vo5 commented Oct 15, 2023

Describe the project you are working on

A level editor made with gdscript

Describe the problem or limitation you are having in your project

I inevitably end up with too many scripts opened (I'm definitely not alone in this), but most of the time I only care about editing a few scripts I'm working on, not the full list. Manually closing the ones I don't care about takes effort, and I tend to avoid it anyways, as I may not know exactly which scripts I'm working on when I'm hopping between various classes. So I don't want to accidentally close something and need it a couple minutes later. Also, looking at each script and weighing the likelyhood of needing it in the near future is distracting when I'm trying to code.
Eventually, I do get fed up and use the "close other tabs" option to just start reopening them from scratch. But then I have to actually go through the process of opening them as I need them, which is slower than just selecting a tab.
"Script temperature" aims to mitigate this kind of issue, but personally it hasn't been very helpful for me. I still have to scroll around the long list, and it's just a bit strange to have to look at, and rely on, the variably faded color.

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

A way to have the most recent scripts I used at the top of the script list. It would make it easier to access the 5 or so scripts I actually care about at any one point in time. I would still have to scroll down if I want another one, but after that it'll be at the top which is where I'll first look.
Essentially, my accessing of scripts tends to follow temporal locality, so why not leverage that in the UI?

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

Add another option in the text_editor/script_list/sort_scripts_by Editor setting called "Recent" or "Recency", which sorts the scripts from most recently accessed to least recently accessed.
When this option is enabled and a script is selected, automatically put it at the top of the list instead of waiting for a full sort. (Currently, I think scripts are only sorted when a new one is opened, or when doing right click -> sort)
Also, consider making the "sort" option do nothing when the setting is active (similar to the "None" option in the editor setting). This would let the user drag a script lower down the list, and have it stay there, if they want it out of the way for now, but don't want to close it. It would also avoid having to actually store how recently each script was accessed, which should make the implementation easier. Just putting the selected script at the top each time would, by itself, naturally take care of the sorting.

Alternative implementations could try to go wild with keeping recently accessed scripts at the top without rearranging them every time, as keeping a script somewhat fixed in place, can also help with giving the user some spatial sense of where to find the script they want. For example, maybe it could sort scripts by most amount of times accessed in last 50 script accesses, with maybe an additional weighing to adjust faster when a new group of script starts being used... But that would require more investigation to tune it properly, and I'm happy to leave that to other proposals.

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

I'm not sure if an EditorPlugin can modify the script list? it might be possible

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

it's a UX enhancement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants