Skip to content

rustdoc: Don't search on every single keystroke in the search box #20095

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

Closed
ghost opened this issue Dec 21, 2014 · 1 comment · Fixed by #21339
Closed

rustdoc: Don't search on every single keystroke in the search box #20095

ghost opened this issue Dec 21, 2014 · 1 comment · Fixed by #21339
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ghost
Copy link

ghost commented Dec 21, 2014

Doing a search can take a full second. This is a major annoyance, especially when it triggers multiple times on mistype + backspace. Also, the results from the first few keystrokes are often not relevant.

Proposed solution: Introduce a delay before starting the search. KDevelop has a similar feature with a default of 500 ms, and it's awesome.

Other solutions:

  • speed up the search. A good idea in any case, but it's probably better to simply not do the work in the first place.
  • cancel the running search on a new keystroke.
  • only trigger on Enter.
@nodakai
Copy link
Contributor

nodakai commented Dec 21, 2014

My understanding is, it already has a delay of 100 ms:

$('.search-input').on('keyup', function() {
    clearTimeout(keyUpTimeout);
    keyUpTimeout = setTimeout(search, 100);
});

You may locally experiment with this parameter.

I also wonder if we should suppress incremental search when the input area has less than, say, three characters.

@kmcallister kmcallister added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Jan 16, 2015
thorncp pushed a commit to thorncp/rust that referenced this issue Jan 18, 2015
Increases the delay of the search box to 500ms after key up. I tried
adding a three character minimum for setting the delay, but didn't find
it very useful.

Should close rust-lang#20095
barosl added a commit to barosl/rust that referenced this issue Jan 20, 2015
…hton

Increases the delay of the search box to 500ms after key up. I tried
adding a three character minimum for setting the delay, but didn't find
it very useful.

Should close rust-lang#20095

@Jurily, your input is welcome!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants