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

Move recursive folding functionality from the Scene Tree dock to the Tree node, so that it can also be used in projects #4791

Closed
AThousandShips opened this issue Jul 1, 2022 · 6 comments · Fixed by godotengine/godot#62666

Comments

@AThousandShips
Copy link
Member

AThousandShips commented Jul 1, 2022

Describe the project you are working on

A PR involving large trees

Describe the problem or limitation you are having in your project

Folding items in large nested trees can become highly cumbersome and impractical

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

Add recursive folding of tree nodes, folding children and grandchildren, etc.

Additionally allow folding of children of an item (both recursively and not)

This would make getting an overview of the tree easier by collapsing all the children of the node, or the node itself, when unfolded it would then be easier to get an overview once again.

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

Folding and unfolding would be handled directly by TreeItem, through new function(s), a small mockup I made appears to work well. I believe I would be able to implement this feature.

For input I would suggest the following:

  • Right click on the fold icon collapses/uncollapses recursively
  • Shift left click on the fold icon collapses/uncollapses the children of the item (based on the collapsed status of the first visible child, collapsing if uncollapsed and vice versa) but leaving the item itself uncollapsed, if the item was collapsed it uncollapses and uncollapses all its children.
  • Shift right click does the same but recursively

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

The direct behavior of recursive folding is straight forward to do in script with call_recursive, I would like to see this as a feature in the editor in general.

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

I believe this would be a quality of life improvement for the editor.

@YuriSizov
Copy link
Contributor

YuriSizov commented Jul 1, 2022

Are you talking about your own UI needs from the Tree node or about editor usability in, say, the Scene dock?

@AThousandShips
Copy link
Member Author

Both, but I encountered the frustration in the editor, though I feel I could be benefitted by it in my own projects as well but I have not used the Tree much in those projects. In this case it was related to the Editor Help Search which I'm working on a PR for

@YuriSizov
Copy link
Contributor

Well, for general UI needs this is probably better implemented on the per project level in the way that makes the most sense with some recurring traversal of children.

But if editor usability suffers, we can solve this for specific parts of the editor where it makes sense. I.e. also solve it on per project level 🙂

@KoBeWi
Copy link
Member

KoBeWi commented Jul 1, 2022

This seems to already exist though? Shifth+click on the fold icon collapses recursively. At least in scene tree dock.
godot windows tools 64_g1XYh3G1k7

@AThousandShips
Copy link
Member Author

AThousandShips commented Jul 1, 2022

Oh I didn't realize it was a thing for Scene Tree dock, and there I saw how that was solved so now I see how to do it in script reasonably well, thank you!

Then for now I'll just consider adding the equivalent behavior to Help Search where I encountered this as a limitation

@AThousandShips
Copy link
Member Author

I'm sorry I was far to focused on the Help Search where I was working

@Calinou Calinou changed the title Recursive folding and user interface Move recursive folding functionality from the Scene Tree Dock to the Tree node, so that it can also be used in projects Sep 9, 2022
@Calinou Calinou changed the title Move recursive folding functionality from the Scene Tree Dock to the Tree node, so that it can also be used in projects Move recursive folding functionality from the Scene Tree dock to the Tree node, so that it can also be used in projects Sep 9, 2022
@akien-mga akien-mga added this to the 4.0 milestone Sep 21, 2022
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.

5 participants