Skip to content

Selection resets to first item when loading completes during global search #3464

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

Open
onesounds opened this issue Apr 14, 2025 · 3 comments · May be fixed by #3480
Open

Selection resets to first item when loading completes during global search #3464

onesounds opened this issue Apr 14, 2025 · 3 comments · May be fixed by #3480
Labels
kind/ux related to user experience

Comments

@onesounds
Copy link
Contributor

Description:

When performing a search, if the loading bar is still active and the user navigates through the result list (e.g., moves down two items), the selection will automatically reset to the first item once the loading completes. This causes an issue where users may accidentally select the wrong item — for example, pressing Enter to select the third item just as the loading finishes will instead select the first item.

Expected Behavior:

The current selection should remain unchanged when loading completes and new items are rendered.

Steps to Reproduce:

  1. Trigger a global search that takes time to load results.
  2. While the loading bar is visible, move the selection down (e.g., to the third item).
  3. Just as the loading finishes, observe that the selection jumps back to the first item.
  4. Press Enter — the first item gets selected instead of the intended one.

Impact:

This can lead to a frustrating user experience and unintended selections, especially when trying to act quickly during search.

@onesounds onesounds added the kind/ux related to user experience label Apr 14, 2025
@TechySC23
Copy link

Bug confirmed by me, this happens when loading is very slow, for example those using Windows Indexing, and this is very irritating when typing very fast.

@Jack251970
Copy link
Contributor

Jack251970 commented Apr 17, 2025

But how can we fix that? The results are ranked by score and the position of the third item during loading could be anywhere when loaded. Moving select cursor to it when results are loaded is not a good idea.

@onesounds
Copy link
Contributor Author

I worked on this and tested it — everything works fine technically.
But honestly, the problem is more about the feel. It’s annoying when the user’s intended action gets overridden.

We could block interactions until loading is done, but that just feels worse. It’s not the right move UX-wise.

Think of it like this: imagine someone trying to cross the street. Whether they go or not should be their choice. But what we’re doing is — the moment a car shows up — we drag them back to the sidewalk, or worse, freeze their arms and legs until the car passes. That’s not cool.

It’s totally fine if new content loads in the background — like once loading finishes and results pop in. That doesn’t mess with what the user is doing.

And even if someone finds that annoying, they can always just remove slow-loading plugins from global results. So no need to force anything.

Point is: let people move. Let them interact.
Even without this fix, as you said, the results will refresh anyway once loading’s done — so unexpected stuff might still happen no matter what. But at least we won’t be blocking them from doing what they want.

p.s Also, there's an issue where the scroll position gets reset when switching to the context menu and then coming back. We should fix that too.

@onesounds onesounds linked a pull request Apr 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/ux related to user experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants