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: search in page is made less useful by hidden content #42653
Comments
The reason I find this issue pretty significant is that I heavily rely on Ctrl-F to quickly find an item in godoc's index. This does not work well on pkgsite, as shown above. |
Change https://golang.org/cl/272608 mentions this issue: |
I don't think the fix above is what we want, though. When I search the page, I want the first hits to match the page index, not the README. |
There isn't a simple way to get rid of the hidden matches but I think the best solution here is to make the hidden content visible because it does contain the text from the search. For your particular use case using the jump to Identifier feature by pressing the 'F' key would get you to the function right away. |
Hm. I can live with using F instead of ^F, though I admit that will be fairly painful as it's hard to retrain muscle memory. It's unfortunate that the plain page search is less useful in pkgsite compared to godoc - I'm surprised that there is no way to make hidden content not match page search, or to just not have the hidden text be present in the HTML at all. |
I like being able to search through all the text without having to expand the readme but do see your point. I'd like to merge this for now so that the experience doesn't feel completely broken and add @Joanne881107 @fflewddur for product / UX input. We could keep the hidden content out of text search by picking a split point within the readme (maybe the second heading for markdown files and N characters/words/lines for text files) then rendering the two sections in separate elements with the second hidden from the page. This would mean the collapsed section size will vary but it would create a cleaner break within the readme section. |
Here's another reason why the expanded README shouldn't show by default: it makes skimming the page much harder. For example, where is the The answer is under the Forcing all users to use the |
Steps to reproduce the good godoc.org behavior:
Now, on pkgsite:
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.
The text was updated successfully, but these errors were encountered: