-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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: click target for sidebar items flush left #127229
Conversation
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
ba31ec3
to
5fc30b8
Compare
Some changes occurred in GUI tests. |
Just one question: should we also extend the background to the left? Makes it a bit weird because without knowing that this will click the link, I'm not sure if it's not gonna click something else. |
I wouldn’t mind extending the background all the way to the left. It’s actually easier to do it that way. |
Even better then. I'll approve once done. |
.logo-container + h2 > a {
// current style
} should do the trick? |
The problem isn't that I want to make it different. It's that I want it to be the same. Screen.Recording.2024-07-02.at.08.40.15.movIf the text is long enough, it line wraps. When that happens, I want it to look and act just like any other nav item. If the other ones have a background that goes all the way to the edge, then this one should, too. |
I see. Urg, UI. |
I've figured out a reasonable way to make it work right with the logo lockup. It shows the highlight going all the way to the left for all menu items, including the crate name, except when it's in a horizontal lockup. Screencast.from.2024-07-15.15-31-07.webm |
This comment has been minimized.
This comment has been minimized.
c102333
to
75a08cc
Compare
This comment has been minimized.
This comment has been minimized.
75a08cc
to
3924493
Compare
Wow, impressive, well done! Please add a GUI test then I'll make one last review before r+. |
@GuillaumeGomez Sure, here's a test case for you. |
// Check that the sidebar links touch the left side of the box | ||
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" | ||
assert-position: (".sidebar .block a", {"x": -4}) | ||
assert-position: (".sidebar-crate > h2 > a", {"x": -3}) |
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.
Could you also test the resizing (where the image move)?
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.
Makes sense. I've updated that test case here.
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.
Ah sorry, wasn't clear enough. For both cases, can you resize the side to ensure that the text moves under the logo when it's too small please?
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.
lib2
doesn't have a logo at all, so resizing won't do anything.
huge_logo
does have a logo, so I've added another test.
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.
👍
48dd9ab
to
4eca8a4
Compare
4eca8a4
to
5514906
Compare
It's great, thanks a lot! @bors r+ rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#125042 (Use ordinal number in argument error) - rust-lang#127229 (rustdoc: click target for sidebar items flush left) - rust-lang#127337 (Move a few intrinsics to Rust abi) - rust-lang#127472 (MIR building: Stop using `unpack!` for `BlockAnd<()>`) - rust-lang#127579 (Solve a error `.clone()` suggestion when moving a mutable reference) - rust-lang#127769 (Don't use implicit features in `Cargo.toml` in `compiler/`) - rust-lang#127844 (Remove invalid further restricting suggestion for type bound) - rust-lang#127855 (Add myself to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#125042 (Use ordinal number in argument error) - rust-lang#127229 (rustdoc: click target for sidebar items flush left) - rust-lang#127337 (Move a few intrinsics to Rust abi) - rust-lang#127472 (MIR building: Stop using `unpack!` for `BlockAnd<()>`) - rust-lang#127579 (Solve a error `.clone()` suggestion when moving a mutable reference) - rust-lang#127769 (Don't use implicit features in `Cargo.toml` in `compiler/`) - rust-lang#127844 (Remove invalid further restricting suggestion for type bound) - rust-lang#127855 (Add myself to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#125042 (Use ordinal number in argument error) - rust-lang#127229 (rustdoc: click target for sidebar items flush left) - rust-lang#127337 (Move a few intrinsics to Rust abi) - rust-lang#127472 (MIR building: Stop using `unpack!` for `BlockAnd<()>`) - rust-lang#127579 (Solve a error `.clone()` suggestion when moving a mutable reference) - rust-lang#127769 (Don't use implicit features in `Cargo.toml` in `compiler/`) - rust-lang#127844 (Remove invalid further restricting suggestion for type bound) - rust-lang#127855 (Add myself to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#127229 - notriddle:notriddle/mile-wide-bar, r=GuillaumeGomez rustdoc: click target for sidebar items flush left This change adjusts the clickable area of sidebar links to touch the leftmost edge of the canvas, making them [much easier](https://www.nngroup.com/articles/fitts-law/) to click (when the browser window is maximized or tiled left, but those cases are common enough to matter). [Screencast from 2024-07-15 15-31-07.webm](https://github.com/user-attachments/assets/1e952d3a-e9e7-476b-b211-44a17c190b38) <details><summary>old screencast</summary> [Screencast from 2024-07-01 17-23-34.webm](https://github.com/rust-lang/rust/assets/1593513/dc6f9c2e-5904-403d-b353-d233e6e1afbc) </details>
This change adjusts the clickable area of sidebar links to touch the leftmost edge of the canvas, making them much easier to click (when the browser window is maximized or tiled left, but those cases are common enough to matter).
Screencast.from.2024-07-15.15-31-07.webm
old screencast
Screencast.from.2024-07-01.17-23-34.webm