Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

[Feature Request] Use Session Storage so code persists across refreshes. #431

Open
carlsmith opened this issue Sep 12, 2019 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@carlsmith
Copy link

carlsmith commented Sep 12, 2019

When the tab is refreshed, everything is lost, which sucks in a few obvious ways.

A callback bound to onbeforeunload could quickly copy the details from each file to a hash, serialize it with JSON, and stash it to sessionStorage. Then, an onload handler would check sessionStorage and restore the important aspects of the previous state (or bring up the New Project dialog) when the new page loads.

Storing the data in localStorage is a possible alternative, but this request is limited to edits persisting long enough for the user to refresh the page (or close it, change their mind and reopen it a moment later) without losing their work.

One problem with this proposal is that users sometimes want to refresh the page to start a new project. Using the browser UI (outside the Studio) to delete the session data manually before refreshing the tab would be clunky and people will not always make the connection.

One solution would be to add a New Project button (with a confirmation dialog) that deletes sessionStorage then refreshes the page. Another option would be to replace the current exit dialog (that confirms you want to leave) with one that asks if you want to nuke your session on the way out.

Thank you for considering this.

@yurydelendik yurydelendik added enhancement New feature or request help wanted Extra attention is needed labels Sep 12, 2019
@mollthecoder
Copy link

Maybe you could even mix the two and store both localstorage and sessionstorage. On page load, you could maybe copy localstorage (if it exists) to sessionstorage to then read.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants