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/playground: "save" shortcuts could be more useful #15378
Comments
Sounds good to me. |
Sounds undiscoverable and arbitrary to me. Overriding a browser default should be done with great care. There's a share button. Why is that not sufficient? |
I understand that overriding a browser default is not something that should be done arbitrarily but I saw myself pressing CRTL + S on the playground a couple of times and I never intended to save the HTML. Neither did I intend to share the code... Maybe it would be more useful to save the code in a go file, when the text area has focus. It is closer to the browser default and it's the action I wanted to happen when I pressed the shortcut. |
That's an interesting idea. Ctrl-S could redirect to the .go page with a
'Content-Disposition: attachment' header so that it is downloaded to the
user's computer.
|
Closing. The suggested behavior is not the expected behavior as far I can see from this thread. The focused/unfocused behavior change suggestion sounds very complicated and hard to discover to me. I will click on the button. |
Re-opening this and re-titling as it is now about something else. @rakyll feel free to unsubscribe if this feature doesn't interest you. |
CL https://golang.org/cl/35950 mentions this issue. |
CL https://golang.org/cl/36486 mentions this issue. |
When a file is requested with the "?download=true" query string, the Playground will now serve the file with the "Content-Disposition" header that makes the browser download the snippet rather than display it. Updates golang/go#15378. Change-Id: Iba3e04418e92d3aed3d27e4d6903d6a4d2ce944f Reviewed-on: https://go-review.googlesource.com/35950 Reviewed-by: Chris Broadfoot <cbro@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
If enabled (via the "enableShortcuts" option), Ctrl+S/Cmd+S now saves/shares the playground snippet and initiates a download. Credit to Alexander Kucherenko (see golang.org/cl/35950). Updates golang/go#15378. Change-Id: I8a2d733c25e4c95787fbe1f5ac00fa1befbb4693 Reviewed-on: https://go-review.googlesource.com/36486 Reviewed-by: Andrew Gerrand <adg@golang.org>
Deployed. Looks great. Thank you to Alexander Kucherenko. |
It would be nice to register cmd+s and control+s shortcuts to perform the share action. The current behavior is the browser default which is saving the page to my local drive and is never ever what is intended.
/cc @adg @campoy
The text was updated successfully, but these errors were encountered: