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

Debounce inspector search to make it more responsive #99812

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Nov 28, 2024

Before

godot.windows.editor.dev.x86_64_FG8l5EsZBZ.mp4

I'm writing text, but the editor is frozen as I'm writing, because the inspector updates with every letter. The text just appears in the end.

After

godot.windows.editor.dev.x86_64_NhySnNcxPO.mp4

You can actually see that I'm typing something.

The issue is a bit exaggerated, because it's a dev build, but it's still noticeable problem in official release. The PR adds a debounce timer, so the inspector won't search (and destroy/rebuild whole tree) every time you add a letter.

@KoBeWi KoBeWi added this to the 4.x milestone Nov 28, 2024
@KoBeWi KoBeWi requested a review from a team as a code owner November 28, 2024 22:41
@KoBeWi KoBeWi changed the title Debounce inspector search to make it more responsible Debounce inspector search to make it more responsive Nov 29, 2024
@KoBeWi KoBeWi force-pushed the responsible_inspector branch from e3e6f0e to 73908b1 Compare November 29, 2024 13:34
@KoBeWi KoBeWi requested a review from a team as a code owner November 29, 2024 13:34
@KoBeWi
Copy link
Member Author

KoBeWi commented Nov 29, 2024

Changed the implementation. I added DebouncedLineEdit, which has this behavior built-in. It's used in the inspector and AssetLibrary search.

@KoBeWi KoBeWi force-pushed the responsible_inspector branch from 73908b1 to a4eeb8c Compare November 29, 2024 13:35

void EditorInspector::_filter_changed(const String &p_text) {
update_tree();
search_box = Object::cast_to<LineEdit>(p_line_edit);
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't get why this method takes Node, but I kept support for the old behavior just in case.

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.

2 participants