[REPL] option to persist queries (in localstorage?) upon reloads
I find myself reloading the admin UI sometimes when things aren't fresh namely the schema, the globals (and sometimes the data in the explorer). Upon reload, my previously executed queries in the REPL get discarded. I find it annoying as it acts as my draft when prototyping. So I must resort to saving the EdgeQL queries somewhere else in a random file.
Also, the "Persist query" toggle at the bottom is somewhat confusing as I thought it would enable the above behavior while in fact it prevents the editor from clearing upon query execution.
So two usability notes on this:
- First, the whole "clearing the editor after running a query" is weird and should not be the default. I know that's how REPLs work, but REPLs in general are very bad DX. Instead, the "Persist Query" should be ON by default and I'll argue that it should not even be an option. (see the next point)
To further explain, I expect my writing NOT to disappear after running the query. Often-time because my query is wrong and I want to immediately correct errors on it. Right now I must CMD+UP or click "Edit query" to re-run the query which is not convenient. And that's partly because I expect CMD+UP to go up the text editor instead of rewinding the history. And to go up the history, maybe we can find another shortcut, or simply use the mouse to "edit query" which are in the right panel.
- Besides, "Persist query" for me meant: persist queries in storage in my browser so when I come back to the UI, I find my previous queries ready to be tried and hacked upon. And this should also be the default. If for some reason, you want to clear your previous queries, maybe you can add a "Clear history" button on the right column to do just that.
That said, maybe I can help with this if others are sharing the same sentiment. Have a nice day 😃
@jaclarke I think we should implement this.