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

Expose and warn about Node Filters in Scene Tree Dock #65932

Merged

Conversation

Mickeon
Copy link
Contributor

@Mickeon Mickeon commented Sep 16, 2022

Continuation of #65352. (see also #65352 (review))

This PR adds "Filter by Type" and "Filter by Group" in the Scene Tree Dock's MenuButton (the one on the top right featuring 3 dots), exposing them to everyone that doesn't religiously look at this engine's source code.

Menu Tooltip
image image
Hovering on them displays an useful tooltip.
Behavior Warning
Showcase image
When clicking on either of these, the matching parameter is appended to the terms, and the caret is automatically brought to the end. When typing a filter that cannot be identified, a warning icon is displayed. The reason is explained in the tooltip. Before this, the temporary solution of #65352 is to spam warnings to the console.

And lastly, the same options are also quickly available by right-clicking or middle-clicking in the text field.

Right Click Middle Click
image MiddleClick

@akien-mga
Copy link
Member

Looks good, but the warning system is weird that it shows a warning icon but the actual warning is shown in the menu. That's not something we do anywhere else in the editor.

The warning should be shown in a tooltip on hover of the warning icon, like for node configuration warnings.

@Mickeon
Copy link
Contributor Author

Mickeon commented Oct 4, 2022

The warning should be shown in a tooltip on hover of the warning icon, like for node configuration warnings.

Not sure it would be possible to have the tooltip display exactly there, without resulting into something poor and hacky. I want to note that the Warning icon in this PR is actually still the "clear" TextEdit button. Its behavior remains unchanged, which means it would clear the text on click instead of telling the user what's wrong. Not the worst thing in the world, really, just putting it out there.

@Mickeon
Copy link
Contributor Author

Mickeon commented Oct 4, 2022

Going to update this PR to display the warning as a tooltip hovering over the filter TextEdit:
image

Takes a while to show up by default, but it is how it is with tooltips.
(Added an ending "." at the end of that warning, too)

@Mickeon Mickeon force-pushed the editor-scene-tree-filter-selection branch 2 times, most recently from 7495077 to 95074fc Compare October 4, 2022 15:58
@Mickeon
Copy link
Contributor Author

Mickeon commented Oct 4, 2022

All good now, I hope.

@KoBeWi
Copy link
Member

KoBeWi commented Oct 5, 2022

I have nodes without any groups. With empty group: filter, some of them disappear:
godot windows editor dev x86_64_8npSWHobZk
Why is that?
EDIT2: Same happens when I filter with group:c, where c can be any character EDIT3: The latter does not happen if any node has a group.

EDIT:
Ok maybe groups are not related to this PR. I think it just finds some groups that aren't displayed in the editor. Maybe we could ignore them.

EDIT:
Right-click options do not work:
godot windows editor dev x86_64_zkMD3GPCFk

@Mickeon Mickeon force-pushed the editor-scene-tree-filter-selection branch from 95074fc to 0554f5c Compare October 5, 2022 19:59
@Mickeon
Copy link
Contributor Author

Mickeon commented Oct 5, 2022

Thank you for the testing as always, @KoBeWi. The group thing may not be related to this PR, but it'd still be nice to see if something can be done about it, because I implemented the feature and it'd be nice to address it. It may be related to the way groups are detected. Unfortunately it has to be a bit finnicky already because Groups don't seem to distinguish between internal and exposed. It'd love to take a look at that project you're testing it with to spot the issue.

Meanwhile, I addressed the right-click options not working.

@KoBeWi
Copy link
Member

KoBeWi commented Oct 5, 2022

Groups don't seem to distinguish between internal and exposed. It'd love to take a look at that project you're testing it with to spot the issue.

"Exposed" groups have persistent flag enabled. I think in your case you can use get_persistent_group_count() method and check if it's non-zero.

@Mickeon
Copy link
Contributor Author

Mickeon commented Oct 5, 2022

Ok I can address it in another PR. Perhaps within #65939 to make it quick.

@Mickeon Mickeon force-pushed the editor-scene-tree-filter-selection branch from 0554f5c to b4d5181 Compare October 5, 2022 21:36
editor/scene_tree_dock.cpp Outdated Show resolved Hide resolved
Adds "Filter by Type" and "Filter by Group" in the Scene Tree Dock's MenuButton.
Hovering on them displays an useful tooltip.
When selecting these items, the matching parameter is appended to the terms, and the caret is automatically brought to the end.

When typing a filter that cannot be identified, a warning icon is displayed. The reason is explained as a tooltip.

The same options are also quickly available by right-clicking or middle-clicking in the text field.
@akien-mga akien-mga added this to the 4.0 milestone Oct 6, 2022
@akien-mga akien-mga merged commit 75c4b95 into godotengine:master Oct 6, 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.

3 participants