Skip to content
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

[rustdoc] Remove query component from URL by pressing ESC #81330

Closed
tesuji opened this issue Jan 24, 2021 · 4 comments · Fixed by #81379 or #82234
Closed

[rustdoc] Remove query component from URL by pressing ESC #81330

tesuji opened this issue Jan 24, 2021 · 4 comments · Fixed by #81379 or #82234
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@tesuji
Copy link
Contributor

tesuji commented Jan 24, 2021

mdbook v4.6+ has a feature that pressing ESC removes query components from URLs (for example ?highlight=...).
The feature was implemented in rust-lang/mdBook#1427.

It would be nice if rustdoc offers the same kind of that feature.

This is, for example, an URL that contains query components in rustdoc: https://doc.rust-lang.org/nightly/std/time/struct.Duration.html?search=asdfasdf.

What's the benefit of this feature?

When users share URLs to an API, they don't have to remove the query manually.

@rustbot rustbot added C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 24, 2021
@tesuji
Copy link
Contributor Author

tesuji commented Jan 24, 2021

@GuillaumeGomez, could you share some thoughts about this feature request?
If possible, could you mentor contributors how to implement this ?

@GuillaumeGomez
Copy link
Member

I think it's a good idea. Gonna take a look at how to do it.

@jyn514 jyn514 added the A-rustdoc-ui Area: Rustdoc UI (generated HTML) label Jan 24, 2021
@bors bors closed this as completed in 0b1870e Jan 28, 2021
@tesuji
Copy link
Contributor Author

tesuji commented Jan 29, 2021

Can we reopen this issue ?
I think #81379 only removes the query component when we remove keywords in search bar.
This issue is about adding a keyboard shortcut.

@GuillaumeGomez
Copy link
Member

Oh I see, my bad. Reopening!

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 22, 2021
…n-esc, r=Nemo157

Remove query parameters when skipping search results

Fixes rust-lang#81330.

This PR changes the following: when pressing ESC and that no other "action" was performed (understand: no closing the search result, or hiding a menu or something along the line), then we discard the URL query parameters (the `?whatever=dsjfs`). What do you think about this change `@rust-lang/rustdoc` ?

EDIT: finally we're simply removing the query parameter when we're skipping the search results.

r? `@Nemo157`
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Feb 23, 2021
…n-esc, r=Nemo157

Remove query parameters when skipping search results

Fixes rust-lang#81330.

This PR changes the following: when pressing ESC and that no other "action" was performed (understand: no closing the search result, or hiding a menu or something along the line), then we discard the URL query parameters (the `?whatever=dsjfs`). What do you think about this change ``@rust-lang/rustdoc`` ?

EDIT: finally we're simply removing the query parameter when we're skipping the search results.

r? ``@Nemo157``
@bors bors closed this as completed in 8541435 Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
4 participants