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: improve ergonomics of the Play/Share buttons #41403

Open
nu8 opened this issue Sep 15, 2020 · 0 comments
Open

x/pkgsite: improve ergonomics of the Play/Share buttons #41403

nu8 opened this issue Sep 15, 2020 · 0 comments

Comments

@nu8
Copy link

@nu8 nu8 commented Sep 15, 2020

With the old site, you have a Share button:

https://golang.org/pkg/io#Copy

the way this is designed is not ideal, because if you hover over the button, no
link is shown. So you dont know where you are about to go. Then if you click the
button, you are redirected here:

https://play.golang.org/p/icxGp_EVWRV

This type of code would be better:

<a href="https://play.golang.org/p/icxGp_EVWRV">Share</a>

that way you can see where you are about to go, and also you can Middle click or
Control click to open in new tab, instead of being redirected to mystery URL.
With the new site, you have a Play button:

https://pkg.go.dev/io#Copy

I would say this button is even worse, as it doesnt even function unless you
allow JavaScript from the googlehosted.com domain. Once youve done that, you
still get nothing if you hover over the button, so clicking it again is taking
you to some mystery place. However in this case instead of being redirected, it
attempts to open in a new tab.

However because JavaScript is initiating the new tab, some browsers (like mine)
block the request, as its seen as a pop-up (rightly so). This type of code
would be better:

<a href="https://play.golang.org/p/icxGp_EVWRV" target="_blank">Play</a>

https://developer.mozilla.org/Web/HTML/Element/a#target

@toothrot toothrot changed the title Fix the Play/Share buttons x/pkgsite: Fix the Play/Share buttons Sep 15, 2020
@gopherbot gopherbot added this to the Unreleased milestone Sep 15, 2020
@julieqiu julieqiu added pkgsite and removed go.dev labels Sep 16, 2020
@andybons andybons changed the title x/pkgsite: Fix the Play/Share buttons x/pkgsite: improve ergonomics of the Play/Share buttons Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.