x/pkgsite: add directories to "Jump to" list #44718
Comments
The jump to button in the left sidebar shows up even if a page only has directories while the "f" key shortcut is disabled, this was brought up in #45462. We should put the button in a disabled state while we explore the idea of adding directories to the jump to modal. |
Change https://golang.org/cl/309489 mentions this issue: |
What should be the behavior of the 'Jump to' button and modal when the modal won't contain any identifiers Empty 'Jump to' modalThe empty state appears directory pages (e.g. https://pkg.go.dev/mvdan.cc/sh or https://pkg.go.dev/std) and packages with little or no documentation (e.g. https://pkg.go.dev/mvdan.cc/sh/_js) Also, it might be more useful to explore the idea including headings from the README and directories. In that scenario the empty state would almost never come up. Adding @georgehu and @fflewddur for UX input. |
Rather than disable the "Jump to" control when the modal would be empty, including an explanation in that modal that this package doesn't have any [list of things that are "jump to"-able] would help people understand why "jump to" isn't working on certain pages. I suspect if we just disable the control, we'll end up with bug reports that the control is disabled when people expect it to be available. Long-term, I like the idea of using this control for quick keyboard navigation of the entire page, but agree that we'd want to explore this more first. |
The Jump to modal does not contain any jump-able items on pages without documentation symbols. We plan to explore adding identifiers from the readme and directories sections in future updates to the modal. For golang/go#44718 Change-Id: I71ea5caf2aee1960dec41f89f86ce861f944242a Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309489 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>
For modules with many packages/directories like the standard library It would be helpful if directories were listed in the "Jump to" dialog.
Example use case
Visit https://pkg.go.dev/std
Press "f"
Type "template", and the "Jump to" dialog would list:
The text was updated successfully, but these errors were encountered: