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: add directories to "Jump to" list #44718

Open
fzipp opened this issue Mar 1, 2021 · 6 comments
Open

x/pkgsite: add directories to "Jump to" list #44718

fzipp opened this issue Mar 1, 2021 · 6 comments
Labels
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

@fzipp
Copy link
Contributor

fzipp commented Mar 1, 2021

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:

  • html/template
  • text/template
  • text/template/parse
@gopherbot gopherbot added this to the Unreleased milestone Mar 1, 2021
@julieqiu julieqiu modified the milestones: Unreleased, pkgsite/unplanned Mar 2, 2021
@julieqiu julieqiu added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. help wanted labels Mar 2, 2021
@jamalc
Copy link

jamalc commented Apr 12, 2021

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.

@gopherbot
Copy link

Change https://golang.org/cl/309489 mentions this issue: content/static: disable jump button for pages without docs

@jamalc
Copy link

jamalc commented Apr 12, 2021

What should be the behavior of the 'Jump to' button and modal when the modal won't contain any identifiers

Screen Shot 2021-04-12 at 4 46 59 PM

Empty 'Jump to' modal

Screen Shot 2021-04-12 at 4 49 57 PM

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

@jamalc jamalc added UX Issues that involve UXD/UXR input and removed help wanted labels Apr 12, 2021
@fflewddur
Copy link

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.

gopherbot pushed a commit to golang/pkgsite that referenced this issue Apr 14, 2021
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>
@jamalc
Copy link

jamalc commented Apr 15, 2021

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.

@fzipp
Copy link
Contributor Author

fzipp commented Apr 16, 2021

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?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

5 participants