Skip to content

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jan 25, 2021

Fixes #81330.

Explanations: before this PR, when emptying the search input, we still had ?search= in the URL, which wasn't very nice. Now, if the search is empty, we drop the ?search= part.

Also, I realized while working on this PR that when we clicked on a menu link when we were on the search results, the search parameters would look like: ?search=#the-anchor, which was super weird. Now, it looks like this: ?search=the-search#the-anchor.

Also, I didn't use the Url very nice API because it's not available in any IE version (sadness...).

cc @lzutao
r? @Nemo157

@rust-highfive
Copy link
Contributor

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 25, 2021
@Nemo157
Copy link
Member

Nemo157 commented Jan 25, 2021

Also, I realized while working on this PR that when we clicked on a menu link when we were on the search results, the search parameters would look like: ?search=#the-anchor, which was super weird. Now, it looks like this: #the-anchor?search=the-search.

Query must come before the fragment, otherwise it is just part of the fragment content: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=7db14933706efebda3821140565faefd.

@tesuji
Copy link
Contributor

tesuji commented Jan 25, 2021

Wikipage about URI syntax: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax

@tesuji
Copy link
Contributor

tesuji commented Jan 25, 2021

I didn't use the Url very nice API because it's not available in any IE version (sadness...).

Disclaimer: Not a web developer by any means.
What would happen if we use unsupported APIs like URL in IE ?

@GuillaumeGomez
Copy link
Member Author

What would happen if we use unsupported APIs like URL in IE ?

A big JS error and some broken state for the website.

@GuillaumeGomez GuillaumeGomez added A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 25, 2021
@GuillaumeGomez
Copy link
Member Author

Fixed the URL order and made the changes more "global".

@Nemo157
Copy link
Member

Nemo157 commented Jan 26, 2021

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 26, 2021

📌 Commit 09518db has been approved by Nemo157

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 26, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2021
Rollup of 13 pull requests

Successful merges:

 - rust-lang#70904 (Stabilize `Seek::stream_position` (feature `seek_convenience`))
 - rust-lang#79951 (Refractor a few more types to `rustc_type_ir` )
 - rust-lang#80868 (Print failure message on all tests that should panic, but don't)
 - rust-lang#81062 (Improve diagnostics for Precise Capture)
 - rust-lang#81277 (Make more traits of the From/Into family diagnostic items)
 - rust-lang#81284 (Make `-Z time-passes` less noisy)
 - rust-lang#81379 (Improve URLs handling)
 - rust-lang#81416 (Tweak suggestion for missing field in patterns)
 - rust-lang#81426 (const_evaluatable: expand abstract consts in try_unify)
 - rust-lang#81428 (compiletest: Add two more unit tests)
 - rust-lang#81430 (add const_evaluatable_checked test)
 - rust-lang#81433 (const_evaluatable: stop looking into type aliases)
 - rust-lang#81445 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0b1870e into rust-lang:master Jan 28, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 28, 2021
@GuillaumeGomez GuillaumeGomez deleted the improve-urls branch January 28, 2021 12:30
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) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[rustdoc] Remove query component from URL by pressing ESC
6 participants