-
Notifications
You must be signed in to change notification settings - Fork 18k
x/pkgsite: add directories to "Jump to" list #44718
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
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>
Adding the readme headings to this list seems fairly straightforward if we decide to do so -- we can have those links scroll to the position of the heading on the page. For the directories, would you expect selecting a directory from the jump list to bring you to that directories position on the page or to navigate to the page for that directory? We could something similar for source files. |
Good question. It would probably be consistent with the other jumps to stay on the same page. Then one can read the package synopsis and decide whether to follow the link or not. |
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: