script-lab icon indicating copy to clipboard operation
script-lab copied to clipboard

Make it more obvious how to import copied-to-clipboard snippets

Open sancarn opened this issue 6 years ago • 10 comments

This might already be a feature. I noticed you can copy the script to the clipboard in the share menu. This is great but there seems to be no way to get the data into script-lab afterwards (apart from opening the yaml in notepad, and modifying each tab manually).

Importing the data from the clipboard might be a nice addition to resolve the issue.

sancarn avatar Feb 13 '19 14:02 sancarn

Hi @sancarn. You can actually paste that YAML directly into this import field.

image

Let me know if you experience any troubles with this.

nico-bellante avatar Feb 13 '19 19:02 nico-bellante

Nice! 😄

sancarn avatar Feb 13 '19 19:02 sancarn

It's also in the README should you ever need to reference this for someone else: https://github.com/OfficeDev/script-lab/blob/master/README.md#import

Zlatkovsky avatar Feb 13 '19 20:02 Zlatkovsky

Can't believe I missed that... Thanks

sancarn avatar Feb 13 '19 20:02 sancarn

No problem. If you think that there is something we can do either in the product or in the README to make it more obvious, let us know. (E.g., should the notification message that says "Snippet copied to clipboard" also suggest how to re-import it, or would that be too annoying to see every time?...)

Zlatkovsky avatar Feb 13 '19 20:02 Zlatkovsky

To be honest, a link in the notification "Import it here" which links to the import screen would be a subtle way to make it obvious! So I don't think it'd be annoying personally.

sancarn avatar Feb 13 '19 20:02 sancarn

OK, let's do that. Seems like it should take all of 10 minutes to fix. Re-opening and changing title to "Make it more obvious how to import copied-to-clipboard snippets".

Zlatkovsky avatar Feb 13 '19 20:02 Zlatkovsky

@sancarn , if you feel inspired to attempt it yourself and to send a PR, feel free :-). We are an open-source project, after all. For the link, btw, you can use "http://aka.ms/scriptlab/import". The message bar component should already be set up with the ability to have a link, since the exporting-to-gists already shows a link there.

Zlatkovsky avatar Feb 13 '19 20:02 Zlatkovsky

I'll give it a go, currently struggling with installing the npm repo... Because I don't have yarn installed, will see if I get through it and if I do, will be happy to attempt the fix 😛.

sancarn avatar Feb 13 '19 23:02 sancarn

great to hear @sancarn. if you are stuck with setting up the repo, CONTRIBUTING.md should help point you in the right direction

also, here is where that messageBar comes up when the snippet is copied to the clipboard.

nico-bellante avatar Feb 13 '19 23:02 nico-bellante