-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
What is the URL of the page with the issue?
https://pkg.go.dev/cuelang.org/go/cue?tab=doc
What is your user agent?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.59 Safari/537.36
Screenshot
What did you do?
Visited the page.
What did you expect to see?
An overview of the package API, like the old godoc Index:
https://godoc.org/cuelang.org/go/cue
What did you see instead?
A collapse partial representation of the API. Specifically, per #40577, the API itself is by default hidden, and there is no way to auto-expand it
The representation in the LHS is also heavily condensed in order to fit the space. This leads to a very lossy representation. For example:
func (a *Attribute) Lookup(pos int, key string) (val string, found bool, err error)
gets condensed to (side note: frustratingly I can't copy-paste text from the LHS tree view):
(a) Lookup(pos, key)
So now I can't, at a glance, get a view of the entire API - I have to jump to each item separately because of the lossy LHS display.
This condensed representation is also misleading. Consider:
Build(instances)
which sits under the type Instance
node. The actual signature here is:
func Build(instances []*build.Instance) []*Instance
i.e. a slice is returned instead of a Instance
or *Instance
. Again, this sort of subtle distinction is lost in the condensed view.
IMHO the LHS navigation area is always going to have to compromise in ways that are lossy in general, hence the Index should be brought back.
How then would people navigate through the API?
There is already the f
keyboard shortcut that allows you to jump to an identifier.
There might be other means by which the entire index can be shown (in a popup perhaps?) and then clicked to navigate - I hasten to add (in case it's not obvious from the quality of that suggestion) that I'm in no way a UI/UX expert.