Docs.rs: Mobile: Opening rustdoc hamburger menu overlaps rustdoc header

Created on 25 Oct 2020  路  4Comments  路  Source: rust-lang/docs.rs

Steps to reproduce:

  1. On a mobile device (or in Chrome's mobile simulation mode), visit a crate page, for instance https://docs.rs/ureq/1.5.1/ureq/index.html.
  2. Tap the hamburger menu in the top left.

Expected result:

Rustdoc's crate header is not obscured by the menu.

Actual result:

The header is obscured by the menu.

https://docs.rs/ureq/1.5.1/ureq/index.html

image

vs https://doc.rust-lang.org/std/vec/struct.Vec.html

image

(noticed while writing up #1120 )

A-rustdoc-css C-bug

Most helpful comment

@arusahni go for it :) this seems to be a docs.rs specific bug, so I'd start by finding why this is different from normal docs that rustdoc generates.

All 4 comments

I've confirmed this problem still exists. Would it be an issue if I picked it up? The immediate fix (adjusting the top offset to use the correct math) seems fairly straightforward. However, there's some additional jank around opening the sidebar that causes the Rust logo and crate name to shift on open and close. Since I'd already be poking around in that element, I can investigate and fix that, too.

I'll take care to not go overboard as #1120 proposes something that could make this component not long for the world.

@arusahni go for it :) this seems to be a docs.rs specific bug, so I'd start by finding why this is different from normal docs that rustdoc generates.

@jyn514 after some comparison, it boils down to it being because of the docs.rs shell. The sidebar is a fixed position element, with its top offset being 45px from the top. With rustdoc's output, that magic number is the height of the topbar. However this number is different for docs.rs due to the navbar - it's instead 45px + 32px (where the latter is the height of the docs.rs navbar).

EDIT: It appears that the selector for this element changed, so the override we had in place was no longer functional.

These (and some Clippy warnings) are addressed in PR #1233.

Was this page helpful?
0 / 5 - 0 ratings