Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/pkgsite: auto-expand left sidebar #40577
What is the URL of the page with the issue?
Any package, for example, https://pkg.go.dev/net/http?tab=doc
What is your user agent?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
What did you expect to see?
This may be more of a personal preference than a bug, so feel free to close...
Before the sidebar was introduced, the first thing I usually did when reading package documentation was to click the Index. This provided a great overview of all the definitions in the package, which is helpful when I don't know the name of the definition I want.
Index has been replaced by the navigation sidebar on the left. I think this is generally a good idea: it's nice to have it visible after clicking through to a definition. However, Functions and Types are not expanded by default within the sidebar, so reading through definitions requires extra clicks on small disclosure triangles. Would it be possible to expand these by default?
What did you see instead?
Functions and Types are not expanded.
I wish variables were listed as well, just like types and functions, with types' methods and functions expanded as well.
There's another annoying CSS thing. Currently the navigation has
I suggest it gets removed. The default behavior will be the scrollbar appearance once the content exceeds the element height (which could be set to something like
Having the functions, types, and (possibly) variables in the sidebar expanded by default would make it easier to get a sense of the API at a glance. Still, it would be no substitute for the Index we know and love from
Because the Index view contains so much high value content in a condensed form, there's often no need to drill any deeper. This is increasingly true over time as one becomes more familiar with a given API.
There's a related conversation happening in issue #40612 for including an Index-like view.
Another example where this causes problems: top-level functions that return a type declared in the package are grouped together with that type, which makes them hard to find when the index is collapsed.
Let's suppose I'm looking for a function in
This UI change is really making it hard to navigate the package docs. Package index is an entry point for many users. The index serves as a summary of what's in the package. Users often CTRL+F to search for symbols and go through the entire list to have an understanding of what package provides. Having to manually expand the list is breaking how we use the package index fundamentally.
There’s a lot of other feedback in this bug. May be worth splitting that out to separate issues. The original issue of not having the functions and types be expanded by default has been fixed (just not deployed).