about summary refs log tree commit diff
path: root/tests/rustdoc-gui/sidebar-source-code.goml
AgeCommit message (Collapse)AuthorLines
2025-09-02squash fix `render_call_locations` panic when default span points at file ↵Janis-1/+1
outside of local_sources add test against crashing with --html-after-content file correctly add --html-after-content to env not args formatting fix for rustdoc-call-locations-after-content/rmake.rs Use local crate source file as default span in `render_call_locations` - avoids unwrapping the first file added to the source map as a local file in `href_from_span` move test to tests/rustdoc-gui, rename to scrape_examples_ice test link is correct use rustdocflags, rename path in example, track lock file factor out duplicate function calls use compile-flags to make sure the after.html file is actually included in the rustdoc call fix goml go-to path increment assert-count in sidebar-source-code.goml adjust crate-search width in search-result-display.goml renamed Bar in scrape_examples_ice test make crate name shorter ..
2025-08-23Add GUI test for `--generate-macro-expansion` optionGuillaume Gomez-1/+1
2025-08-15rustdoc-search: search backend with partitioned suffix treeMichael Howell-1/+1
2024-07-29rustdoc: use `<wbr>`-tolerant function to check text contentsMichael Howell-4/+4
2024-04-05Use `include` command to reduce code duplicationGuillaume Gomez-5/+2
2024-04-01Update to new browser-ui-test versionGuillaume Gomez-1/+1
2023-12-18Add back the columnMichael Howell-3/+3
2023-12-17rustdoc: clean up source sidebar hide buttonMichael Howell-1/+1
This is a redesign of the feature, with parts pulled from https://github.com/rust-lang/rust/pull/119049 but with a button that looks more like a button and matches the one used on other sidebar pages.
2023-12-15Rollup merge of #115660 - notriddle:notriddle/sidebar-resize, r=GuillaumeGomezGuillaume Gomez-1/+2
rustdoc: allow resizing the sidebar / hiding the top bar Fixes #97306 Preview: http://notriddle.com/rustdoc-html-demo-4/sidebar-resize/std/index.html ![image](https://github.com/rust-lang/rust/assets/1593513/a2f40ea2-0436-4e44-99e8-d160dab2a680) ## Summary This feature adds: 1. A checkbox to the Settings popover to hide the persistent navigation bar (the sidebar on large viewports and the top bar on small ones). 2. On large viewports, it adds a resize handle to the persistent sidebar. Resizing it into nothing is equivalent to turning off the persistent navigation bar checkbox in Settings. 3. If the navigation bar is hidden, a toolbar button to the left of the search appears. Clicking it brings the navigation bar back. ## Motivation While "mobile mode" is definitely a good default, it's not the only reason people have wanted to hide the sidebar: * Some people use tiling window managers, and don't like rustdoc's current breakpoints. Changing the breakpoints might help with that, but there's no perfect solution, because there's a gap between "huge screen" and "smartphone" where reasonable people can disagree about whether it makes sense for the sidebar to be on-screen. https://github.com/rust-lang/rust/issues/97306 * Some people ask for ways to reduce on-screen clutter because it makes it easier to focus. There's not a media query for that (and if there was, privacy-conscious users would turn it off). https://github.com/rust-lang/rust/issues/59829 This feature is designed to avoid these problems. Resizing the sidebar especially helps, because it provides a way to hide the sidebar without adding a new top-level button (which would add clutter), and it provides a way to make rustdoc play nicer in complex, custom screen layouts. ## Guide and Reference-level explanation On a desktop or laptop with a mouse, resize the sidebar by dragging its right edge. On any browser, including mobile phones, the sticky top bar or side bar can be hidden from the Settings area (the button with the cog wheel, next to the search bar). When it's hidden, a convenient button will appear on the search bar's left. ## Drawbacks This adds more JavaScript code to the render blocking area. ## Rationale and alternatives The most obvious way to allow people to hide the sidebar would have been to let them "manually enter mobile mode." The upside is that it's a feature we already have. The downside is that it's actually really hard to come up with a terse description. Is it: * A Setting that forces desktop viewers to always have the mobile-style top bar? If so, how do we label it? Should it be visible on mobile, and, if so, does it just not do anything? * A persistent hide/show sidebar button, present on desktop, just like on mobile? That's clutter that I'd like to avoid. ## Prior art * The new file browser in GitHub uses a similar divider with a mouse-over indicator * mdBook and macOS Finder both allow you to resize the sidebar to nothing as a gesture to hide it * https://www.nngroup.com/articles/drag-drop/ ## Future possibilities https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Table.20of.20contents proposes a new, second sidebar (a table of contents). How should it fit in with this feature? Should it be resizeable? Hideable? Can it be accessed on mobile?
2023-12-01Add GUI tests for comments highlighting in items declarationGuillaume Gomez-1/+1
2023-10-11rustdoc: allow resizing the sidebarMichael Howell-1/+2
2023-09-14rusdoc: add gui test for custom CSS themesMichael Howell-1/+1
Based on https://github.com/rust-lang/rust/pull/115829#issuecomment-1720056602
2023-07-14rustdoc: use `src` consistently over `source` in codeMichael Howell-7/+7
The CSS uses an inconsistent mix of both. This commit switches it to always use `src`.
2023-07-08Migrate GUI colors test to original CSS color formatGuillaume Gomez-6/+6
2023-04-12Add/update tests for `--extend-css` optionGuillaume Gomez-1/+1
2023-04-11Update rustdoc GUI tests to new browser-ui-test versionGuillaume Gomez-5/+5
2023-01-11Move /src/test to /testsAlbert Larsan-0/+90