gosling.js
gosling.js copied to clipboard
Preserve view specification in session storage
I noticed when reloading the editor, the previous view specification is gone. It would be great to preserve the current view specification in session storage, so when I (as a user) reload the page, I will load the view specification I've previously worked on.
The nice thing about sessionStorage
is that it's not preserved between tabs. So if I wanted to work on two view specifications at the same time I can do this without having to worry about weird caching issues.
Partly supported in #722. We can additionally support language
and store two specs separately, i.e., JSON and JS codes. See below:
I am wondering will it make sense to store language
jscode
and code
rather than just the spec
.
Currently, the gosling spec is saved in session storage, which might lead to the following issues:
- the comments in the JSON editor will be removed
- the structured jscode will be changed to
var spec={code}
even though the users only edit in the JSON editor - even though users edit in the js editor, they will be directed to the JSON editor when refreshing
Originally posted by @wangqianwen0418 in https://github.com/gosling-lang/gosling.js/pull/722#pullrequestreview-1000237500