-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Initial delay in the new global search experience #11206
Comments
See #9647 (comment) |
@kirawi Thanks for the pointer.
Typically when it's just about "muscle memory" I would remind myself that the new way could be better. But in this case, the same task is indeed taking longer and therefore the new impl is objectively inferior, at least for certain use cases. The cognitive overhead is also higher as the user would now need to monitor the list to wait for it to be populated, and only then press the Enter key, before returning to what they were originally planning to do. That extra overhead is... undesirable at best. Can we at least get the old non-interactive version back so we have two ways to do global searching. Personally I feel like these are 2 different use cases:
Tagging @the-mikedavis. WDYT? |
We could skip the debounce when inserting from a register or pasting. That would remove the delay both when you accept the suggestion from the history register and in your workflow. |
I looked back at the 24.07 release and I thought we blocked the UI waiting for the old global search but that isn't the case, so the Enter keypress can't quite be queued up. I assume that in your workflow the search is fast enough that it finds your pattern before the Enter is processed. With #11211 the behavior should be roughly the same as long as you're pasting or using the suggestion from the |
Replying to your comment here, @the-mikedavis, just to keep the discussion in one place.
100% agree. Just like @xJonathanLEI, I rely on global search because it is (or, rather, was) the fastest way to switch to something that you know for sure exists in one or just a few files. For cases where the query is copy-pasted, I think skipping the debounce on the initial query makes sense. This already covers many of my needs, so that's definitely a positive! But sometimes it's faster to just type the query out manually. I know when the query is complete, so there's no real need for intermediate searches. If I've got this right, the solution proposed is to make the debounce interval configurable so as to allow one to find the right balance between getting results fast and not spending resources on unnecessary search operations? If so, I have my doubts about this delivering the same feeling of immediacy as before – at least, not without sacrificing computational efficiency. I think the new pickers interface is fantastic. And I can understand that this change to how global search is triggered is to bring it more in line with how other finders are interacted with. Indeed, global search was always the odd-one-out in this regard. With some obvious bias, though, I'd argue that global search merits being a bit different. After all, the Apart from keeping things consistent, is there any reason why the first global search query can't be triggered manually, after which the new interactive picker opens? |
I'd mostly be worried about setting the debounce so low that you can't type two characters at normal speed without starting a search between them. Changing the query while a search is ongoing cancels the search so you aren't spamming full searches for every character entered with a low debounce. I suspect we can lower it to the point where it feels fairly immediate. The debounce constant for global_search is set here in milliseconds: helix/helix-term/src/commands.rs Line 2442 in 748a9cf
If you're building from source it'd be great if you could try tuning that constant to see if there's a value that feels right. We set the default debounce as low as 100ms for the LSP workspace_symbol_picker although that strikes me as a little low for global search.
This seems like a clunky UX to me: you need to enter the query first in a prompt at the bottom of the screen and then your focus moves up to the picker's prompt near the top |
Seems like it should be pretty easy to make this a config option as well, what are thoughts on adding this to |
It should just use the existing idle-timeout config. That's currently used for completion but the point of it was to set it to a value high enough to trigger only when you stop typing. This highly depends on your average typing speed |
I agree that "instant search on paste" already covers most of the use case, though it leaves out the case where I use a "WIP marker" like In cases that do get covered though, the new way is actually faster than the old prompt way by saving one |
Might it be useful to reintroduce the first I'm not sure how this experience will be, but I think it allows for both fast, deterministic (I know what I'm looking for) searches as well as more browsing-like using the dynamic approach. Anyhow, I appreciate how this is discussed, thanks for everyone's contributions! |
Summary
Same as #11205, filing as bug report as this used to work.
There seems to be an initial delay in the new picker-based global search experience. Once a pattern is entered, it takes a short while before the actual searching begins. I haven't looked at the code but I feel like this is intended to be a feature?
One important use case of the global search has been broken by this behavior. Often I find myself knowing for sure a certain string pattern exists and only ever exists once in the entire project. All I want to do is to very quickly get to that line in that file to start working on it. What I used to do is a quick
<space>
/
[paste]
<enter>
. I'd not wait before pressing<enter>
as I know for sure there's one and only one occurrence inside the whole project. But now this workflow is broken thanks to the delay, as the actual search only starts after the input delay, before which I've already pressed<enter>
, failing to open any file.I feel like this is common enough use case that it should not be broken. For example, when running tests and some of them fail, it's common to copy the test case name and search for that.
Even in cases where more than 1 occurrence is expected, the delay makes searching experience much worse than before.
Yes, I know that global search has turned async a long time ago so there's a chance that the algo just isn't discovering the file quick enough. But not, doing this one a folder containing like 5 files and you'd still run into the issue.
Reproduction Steps
Copy something that exists in your project into your clipboard, and quickly perform the
<space>
/
[paste]
<enter>
combo. You'd expect a file to be opened but none actually does.Helix log
N/A
Platform
Any really
Terminal Emulator
Any really
Installation Method
Any really
Helix Version
helix 24.7 (b0cf86d)
The text was updated successfully, but these errors were encountered: