Navigation Menu

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

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

x/pkgsite: allow hiding of left menu #42487

v-byte-cpu opened this issue Nov 10, 2020 · 7 comments
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite UX Issues that involve UXD/UXR input

Comments

@v-byte-cpu
Copy link

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 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

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
Member

Thanks for the feedback!

/cc @georgehu @Joanne881107 @fflewddur for UX input

@julieqiu julieqiu added UX Issues that involve UXD/UXR input NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. FeatureRequest labels Nov 10, 2020
@julieqiu julieqiu changed the title x/pkgsite: [feature] menu hiding x/pkgsite: allow hiding of left menu Nov 10, 2020
@fflewddur
Copy link

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 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
@jamalc
Copy link

jamalc commented Jun 23, 2021

We are testing out layout changes on the beta site related to this issue. Although the current set of changes do not provide an option to hide the left nav, at 1366x768 with 110% zoom the page should render in the single column layout. Take a look at https://beta.pkg.go.dev/net/http.

@jamalc
Copy link

jamalc commented Jul 14, 2021

Layout changes are live on pkg.go.dev. I think we can close this for now. Let's start a new issue on layout change feedback if new issues crop up.

@jamalc jamalc closed this as completed Jul 14, 2021
@rsc rsc unassigned jamalc Jun 23, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite UX Issues that involve UXD/UXR input
Projects
None yet
Development

No branches or pull requests

8 participants