-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make [-] invisible in most cases #86154
Conversation
This reduces clutter on the page, while still supporting the "auto hide X" settings and the "collapse all docs" button.
Some changes occurred in HTML/CSS/JS. Some changes occurred in HTML/CSS themes. A change occurred in the Ayu theme. cc @Cldfire |
This comment has been minimized.
This comment has been minimized.
This was originally introduced in # 51387, to solve a UI problem: in a list of collapsed methods, it was not clear whether the stability marker attached to the item above it or the one below it. That problem has now been solved in a couple of different ways: - The margin between the stability marker and the item it annotates is much smaller, indicating their relationship. - Stability markers are now collapsed along with the docblock. Also, the arrow made our CSS fragile, since it was positioned absolutely and needed to line up horizontally with the beginning of the item (or with the link icon). Aligning this with the rest of the docblock makes getting the CSS right a lot easier.
The job Click to see the possible cause of the failure (guessed by this bot)
|
We have a failure in the rustdoc-gui tests that is presumably triggered by the real behavior change here. I've tried to debug it locally but I'm not sure how to get an interactive browser session to poke around after a test fails. Any recommendations @GuillaumeGomez ? |
Two places I would still leave the toggle is the per-impl-block headers and the description. The former are not toggled by the "collapse all docs" button so there is no way to collapse them now, the latter I at least very commonly collapse to get it out of the way and start skimming the method docs. This also exacerbates an existing nightly issue that the text in trait-implementations is not indented far enough, previously that was sort of ok since the but now it's very hard to find the method headers inside the trait-implementation. |
Sorry but I really don't like it either... The disappearance of the toggle makes it look like you can't collapse it anymore. And just like @Nemo157 said, it actually makes the reading harder. This was a good visual element to "separate" elements. |
One other anecdote: for me the [-] button next to methods is an important visual landmark that helps my eyes "feel" where the beginning and end of each method's docs are. With that button removed, this visual landmark is gone, meaning there's no differentiation in indentation or any other sort of prominent landmark via which to identify the beginning / end of a method in an impl block. |
That's good feedback that people see the I figured what I'm trying to get at here would be clearer if I put together a few of the changes I'm thinking of into one PR rather than doing this piecemeal. Take a look at #86283.
Is the idea that people are likely to want to collapse toggles one-by-one? Or do you want the series of |
I can only use myself as example: I tend to collapse everything by default and then expand items to check if this is the one I'm looking for, and if not, to collapse it again. |
☔ The latest upstream changes (presumably #86399) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing. Some of the same concepts are incorporated into #86283; when I pick that up again I'm interested to explore this more. |
Many items on doc pages are collapsible, so they have
[-]
/[+]
items. These icons take up critical space in the gutter, reducing the ability to scan for an item you're looking for. The[+]
icon is very important, so you can open the item you're looking for once you find it. But for a group of toggles that are already open, having[-]
is not very useful, since collapsing a single item doesn't give you a much clearer view of the page.This PR changes the UI so that
[-]
doesn't show up on sections that are toggled open. Those sections can be toggled closed with the keyboard shortcuts or the button in the top right. Also, some sections (like methods) can be toggled closed by a setting.For sections that start in a closed position, when you click the
[+]
to open them, they will get a[-]
to close them again. Otherwise it would be frustrating to open a section and not be able to immediately change your mind and close it.This change made the
⬑
in stability output point into empty space, so I changed the display of stability information to not use⬑
(see comment on 770f7dd2d01054f64d8433034a8e8ee8ff53c26a).Fixes #85372
Demo: https://jacob.hoffman-andrews.com/rust/invisible-toggles/std/string/struct.String.html#implementations
https://jacob.hoffman-andrews.com/rust/invisible-toggles/std/io/trait.Read.html#provided-methods
r? @GuillaumeGomez