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/tools/cmd/godoc: results page jumps during rendering #21685
Comments
The cross-references are generated post document load event, through some javascript. Currently, it has a very rudimentary heuristic which just splits the elements into 2 columns if it exceeds a threshold. Also, it uses Ideally, we should make all these decisions server side and send a properly structured data to the client. So then,
I will take a look at it for 1.12. |
For the layout itself, there's https://caniuse.com/#feat=multicolumn Despite having good support on paper, it's still kinda buggy. Even when everything's working right it never quite seems to work as well as advertised. It's always hard to say if it will work in a given situation, but, when it does, it works well and is simpler than the alternatives. So, even if it ultimately doesn't work, it's usually worth trying it first. |
Thanks. I have used it before. Will give it a shot. |
Nearly got it working. Only slight issue is that there is no notion of minimum column-height. So all elements will fill to all the columns. Therefore, it looks odd if the no. of elements is low. In this case, it looks good if they are split into 2 columns. To fix this, I can add some heuristics and send an appropriate css class attached to the div from server side. But then, it would require 4 classes in the css file, each for a separate @jimmyfrasche - Any way to tackle this ? paging other css wizards too @andybons |
You could inject custom properties into the dom with an appropriately placed |
Hmm .. not the most elegant solution. But works. No way to make minimum column height I guess ? |
Not that I am aware of. |
Change https://golang.org/cl/129135 mentions this issue: |
Example page: https://tip.golang.org/search?q=testing
The results initially render with the (IMO) most useful package links,¹ then replace them a short time later with a long list of cross-references.² If you try to click on one of the package links, you're fairly likely to end up on an arbitrarily different page than you intended.
Ideally, the whole page should load instantly. However, if that is not possible, we should structure the page so that it does not jump around as it loads.
(CC: @alandonovan @stamblerre)
¹
²
The text was updated successfully, but these errors were encountered: