-
Notifications
You must be signed in to change notification settings - Fork 13.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
Add the possibility to filter on more than one crate #86716
Comments
ooh that sounds interesting. A good UI definitely sounds tricky though |
I had something like that in mind: Eventually a button "select all" or something. Well, I'd prefer to wait for @jsha's return for this for the UI. :) |
Yeah I understood that part, I meant that it's tricky to make good |
Which is why we need @jsha 😆 |
I'm still around for a little bit (though trying to limit my computer time). My rough initial feedback would be:
|
This is a really good idea imo! |
I can describe the use case I had in mind (even though I'm not completely convinced about this feature): in gtk3 docs, it happens that I'm looking for a "common" method but I'm only interested in it in either gdk or gtk but can't filter only those two crates at the same time. So as you can see, it's not a huge need on my end, just thought that it might interest people so I proposed it. :)
I'd expect more dozen crates rather than hundreds, but I only have my own use case in mind so needs to be investigated further.
This is a pretty good idea. Worth a try at least! |
There are several times I've wanted a feature like this when searching the rustc API docs, so I'm definitely intrigued!
My use case is doc.rust-lang.org ;)
For my use case, it would be around 60 crates.
I agree that this sounds promising! I imagine it's much more common to either want to search the whole workspace or (in a smaller number of cases) to want really fine-grained filtering. |
A couple of interesting examples to possibly draw from: eBay's search results page lists a bunch of categories with checkboxes. I think the categories are automatically created (and ranked) based on what's in the search results. We could potentially do the same at the module level, not just the crate level. For example, show "there are 10 matches in foo::bar::baz, and 2 in example". I think a lot of flight search websites have a similar UI. It would be neat to check. Another implementation of this style of multi-select is Bugzilla's advanced search: You have to know about Ctrl-Click and Shift-Click to manage the multi-select though. I think this is less preferable.
Ah, you mean like https://doc.rust-lang.org/stable/nightly-rustc/?search=hir ? That's very helpful, thanks! Can you give an example of a search you've done where you'd want to filter it with this sort of feature? Also, would you want your selections to persist across page loads? That's what the current crate selection does, but we might want to change it if we add this more complex feature, since it would be easy to get into a surprising state. |
Unfortunately, I can't think of a good example off the top of my head. I'll try to remember if I come across a situation where it would be useful :)
I actually find it somewhat annoying that the current crate selection persists across different pages, but I don't use it that much because I find it too limited—usually it's just faster to type in the full qualified path. I think I would need to try out the new system before I would know. Maybe once a prototype is built, I could build a version of the compiler docs with it and try using it instead of /nightly/nightly-rustc to see what I think. |
I intend to add this once #129914 has landed. |
Currently, the search can only filter on one crate. Instead, it could be interesting to be able to pick more than one crate (and replace the
<select>
with a dropdown menu with tickboxes).What do you think @rust-lang/rustdoc ? (In particular @jsha)
The text was updated successfully, but these errors were encountered: