-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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: add a handle that makes sidebar resizing more obvious #139420
base: master
Are you sure you want to change the base?
rustdoc: add a handle that makes sidebar resizing more obvious #139420
Conversation
The job Click to see the possible cause of the failure (guessed by this bot)
|
Do any other applications have resize handles that look like this? I can't think of any, but I haven't really looked. |
I've definitely seen something similar before, but i can't say exactly where. maybe it was an old version of chrome os when using 2 windows in split screen. there's not a lot of "modern" (non-skeuomorphic) programs that use resizable ui element (unfortunately imo, win95 era ui has a lot of conventions that are very useful), so i'm a bit starved for inspiration outside of dishant memories. there's the textarea handle, but that would clash awkwardly with the scrollbar. at the very least, this should make it clear that there's something that can be done there, which is a large improvement over the statue quo. i should definitely add a tooltip, tho. |
I poked around a few apps that I knew had resizeable sidebars. You're right: most have nothing. The folder navigation sidebars in GitHub, Windows, macOS, KDE, and GTK are all resizeable, but there's no real indicator of this, just a line. The ones I found were mdBook, The GIMP, and LibreOffice. ScreenshotsNote that the big black thing in LO's sidebars is actually a button you can click to hide and show the sidebar, but you can also drag it. Here's what it looks line with version that looks line LibreOffice and mdBook: Here's what it looks like with a copy of GIMP's version: Code/* mdBook/libreoffice version */
.sidebar-resizer {
touch-action: none;
width: 9px;
cursor: col-resize;
z-index: calc(var(--desktop-sidebar-z-index) + 1);
position: fixed;
height: 100%;
left: calc(var(--desktop-sidebar-width));
border-left: solid 2px var(--sidebar-background-color);
border-right: solid 2px var(--main-background-color);
image-rendering: crisp-edges;
background:
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="32" viewBox="0 0 8 32"><line stroke-width="2" stroke="%23888" y1="24" x1="3" y2="8" x2="3"/></svg>') no-repeat center center;
}
/* GIMP version */
.sidebar-resizer {
touch-action: none;
width: 9px;
cursor: col-resize;
z-index: calc(var(--desktop-sidebar-z-index) + 1);
position: fixed;
height: 100%;
left: calc(var(--desktop-sidebar-width));
border-left: solid 2px var(--sidebar-background-color);
border-right: solid 2px var(--main-background-color);
border-image:
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAQCAAAAAAO4WGhAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAdnJLH8AAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+kEBwEQAanPNmMAAAASSURBVAhbY5AzBQE/OYbBwQAAEpEZMUR2DroAAAAASUVORK5CYII=) 2;
image-rendering: crisp-edges;
background:
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="32" viewBox="0 0 8 32"><circle r="2" fill="%23888" cy="16" cx="3"/><circle r="2" fill="%23888" cy="24" cx="3"/><circle r="2" fill="%23888" cy="8" cx="3"/></svg>') no-repeat center center;
} |
I'm leaning towards doing nothing, though. Because literally every major desktop has resizeable navigation sidebars with no visible handle, there's no convention we can expect readers to recognize. An indicator that the user doesn't recognize is clutter, and clutter is worse than useless. |
@notriddle The problem is, resizable elements are potentially orders of magnitude more common in desktop applications than on the web, and the cursor change may not work. I do agree that the current addition does add significant clutter, which is not ideal. What about a resize handle that only shows up when hovering over it, in addition to widening the handle, and adding a tooltip? |
It's actually pretty hard to decide how to do this even if I do look to old versions of Windows In that screenshot:
The closest thing to a truly unambiguous indicator of resizability is the | at the lefthand edge of each toolbar module, and, as Joel Spolsky recounts, that feature had poor usability and was ultimately canned.
I did some more hunting, and finally found another web app with an explicit handle and enough market penetration to make a convention: Jira. It looks a lot like GIMP, but with four dots instead of three.
It already does that. It doesn't help much, because things that only appear on hover aren't easily discoverable.
We should try to fix that. It's the only truly solid convention we have. Does the file browser in GitHub work on your system? When I say "file browser," I explicitly mean the one that comes up when you browse into a repository's files: the pull request patch viewer's sidebar doesn't seem to be resizable. |
I don't know if it will help here, but I think its a good source of inspiration in general. For example, we already use the icon w/ label underneath pattern in rustdoc.
It does not work, Unfortunately we can't provide multiple builtin cursor options like you can with fonts. I've actually opened a w3c issue about this: w3c/csswg-drafts#12047 |
This change is based on some discussion on [lolbinarycat's idea], but with a more "traditional" design. Specifically, this is the closest thing I could find to a consensus across many systems I looked at for inspiration: - In Jira, resizable sidebars have a stack of four dots. - In The GIMP, resizable sidebars have a stack of three dots. - In [old Windows], "panes" are defined to have the same border style as a window, which has a raised appearance. - In [NeXT], a drag point usually had an innie, whether the line in a slider or the circle in a scroller; I can also hide and show the favorites bar in Workspace by dragging on a circular "grip spot" - In [old Mac], drag handles for things usually had a "grip track" of parallel lines. - [OSX] kept that, but the "Source List" part of the Finder still had the circle grip for a time the same way Workspace did [lolbinarycat's idea]: rust-lang#139420 [old Windows]: https://archive.org/details/windowsinterface00micr/page/n9/mode/2up [old Mac]: https://archive.org/details/apple-hig/1996_Human_Interface_Guidelines_for_Mac_OS_8_%28WWDC_Release%29/page/16/mode/2up [NeXT]: https://archive.org/details/apple-hig/1993%20NeXTSTEP%20User%20Interface%20Guidelines%20-%20Release%203/page/145/mode/2up [OSX]: https://dn721903.ca.archive.org/0/items/apple-hig/MacOSX_HIG_2005_09_08.pdf#page=267
This change is based on some discussion on [lolbinarycat's idea], but with a more "traditional" design. Specifically, this is the closest thing I could find to a consensus across many systems I looked at for inspiration: - In Jira, resizable sidebars have a stack of four dots. - In The GIMP, resizable sidebars have a stack of three dots. - In [old Windows], "panes" are defined to have the same border style as a window, which has a raised appearance. - In [NeXT], a drag point usually had an innie, whether the line in a slider or the circle in a scroller; I can also hide and show the favorites bar in Workspace by dragging on a circular "grip spot" - In [old Mac], drag handles for things usually had a "grip track" of parallel lines. - [OSX] kept that, but the "Source List" part of the Finder still had the circle grip for a time the same way Workspace did [lolbinarycat's idea]: rust-lang#139420 [old Windows]: https://archive.org/details/windowsinterface00micr/page/n9/mode/2up [old Mac]: https://archive.org/details/apple-hig/1996_Human_Interface_Guidelines_for_Mac_OS_8_%28WWDC_Release%29/page/16/mode/2up [NeXT]: https://archive.org/details/apple-hig/1993%20NeXTSTEP%20User%20Interface%20Guidelines%20-%20Release%203/page/145/mode/2up [OSX]: https://dn721903.ca.archive.org/0/items/apple-hig/MacOSX_HIG_2005_09_08.pdf#page=267
This change is based on some discussion on [lolbinarycat's idea], but with a more "traditional" design. Specifically, this is the closest thing I could find to a consensus across many systems I looked at for inspiration: - In Jira, resizable sidebars have a stack of four dots. - In The GIMP, resizable sidebars have a stack of three dots. - In [old Windows], "panes" are defined to have the same border style as a window, which has a raised appearance. - In [NeXT], a drag point usually had an innie, whether the line in a slider or the circle in a scroller; I can also hide and show the favorites bar in Workspace by dragging on a circular "grip spot" - In [old Mac], drag handles for things usually had a "grip track" of parallel lines. - [OSX] kept that, but the "Source List" part of the Finder still had the circle grip for a time the same way Workspace did [lolbinarycat's idea]: rust-lang#139420 [old Windows]: https://archive.org/details/windowsinterface00micr/page/n9/mode/2up [old Mac]: https://archive.org/details/apple-hig/1996_Human_Interface_Guidelines_for_Mac_OS_8_%28WWDC_Release%29/page/16/mode/2up [NeXT]: https://archive.org/details/apple-hig/1993%20NeXTSTEP%20User%20Interface%20Guidelines%20-%20Release%203/page/145/mode/2up [OSX]: https://dn721903.ca.archive.org/0/items/apple-hig/MacOSX_HIG_2005_09_08.pdf#page=267
This change is based on some discussion on [lolbinarycat's idea], but with a more "traditional" design. Specifically, this is the closest thing I could find to a consensus across many systems I looked at for inspiration: - In Jira, resizable sidebars have a stack of four dots. - In The GIMP, resizable sidebars have a stack of three dots. - In [old Windows], "panes" are defined to have the same border style as a window, which has a raised appearance. - In [NeXT], a drag point usually had an innie, whether the line in a slider or the circle in a scroller; I can also hide and show the favorites bar in Workspace by dragging on a circular "grip spot" - In [old Mac], drag handles for things usually had a "grip track" of parallel lines. - [OSX] kept that, but the "Source List" part of the Finder still had the circle grip for a time the same way Workspace did [lolbinarycat's idea]: rust-lang#139420 [old Windows]: https://archive.org/details/windowsinterface00micr/page/n9/mode/2up [old Mac]: https://archive.org/details/apple-hig/1996_Human_Interface_Guidelines_for_Mac_OS_8_%28WWDC_Release%29/page/16/mode/2up [NeXT]: https://archive.org/details/apple-hig/1993%20NeXTSTEP%20User%20Interface%20Guidelines%20-%20Release%203/page/145/mode/2up [OSX]: https://dn721903.ca.archive.org/0/items/apple-hig/MacOSX_HIG_2005_09_08.pdf#page=267
r? @notriddle
light theme not yet supported.
handle is given a different cursor mainly because the
col-resize
cursor doesn't work on my machine for some reason.