-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add some small improvements to make the list load a bitfaster #41
Conversation
ee04247
to
ddd8d4c
Compare
<15 s to fully populate on my machine vs 45 on main! |
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.
For me this makes a marked difference and with showing how many are to be loaded makes it easy to estimate how long to wait.
filtering works well, thought I don't love the 200 ms pause -- left a question about that.
I'm going to approve, but hopefully one more person takes a look before merging.
Thanks a lot @psobolewskiPhD for the review. You raised valid points and indeed the 200 can be lowered. https://arxiv.org/pdf/1208.6109 so english average word is 5.1 letters, assuming a typing speed 60 word per minute (https://typing-speed.net/keystrokes-per-minute I tried this one and got 361 letters in 60 seconds, I am not a very fast typer hahah), so we can do some quick math and get: 5.1*60 + 60 = 366 letters in 60 seconds (the extra 60 is to account for spaces), so: So I think I have read somewhere that 150ms was a good number for interstroke time, I just bumped it a bit, but maybe 150 works after all :) |
Ah, thanks for the explanation. So you're sort of debouncing. I don't see this if I switch to Maybe worth trying the |
Hi @psobolewskiPhD, yes, indeed debouncing basically, to avoid triggering the filter for just one letter, we could make sure to always have at least 2 letters or 3 before actually doing any filtering, that would also work. Will take a look at superqt, I thought about it but did not test it. Will check the first letter issue that you mention! Thanks again for the comments and the review :) |
I've dealt with this kind of issue in the past (see UX for search at https://conda-forge.org/packages/) and resorted to the following strategy:
Depending on the volume of results for If this is too weird, then I suggest disabling search for queries of length == 1. |
It was fairly simple to implement your suggestion @jaimergp , so I think we are good now with this PR :) |
It should also show packages starting from |
Done @Czaki ! |
Definitely feels better, but I still see a delay when typing a word like lung naturally, after the first letter. |
Will check again, as I am not seeing that on my side 🤔 |
Feels really solid now!
(open the manager, search for something, close the manager, quit napari) Also, I was surprised to see the search persist through closing the widget, but I guess that's the caching from the other PR. |
Hi @psobolewskiPhD thanks a lot for all the feedback. Hmmm weird, that traceback feels unrelated. But I will try to reproduce and see if soemthing i did messd it up!
Indeed! I can reset the search on reopen, that would probably feel more natural. Also working on a separate PR to add notifications when things ended or finished if for example you started installing something and closed the dialog. That way the user knows when something finished installing or if an error occured ✌🏼 |
Shoot hang on, I could have had a branch checked out in napari repo. When I had this checked out. 😬 Edit: yup, sorry false alarm! I apologize I wasn't even thinking about my napari repo, even though to test this need |
for more information, see https://pre-commit.ci
Co-authored-by: Peter Sobolewski <[email protected]>
for more information, see https://pre-commit.ci
@psobolewskiPhD now the filter gets cleared on hide/close to match your expectations, also added a small fix and now is good to go. Will merge after tests pass so I can focus #45 which is the final piece of work ! |
The failing test does not seem reproducible. Tested locally, will merge an iterate on the last PR |
Add small improvement on perceived speed of loading:
start_with_char
or less chars are typed then we match with starting letters only, otherwise we see if the text is contained in name/description etc. We also search for plugins that start withnapari-
plus the number of characters defined bystart_with_char