-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
EditorHelpSearch
improvements
#62524
Conversation
7b82620
to
f56ba94
Compare
I believe the issue is solved but gonna have to make icons for constructors and operators unless those should just be kept as method |
For consideration, currently there's an inconsistency in how search term length is handled: Classes: Members: I think this should be unified into one of the two, and I'm personally in favor of two characters as searching for just one is kind of pointless, but I'd like some input on this I'm currently going for the two characters option and looking at limiting search update when going from 0->1 or 1->0 characters where no change would occur |
913bb23
to
c777151
Compare
This PR currently:
I would appreciate some input on the following:
I'm currently working on preventing search from updating when no change would occur, and ensuring nothing weird happens when the popup opens again, and tweaking the iteration to make it feel smooth Any and all input is very welcome, this is my first PR and I just want to say that I've been following Godot and making things with it for some time now and I've rarely been in a more welcoming and productive environment, much love! Edit: Much of this is now outdated see below |
c777151
to
fe5b022
Compare
9e333d1
to
ccf9e6e
Compare
I implemented a basic index and filling from this index, it's very much a work in progress and code needs some cleaning up, some that belongs in the header is kept out of it to avoid recompiling lots of unrelated files etc. but I wanted to show what my current approach was. It probably needs some further tweaking to be smoother but it works far better I feel. I will probably work more later today and clean it up and restructure a bunch of the setup, probably try move the filling into the runner to unify the code, but threw something together to see how to make it work. Edit: Restructured the filling and made the tentative decision to collapse classes with no child classes, this greatly improves speed and reduces clutter in my opinion, it needs a bunch of tweaking and restructuring still but if this is a feature we want (I for one do) then I think it is now manageable in its implementation. For comparison between collapsed and uncollapsed comment out: It turns out that shaping a tree of about 17700 items is a bit of a slog 😖 |
836d0f6
to
4036832
Compare
Filling of the tree from the index is now moved to the runner, I've still got some details to work out and some style aspects to decide on, and add code for the filling without hierarchy which takes a little reworking from my current temporary solution, but it appears to work smoothly for me now. Update on the changes of this PR:
Things still to do:
For consideration:
|
4ba15a9
to
619a8b9
Compare
No it searches for classes when terms are short, check the code for the else block, unless the code is broken since last I tried It doesn't match correctly with short terms indeed, will fix that |
6531752
to
215454f
Compare
There, now matches fully on short searches and checks keywords on short searches as well, but only checks classes and does not filter members on short searches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested again and works as expected now.
Looks good, great work!
Things out of scope of this PR which came to my mind:
- It would be nice to have unit tests for this
- The icons look fine to me, although I think we should color (all of) them
- Search should be async, so there is no noticeable input delay (any thoughts on this?)
Thank you! Don't see how we could add unit tests for this, what would we test? It's internal and we don't have unit tests for any editor features at all The search is async but it fills in the list online, so not sure how that could be solved except with having a timer delaying starting searching until after a pause in inputting |
I believe most of the times it's handled this way, yes, although I've not seen this kind of thing done in the editor as far as I know. Except, say, the script editor's autocompletion. |
It doesn't seem to work properly for me on Linux (Fedora 40 on Wayland, running X11 editor). Testing latest commit from this PR rebased on The search with empty filter looks correct: But after typing a search, nothing is shown: Reopening the dialog makes it redraw and now results are visible: |
Will investigate Can confirm, recent regression no clue what might have caused it, will try digging This happens on Regression from: |
215454f
to
f556bff
Compare
Wrote a fix for the regression, including here temporarily to help with testing, see: |
Yep, that is one thing that needs to improve in order to find editor regressions as soon as possible. We have the [Editor] tag for test cases which should allow testing this (if not it needs to be extended/fixed). The only thing we need is another small refactoring (maybe one or two interface methods) to make it testable. Writing some unit tests to find regressions would be easy then.
Alright, maybe it's not that bad in release builds, but at some point I think we should find a solution for the lag (although not here and now). |
f556bff
to
8603b74
Compare
I don't remember why the "Nest hierarchy" commit is separate, is that still up for discussion whether this should be included or not? Is it meant to stay separate for clarity, or be squashed eventually? If kept separate, the commit message should likely be more explicit (it should be "standalone" too). |
Will squash it if everything is approved, once CI has finished and will clarify the original commit message as well, I think the nested hierarchy (adding headings for constructors, methods, etc.) is good to keep |
The showing of the sub-headers is done if there's more than one entry of that kind, with a short search only classes are filtered at the present It picks Filtering on members on short searches could be added but I think it's of limited use as searching for just Adding filtering on member items would take a little more work so if we decide to add that as well I'd prefer to do it separately |
8603b74
to
306422c
Compare
Just gonna push a usability improvement for navigation after I've tested it, not directly relevant at the moment because of a limitation in |
* Adds all member types to empty search * Nests hierarchy adding constructors, methods, operators, etc. under a nested entry to reduce clutter Co-authored-by: MewPurPur <mew.pur.pur@gmail.com>
306422c
to
5c9cd6a
Compare
Thanks! |
Thank you! My first ever PR finally merged! 🎉 |
Makes editor help search show constructors/methods/signals/etc. when search is empty
This also adds operators and constructors as they were lost after #53452, though only builtins have those so it's relatively minor.
Depends on #77554 and #77471, which it includes, please add notes for those (the first two commits) thereProduction edit: closes godotengine/godot-roadmap#19