-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Added a rustdoc
shortcut for collapse/expand all
#33765
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
Conversation
Now when the user presses the "+" key all sections will collapse/expand. Also added a note to the help screen which describes this behavior.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cmr (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I'm not so sure this is a good idea. For example, what happens if I want to scroll in and press CTRL+"+"? |
That's a valid concern. Do you think having such a shortcut is a bad idea, or we should just use a better (more un-ambiguous) key? |
Both I guess. I don't see a case where we'd need to expand all items at once. But maybe I'm wrong? |
The experience I had in mind was when someone is searching through documentation for something that will let them do "X" (such as, trying to figure out how to unwrap an option or get some default value - What you really want is to peruse a summary of functions, then more closely investigate those whose names/type signatures align with your idea. The collapsed mode shows these names and signatures clearly, while the expanded mode makes them a bit harder to see. Switching from the starting all-expanded mode to the all-collapsed mode currently requires the mouse; you must click on the [+/-] button in the upper right. It would be smoother if one could continue to just use the keyboard. I hypothesize (but could be incorrect) that the above search & peruse workflow is worth improving. We could do so in a few ways, but I think the minimal change is to introduce a shortcut for the collapse/expand button. Alternatively, we could have the collapsed mode be the mode that the page starts in, or introduce a method list (like Java Doc), but I think these both have more substantial drawbacks. The reason for making a collapse/expand shortcut rather than just a collapse shortcut is in some sense simplicity. A collapse/expand shortcut would just be a keyboard shortcut for the (already existing) [+/-] button, rather than a new type of action. Maybe I'm thinking too hard about something pretty small - one could reasonably argue the value/complexity ratio of the change is not favorable. |
@bors r+ |
📌 Commit ab09fbc has been approved by |
Added a `rustdoc` shortcut for collapse/expand all Now when the user presses the "+" key all sections will collapse/expand. Also added a note to the help screen which describes this behavior. This required increasing the height of the help screen.
@Manishearth: The problem wasn't solve. In case you want to scroll in, it'll also expands everything. >< |
Could you make another PR to switch the keybinding to something that's not already taken? |
Meanwhile, I'll open an issue about this. |
Now when the user presses the "+" key all sections will collapse/expand.
Also added a note to the help screen which describes this behavior.
This required increasing the height of the help screen.