-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Support type '/' to search #123355
Support type '/' to search #123355
Conversation
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
I remember we had a discussion about changing the key to focus on the search input but can't find it again... I don't really have an opinion on this matter so let's see if everyone else agrees with it. @rfcbot fcp merge |
Team member @GuillaumeGomez has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
I'd have preferred |
@@ -135,7 135,7 @@ <h2>Files</h2> {# #} | |||
aria-label="Run search in the documentation" {# #} | |||
autocomplete="off" {# #} | |||
spellcheck="false" {# #} | |||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# #} | |||
placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" {# #} |
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.
Can we change this to just "Search"?
placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" {# #} | |
placeholder="Search" {# #} |
I know it's a bit off-topic, and I'll approve this PR even if the change isn't made, but the keyboard command should probably be made less prominent.
- The whole premise of the PR is that we don't actually need to tell people about this keyboard command. They will assume it exists in Rustdoc because it exists in GitHub, Discourse, MDN, Zulip, GitLab, other websites that I don't know about, and VI.
- If you don't have a hardware keyboard, the UI is presenting things to you that you can't use.
- The
?
command only works if you're on a big enough screen. If you're on a small viewport, the?
keyboard command does nothing even if you have a hardware keyboard. The button is also gone. - "Search" ought to be the first word, for ease of scanning.
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.
I was thinking about adding the available keys on the right of the search input a bit like what the github search input has. Then depending on the screen width, we can easily hide the ones not available.
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.
The search bar has had explicit words about the keyboard commands since 1.0. I'm pretty sure the reason they did it that way was because the ?
button didn't exist yet.
Now that there's a help button, do we really need the stuff in the search box? We don't have on-screen indicators for most keyboard shortcuts; what makes search different other than the fact that we've always done it that way?
Ranked preferences
-
No indicator for keyboard shortcuts unless you open the Help window is ideal IMO. Keyboard shortcuts aren't important enough to justify redundancy. We should spend our above-the-fold-clutter budget on the actual crate's documentation.
-
If you really want to have an on-screen indicator for this keyboard shortcut, the way it's done now is ideal. It's very straightforward, so at least we're spending screen real estate on something the user will actually understand and benefit from.
-
Are you suggesting something like this?
I don't like that approach at all. It seems like a bad compromise that's worse than either of the "extremes," because it's adding stuff on the screen but it's so subtle that new readers probably won't even understand what it means. Few sites display it that way according to this guy
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.
Convenience and also people (sadly) seem to rarely ever click on the ?
button.
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.
I think maybe just having "/ to search" as a short snippet would be fine. We shouldn't inundiate them with information here, but having "/ to search" on a search box is quite standard and not distracting (github does it).
Having more complex text is distracting
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.
I agree with just having '/' to search
or Type '/' to search
, like what github does
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Perhaps one thing worth noting is that Firefox has a default binding for |
Actually, the FF thing overrides GitHub's slash-to-search for me, not the other way around (and I would much rather have slash start GitHub's search). |
That's weird. For me in Firefox (on Linux) |
🤷🏼 I'm also on [arch] linux, sway, FF dev edition 125.0b9 (though this has been the case for a few releases I'm pretty sure) |
Arch for me as well, although X11 (Awesome) not Wayland. FF 124.0.1 |
This comment was marked as off-topic.
This comment was marked as off-topic.
I think we're going really off-topic here and honestly I don't care that much. You know where to message me in case you want to chat more about this; this GitHub PR doesn't seem like the right place. |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
With all the new comments since we debated about adding this feature. Should we move forward regardless? |
They don't change my position here imo. |
Well at least it comforts me in the idea that we should support both Well, as usual, we can revert if it's too much of an issue in the issue. For now I think it's fine to go through with this. Thanks everyone! @bors r rollup |
…meGomez Support type '/' to search Related topic on IRLO: https://internals.rust-lang.org/t/rustdoc-use-key-to-search-instead-of-s/20559
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#122632 (fetch submodule before checking llvm stamp) - rust-lang#123355 (Support type '/' to search) - rust-lang#123501 (Stabilize checking of cfgs at compile-time: `--check-cfg` option) - rust-lang#123535 (Match ergonomics 2024: `mut` doesn't reset binding mode) - rust-lang#123711 (drop `changelog-seen`) - rust-lang#123969 (The new solver ignores `DefineOpaqueTypes`, so switch it to `Yes`) - rust-lang#124007 (Miri subtree update) - rust-lang#124017 (Change a diagnostics-path-only `DefineOpaqueTypes` to `Yes`.) - rust-lang#124018 (interpret: pass MemoryKind to before_memory_deallocation) - rust-lang#124024 (interpret: remove outdated comment) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#123355 - mu001999:rustdoc/search, r=GuillaumeGomez Support type '/' to search Related topic on IRLO: https://internals.rust-lang.org/t/rustdoc-use-key-to-search-instead-of-s/20559
Related topic on IRLO: https://internals.rust-lang.org/t/rustdoc-use-key-to-search-instead-of-s/20559