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

A way to filter tasks in the tree view #192

Open
ydeltastar opened this issue Aug 9, 2024 · 9 comments · May be fixed by #229
Open

A way to filter tasks in the tree view #192

ydeltastar opened this issue Aug 9, 2024 · 9 comments · May be fixed by #229
Labels
enhancement New feature or request

Comments

@ydeltastar
Copy link
Contributor

Problem statement

While prototyping and editing scripts, I usually need to find all the instances of a task and fix export values, remove them, or just find where it is used.
There is no filter for the tree view so I have to pinpoint tasks by eye, which becomes more difficult as the tree grows larger.

Proposed solution

A filter feature for the behavior tree view similar to the filter in the scene tree.
It can take a name string and optionally a type. Nodes that don't match the filter are hidden but the parent structure is visible.

Usage example, based on the scene tree filter behavior:

  • Filter can_melee t:BTCheckVar will show all BTCheckVar tasks containing "can_melee" in their generated names.
  • Matches don't need to be precise so can_melee t:checkVar and _melee t:check will have the same result
  • Support for multiple matches. Filter can_melee t:BTCheckVar NavigateToPos will show both BTCheckVar containing "can_melee" and a custom task named NavigateToPos

The filter could be fixed on the top like the scene's node tree but since the behavior editor is a main dock, it could work like the script editor's Find feature. It is placed at the bottom, can be accessed with Ctrl+F, and can be hidden.

Alternatives

N/A

@ydeltastar ydeltastar added the enhancement New feature or request label Aug 9, 2024
@monxa
Copy link
Contributor

monxa commented Sep 10, 2024

Design proposal: Two options

  1. Filter tree: show only trees with matching subtree names/base names.
  2. Highlight tree: highlight matches or show right-side indicators (with match count for multiple hits).

@ydeltastar
Copy link
Contributor Author

Filter or highlight option could be implemented as the "Show All" toggle like in the node selector.

image

@monxa
Copy link
Contributor

monxa commented Sep 12, 2024

Yes, consistency is nice, especially naming consistency.
I initially imagined filtering to allow using the tree as-is while filtered. For example, you could mask for a parent and then edit its subtree without being distracted by other parts.

On the other hand, if we went all-in with the Godot-internal node selector design, the filter option would be usable in exactly this way:

  • search
  • select element
  • exit filtering

This is an improvement, and I am all for it. It's your proposal after all. I'm all ears which direction this should go.

@monxa
Copy link
Contributor

monxa commented Sep 14, 2024

Don't want to unnecessarily bump this but Tuesday I got some time. I will try to implement this. I will go with @ydeltastars suggestion if nothing else is suggested. @ydeltastar If you are already working on this, please let me know!

@ydeltastar
Copy link
Contributor Author

I initially imagined filtering to allow using the tree as-is while filtered. For example, you could mask for a parent and then edit its subtree without being distracted by other parts.

That's how I imagined it too. Similar to the scene tree filter but with an option to hide/show filtered-out tasks which the scene tree doesn't have.

Sounds great! I haven't worked on this yet.

@limbonaut
Copy link
Owner

limbonaut commented Sep 14, 2024

Such functionality would be quite useful 👍 UI needs some consideration - that main toolbar is so packed. Make sure to also take the new layout into consideration.

UPDATE: I'm ok with both, filtering or highlighting. The idea with the switch is nice, but if the filter gets several controls, assuming it is placed on the toolbar, it will be too crowded I think.

@monxa
Copy link
Contributor

monxa commented Sep 18, 2024

image

@limbonaut
Copy link
Owner

Yeah, that can work

@monxa
Copy link
Contributor

monxa commented Sep 21, 2024

Update: Custom class added for TaskTree simplicity. Exploring selection for navigation and highlighting. Filtering planned for Sunday, may take longer. Open to any feedback.

@monxa monxa linked a pull request Sep 25, 2024 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants