Skip to content
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: improve source navigation display on mobile #102824

Open
jsha opened this issue Oct 9, 2022 · 2 comments
Open

rustdoc: improve source navigation display on mobile #102824

jsha opened this issue Oct 9, 2022 · 2 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jsha
Copy link
Contributor

jsha commented Oct 9, 2022

Following up on #102815 (which I think was correct since we're not currently showing the topbar).

Here's what a source page looks like on my Pixel 6a:

The Rust logo really shouldn't wrap to the previous line, and the expander for the sidebar overlaps awkwardly.

One possible fix: we should actually use the mobile topbar on source pages, like so:

This provides three things:

  • the hamburger icon could open the source sidebar, and follows the scroll just like the current > icon
  • the Rust logo provides navigation back to the doc root
  • the "lib.rs" text provides context for where the reader is currently, and also provides navigation back to the top of the page (where the search bar is)

/cc @GuillaumeGomez @notriddle

@jsha jsha added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Oct 9, 2022
@notriddle
Copy link
Contributor

The downside of the top bar is that it makes the already tiny viewport even smaller. When reading source code on mobile, you need all the screen real estate you can get.

@GuillaumeGomez
Copy link
Member

We could do like on the other pages: the top navbar remains at the very top of the page (not of the screen) and when we press the button (hamburger one?), we show the menu. That would make things more coherent.

@jsha jsha changed the title rustdoc: improve mobile navigation display on mobile rustdoc: improve source navigation display on mobile Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants