X Tutup
Skip to content

Scene Dock: Simplify Filter Nodes related UI#112343

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
timothyqiu:filter-nodes
Dec 1, 2025
Merged

Scene Dock: Simplify Filter Nodes related UI#112343
akien-mga merged 1 commit intogodotengine:masterfrom
timothyqiu:filter-nodes

Conversation

@timothyqiu
Copy link
Member

@timothyqiu timothyqiu commented Nov 3, 2025

The current placeholder is too long for regular usage.

It was introduced to enhance the discoverability of the filtering syntax. But nowadays, the filter options are available in the related menus. It's no longer necessary to use this placeholder I think.

Before After
placeholder-before placeholder-after

The syntax is already mentioned in the LineEdit's tooltip. It is now also added to the tooltip of the related menu items:

tooltip

Options in the context menu:

  • The "Filters" text is removed from the separator. It's redundant, already in "Filter by Type" & "Filter by Group".
  • Icons are removed. Together with the checkbox above, they create confusing empty spaces.
Before After
context-menu-before context-menu-after

Options in the three-dots menu:

  • The "Filters" text is removed from the separator. The reason is the same as above.
  • Moved to the end of the menu, the same place as the context menu.
Before After
dots-menu-before dots-menu-after

There is also a filters popup menu for middle mouse button click in the LineEdit. This PR makes it created on demand.

@passivestar
Copy link
Contributor

I agree because I think search needs to be improved with more filter types and complex expressions to be more useful for large projects (i.e see this and this). Teaching all of the new syntax via placeholder text won't be possible, it will need to be made discoverable by other means

@AThousandShips AThousandShips added this to the 4.x milestone Nov 3, 2025
@KoBeWi
Copy link
Member

KoBeWi commented Nov 3, 2025

The menu options don't mention shorthands (t: g:). Maybe they could be in the tooltip?

@timothyqiu timothyqiu changed the title Simplify Scene dock Filter Nodes placeholder Scene Dock: Simplify Filter Nodes related UI Nov 4, 2025
@timothyqiu
Copy link
Member Author

timothyqiu commented Nov 4, 2025

Updated. The shorthand is now mentioned in the menu item's tooltip. See OP.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 6, 2025

Placeholder part is actually covered by #107942

Comment on lines 4022 to 4024
void SceneTreeDock::_update_tree_menu() {
PopupMenu *tree_menu = button_tree_menu->get_popup();
tree_menu->clear();
Copy link
Member

Choose a reason for hiding this comment

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

I just realized that this menu doesn't need to be re-created every time. Only needs to update the checkboxes.
You could change it, but idk if it's within scope of this PR.

Copy link
Member

Choose a reason for hiding this comment

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

No, no, you didn't just realise. Older you did as well. But the performance benefit didn't outweigh the extra code at the time.

Copy link
Member

@KoBeWi KoBeWi Nov 27, 2025

Choose a reason for hiding this comment

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

Well, now if there are no icons, there is no reason to clear it anymore.
I guess I will fix it together with auto-translation changes.

@Mickeon
Copy link
Member

Mickeon commented Nov 26, 2025

But nowadays, the filter options are available in the related menus. It's no longer necessary to use this placeholder I think.

Just to be pedantic, it was never necessary to change the placeholder. They always were available 😭

Comment on lines -1734 to -1735
filter_menu->set_item_icon(filter_menu->get_item_index(FILTER_BY_TYPE), get_editor_theme_icon(SNAME("Node")));
filter_menu->set_item_icon(filter_menu->get_item_index(FILTER_BY_GROUP), get_editor_theme_icon(SNAME("Groups")));
Copy link
Member

Choose a reason for hiding this comment

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

Icons are removed. Together with the checkbox above, they create confusing empty spaces.

They don't have to since #112545 . As the original author, I do like the icons...


void SceneTreeDock::_append_filter_options_to(PopupMenu *p_menu, bool p_include_separator) {
if (p_include_separator) {
p_menu->add_separator(TTR("Filters"));
Copy link
Member

Choose a reason for hiding this comment

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

The "Filters" text is removed from the separator. It's redundant, already in "Filter by Type" & "Filter by Group".

It's admittedly redundant, but it made for a nice distinction between other completely unrelated options. Is there any way to keep it, such as by shortening each option?

filter_quick_menu->clear();
if (filter_quick_menu == nullptr) {
filter_quick_menu = memnew(PopupMenu);
filter_quick_menu->set_theme_type_variation("FlatMenuButton");
Copy link
Member

@KoBeWi KoBeWi Nov 27, 2025

Choose a reason for hiding this comment

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

What's the variation for?
EDIT:
Wrong copy paste. It shouldn't have been assigned.

@KoBeWi KoBeWi modified the milestones: 4.x, 4.6 Nov 27, 2025
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

LGTM.

@akien-mga akien-mga merged commit 5e0ddec into godotengine:master Dec 1, 2025
20 checks passed
@timothyqiu timothyqiu deleted the filter-nodes branch December 1, 2025 10:58
@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.

6 participants

X Tutup