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/playground: "save" shortcuts could be more useful #15378

Closed
rakyll opened this issue Apr 19, 2016 · 9 comments
Closed

x/playground: "save" shortcuts could be more useful #15378

rakyll opened this issue Apr 19, 2016 · 9 comments

Comments

@rakyll
Copy link
Contributor

rakyll commented Apr 19, 2016

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

@rakyll rakyll added this to the Unreleased milestone Apr 19, 2016
@adg
Copy link
Contributor

adg commented Apr 19, 2016

Sounds good to me.

@robpike
Copy link
Contributor

robpike commented Apr 20, 2016

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?

@fabiopicchi
Copy link

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.

@adg
Copy link
Contributor

adg commented May 11, 2016 via email

@rakyll
Copy link
Contributor Author

rakyll commented May 11, 2016

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.

@rakyll rakyll closed this as completed May 11, 2016
@adg
Copy link
Contributor

adg commented May 11, 2016

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.

@adg adg reopened this May 11, 2016
@adg adg changed the title x/playground: cmd+s and control+s should share x/playground: "save" shortcuts could be more useful May 11, 2016
@gopherbot
Copy link

CL https://golang.org/cl/35950 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/36486 mentions this issue.

gopherbot pushed a commit to golang/playground that referenced this issue Feb 7, 2017
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>
gopherbot pushed a commit to golang/tools that referenced this issue Feb 7, 2017
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>
@broady broady self-assigned this Feb 7, 2017
@broady
Copy link
Member

broady commented Feb 7, 2017

Deployed. Looks great. Thank you to Alexander Kucherenko.

@broady broady closed this as completed Feb 7, 2017
@golang golang locked and limited conversation to collaborators Feb 7, 2018
@rsc rsc unassigned broady Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants