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

Copy to Clipboard Shortcut UI #79

Open
radames opened this issue Apr 16, 2021 · 6 comments
Open

Copy to Clipboard Shortcut UI #79

radames opened this issue Apr 16, 2021 · 6 comments

Comments

@radames
Copy link

radames commented Apr 16, 2021

Is your feature request related to a problem? Please describe.

It would be great to have a shortcut button to copy content to the clipboard

Describe the solution you'd like

Here is a simple idea: add the copy to the clipboard shortcut to the menu options in each cell with copiable content.

Describe alternatives you've considered

Currently, you have to import or implement a helper on the target notebook, here as list:

https://observablehq.com/@radames/clipboard-button
https://observablehq.com/@mbostock/copier
https://observablehq.com/@tomktjemsland/copy-to-clipboard
https://observablehq.com/@ryanseddon/copy

Additional context

Related forum discussion
https://talk.observablehq.com/t/copying-json-data-to-clipboard/2353

@mbostock
Copy link
Member

Would this copy the value (the output) of the cell, or the source code of the cell?

@radames
Copy link
Author

radames commented Apr 16, 2021

That's a good point. I suspect that in most of my cases, the output value is what is interesting. Rather than download a csv/json/text, you can quickly grab it to the clipboard. Maybe for the source code, we should stick to the keyboard shortcuts? Unless you have more use-cases where users want to copy code

@mootari
Copy link
Member

mootari commented Apr 16, 2021

@radames If this this intended as an alternative to the "Download text/CSV/JSON" options, perhaps it should only be offered as an option when the respective download option is available?

@radames
Copy link
Author

radames commented Apr 17, 2021

Hi @mootari, yes, that's exactly how I was thinking.

@mootari
Copy link
Member

mootari commented Apr 18, 2021

@radames Trying to summarize:

  • For each of the options "Download text", "Download CSV" and "Download JSON", add second option "Copy {type} to clipboard".
  • The only difference to the first option is that instead of downloading a file, its contents get copied to the clipboard.

Correct?

@radames
Copy link
Author

radames commented Apr 18, 2021

@mootari, yes, that is a great summary.!
And you've recalled me that any object can be download as either CSV or JSON, which will add more options for the copy button. Have I just learned that? 😲

Thinking of another software, Figma presents you with submenus, which doesn't seem to be a problem. What do you think?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants