observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

Copy to Clipboard Shortcut UI #79

Open radames opened 3 years ago

radames commented 3 years ago

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 commented 3 years ago

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

radames commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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

mootari commented 3 years ago

@radames Trying to summarize:

Correct?

radames commented 3 years ago

@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