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

Improve Scene Tree Dock's Node filter (Allow multiple terms & more) #65352

Merged

Conversation

Mickeon
Copy link
Contributor

@Mickeon Mickeon commented Sep 5, 2022

This PR is a continuation of #65315, and a bit of a misnomer, because it actually does a whooping 3 things at once:

Suppose we have this sample Scene:
image

" fl light " "type:audio ju p" "pe type:col"
image image image

Note that, and this is going to be in the test, ScaryObstacle1 and ScaryObstacle2 belong to the "enemy" group. ScarierObstacle belongs to the "enemy" and "horrifying" group.

"group:" "group:horr" "g:hor g:en"
image image image

Lastly, this implementation uses String.contains() over String.is_subsequence_of(). While the subsequence lead to "quicker typing", it also showed very inconsistent and unexpected results.

@Mickeon
Copy link
Contributor Author

Mickeon commented Sep 5, 2022

Notes for the future:

  • I wanted to implement the search items expanding automatically if they match. It would've been as simple as a p_parent->set_collapsed(false);. But the main problem is, ironically, that all items would be expanded, even when the filtering stops, which is an outstanding annoyance. This means that, at the very least, the default, unfiltered state of the Tree's folding would have to be stored somewhere, but that's beyond the scope of this PR and can totally be done another time.

@Mickeon Mickeon force-pushed the try-scene-tree-filter-multi-word branch 3 times, most recently from 6c8f599 to 34a93e8 Compare September 5, 2022 09:23
@Calinou Calinou added this to the 4.0 milestone Sep 5, 2022
@Mickeon
Copy link
Contributor Author

Mickeon commented Sep 5, 2022

I had been waiting for the tags to show up all day at work! I'm really happy about this one.

@akien-mga akien-mga requested a review from a team September 6, 2022 11:32
@Mickeon Mickeon force-pushed the try-scene-tree-filter-multi-word branch 2 times, most recently from 45ff7ba to 68e8f0b Compare September 6, 2022 12:45
@YuriSizov YuriSizov requested a review from a team September 8, 2022 15:19
Copy link
Member

@reduz reduz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, we should eventually find a way for the warning to be shown better than going to the toaster. Either text in red and a tooltip or a warning icon next to the line edit.

- Allows more than one parameter to be passed in the "Filter Node" search box, each term separated by spaces.
- Grays out any parent Node not matching the search, but still having to be there because a child is.
- Adds a `group:` filter. It matches any Node belonging to the passed group. If no argument is passed, it matches all Nodes belonging to any group. It also ignores groups used internally, and its alias is `g`.
@Mickeon Mickeon force-pushed the try-scene-tree-filter-multi-word branch from 68e8f0b to 1c4095a Compare September 9, 2022 11:40
@akien-mga akien-mga merged commit 2116318 into godotengine:master Sep 9, 2022
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants