owenthereal / jqplay

A playground for jq, written in Go
https://jqplay.org
MIT License
740 stars 88 forks source link

Loading an example erases a user's work #120

Open gormster opened 2 years ago

gormster commented 2 years ago

Given that examples can be loaded via query string, it seems kind of silly that the examples overwrite the existing work that a user has done, without so much as pushing a history state. I mean sure, it's unlikely a user has spent hours crafting a perfect query in this little playground, but it's annoying to lose even a few minutes work, especially if I can't instantly recall what it was I had written.

The examples should work if I command-click (or control-click) to open them in a new tab, and they shouldn't erase work I've already done with no way to get it back. I can think of no simpler way to do this than by simply making each example link contain its example data in the query string.