Skip to content

x/pkgsite: search in page is made less useful by hidden content #42653

Open
@mvdan

Description

@mvdan

Steps to reproduce the good godoc.org behavior:

  1. Go to https://godoc.org/github.com/dgraph-io/badger
  2. Press Ctrl-F (or whichever "search in page" shortcut)
  3. Type "NewIterator"
  4. Get taken straight to "func (txn *Txn) NewIterator(opt IteratorOptions) *Iterator", its first occurrence - in the index

Now, on pkgsite:

  1. Go to https://pkg.go.dev/github.com/dgraph-io/badger/v2@v2.2007.2
  2. Press Ctrl-F (or whichever "search in page" shortcut)
  3. Type "NewIterator"
  4. The first result is about a quarter of the page in, but I don't see a match. Weird. Press enter again for the next match.
  5. Still an invisible/hidden match. I have to press enter a few more times to get taken to the index, the visible result I want.

Another way to look at it is that the search on godoc.org results in 6 matches, but the same search results in 10 matches on pkgsite. The first four matches are hidden, which make up for the difference with godoc.org.

Can we get rid of those four hidden matches altogether? Especially since they somehow match before the index, which is very close to the top.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.UXIssues that involve UXD/UXR inputpkgsitepkgsite/searchIssues related to pkg.go.dev search functionality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions