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 · 5 comments
Open

x/pkgsite: allow hiding of left menu #42487

v-byte-cpu opened this issue Nov 10, 2020 · 5 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 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).

@thomasf
Copy link

@thomasf thomasf commented Dec 24, 2020

And the right hand bar as well please, before godoc.org goes away but I'll guess I can add some browser extension to force it if it doesn't. The choice should be persistent by saving a a cookie or something.

These are some differences how the two sites looks for me as a usually place my windows. In both cases the godoc.org version is much much easier to read. Even a little bit of line wrapping does a lot to make the index slower to scan.

image

image

It looks like the godoc.org only has a fixed max width for it's content and pkg.go.dev also has that but the side bars are prioritized over it.

Maybe it would be a good idea for the user to be able to choose that as the width threshold where the left and right hand stuff goes away? I don't know what the solution is but as it works now it's not even a remotely comfortable reading experience for me .

@jamalc jamalc assigned jamalc and unassigned georgehu May 11, 2021
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
8 participants