plnkr / feedback

Feedback on Plunker
19 stars 11 forks source link

Option to share embed URL with URL parameters for preview #545

Closed boghyon closed 3 years ago

boghyon commented 3 years ago

Is your feature request related to a problem? Please describe. Currently, there is no option to open the preview pane automatically with additional URL parameters.

For example, I'd like to share https://embed.plnkr.co/16J1TFICxbqETCzaxuZ0/ but with ?sap-ui-xx-componentPreload=off (and possibly more parameters) for the preview pane.

Something like this:

https://embed.plnkr.co/16J1TFICxbqETCzaxuZ0?show=preview<?param1=foo&param2...>

... which would then open the preview with the passed parameter:

plunk-enhancement-request-open-preview-with-url-parameters

Not sure how the exact syntax for the URL should look like.

ggoodman commented 3 years ago

That sounds like a great idea. It will be tricky to encode query params in query params in a way that balances usability with functionality 🤔 .

boghyon commented 3 years ago

I'm happy if there is at least the functionality. 👍 No problem to escape all characters before sharing the URL.

ggoodman commented 3 years ago

@boghyon this is getting shipped right now. The format you will need is to use is: ?preview:%3Fsap-ui-xx-componentPreload=off.

LMK if this works for you.

boghyon commented 3 years ago

I just tried https://embed.plnkr.co/16J1TFICxbqETCzaxuZ0?show=preview:%3Fsap-ui-xx-componentPreload%3Doff%26sap-ui-xx-nosync=warn expecting /?sap-ui-xx-componentPreload=off&sap-ui-xx-nosync=warn at the end of the preview URL.

Works well! Thank you for the quick update! 👍

boghyon commented 3 years ago

@ggoodman Now an error page is shown if the preview has no parameters. E.g. https://embed.plnkr.co/16J1TFICxbqETCzaxuZ0/

Embed plunk preview without parameters causes undefined

ggoodman commented 3 years ago

Shipping a fix as we speak 🤦🏼 .

ggoodman commented 3 years ago

Fix now deployed. Thanks for bringing this to my attention @boghyon ❤️ !

boghyon commented 3 years ago

@ggoodman Would be nice if this feature could be documented in https://ggoodman.gitbooks.io/plunker/content/embed.html. Or how can I contribute to that page? Or is there any other documentation place for Plunker where people can contribute to?

ggoodman commented 3 years ago

@boghyon I really LOVE this idea. I have been working on a project called Nostalgie (https://nostalgie.dev, https://github.com/ggoodman/nostalgie) that would make it very easy to spin up a docs site for this. I'll take a stab at it tonight.