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

x/pkgsite: allow hiding of left menu #42487

Open
v-byte-cpu opened this issue Nov 10, 2020 · 4 comments
Open

x/pkgsite: allow hiding of left menu #42487

v-byte-cpu opened this issue Nov 10, 2020 · 4 comments

Comments

@v-byte-cpu
Copy link

@v-byte-cpu v-byte-cpu commented Nov 10, 2020

What is the URL of the page with the issue?

https://pkg.go.dev/net/http

What did you expect to see?

Please, allow hiding of the left menu. It is really inconvenient to read docs on half screen..

Screenshot

image

@gopherbot gopherbot added the pkgsite label Nov 10, 2020
@gopherbot gopherbot added this to the Unreleased milestone Nov 10, 2020
@woat
Copy link

@woat woat commented Nov 10, 2020

It looks like there are CSS rules to automatically close the menu (rather, open the menu since mobile is default), I think this is the relevant breakpoint: https://github.com/golang/pkgsite/blob/master/content/static/css/sidenav.css#L97

My guess is that your half-screen size is probably not small enough to trigger the breakpoint. Might be worth mentioning your screen size + resolution.

So far, the paths I see is that the breakpoint could be adjusted or a toggle be implemented. I'd be happy to help with this issue once a resolution has been made.

@v-byte-cpu
Copy link
Author

@v-byte-cpu v-byte-cpu commented Nov 10, 2020

Outer window size:

console.log(`${window.outerWidth}x${window.outerHeight}`)
==> 1366x768

Inner window size:

console.log(`${window.innerWidth}x${window.innerHeight}`)
==> 1238x277

I usually use chromium on my laptop with 110% and 125% zoom levels and it is very irritating to scroll code snippets..

110% zoom level:

image

125% zoom level:

image

Toggle is a great idea !

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Nov 10, 2020

Thanks for the feedback!

/cc @georgehu @Joanne881107 @fflewddur for UX input

@julieqiu julieqiu changed the title x/pkgsite: [feature] menu hiding x/pkgsite: allow hiding of left menu Nov 10, 2020
@fflewddur
Copy link

@fflewddur fflewddur commented Nov 19, 2020

I think supporting a user option to hide the left-hand menu is a good idea. That menu is designed to support faster navigation when screen size permits, but if our heuristic isn't 100% accurate, a user-controlled fallback makes sense.

One additional option to consider is whether we'd be able to detect overflow in the code blocks and automatically hide/minimize the nav menu when that happens (assuming we can also add line breaks to abnormally long lines, otherwise some packages might always have this menu hidden).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.