edemaine / cocreate

Cocreate Shared Whiteboard/Drawing
MIT License
209 stars 27 forks source link

localstorage for remembering settings #16

Open edemaine opened 4 years ago

edemaine commented 4 years ago

As pointed out below, many of these things should be stored in user account if logged in; this issue is for not-logged-in users. The following should not be stored with user accounts though:

Saving the above settings is especially useful in a Comingle context, where we're constantly closing and reopening Cocreate rooms (including the same ones).

adqm commented 4 years ago

So I'm almost certainly an edge case, but I generally don't retain any state across browser restarts. So for me, I think that means that localstorage wouldn't actually be an effective store of anything. I think with #4 in place, it would be great to store these settings in the database somewhere, and then have the option to override them via localstorage, or something like that.

localstorage does, of course, have the advantage of not requiring #4, though...

adqm commented 4 years ago

I also think that if we are going to keep track of recently-visited (or bookmarked) room IDs, it might also make sense to be able to give nicknames to rooms (either as an actual global part of that room, or just on a per-user basis) to make picking the appropriate room out of that lineup easier. (oops, seeing now that this is mentioned in #6).

edemaine commented 4 years ago

Yes, this is meant to be complementary to #4 (user accounts) for those who don't want to sign in. Even if you clobber all state between sessions, localstorage would probably still be useful between tabs during the same browser session. You might close and then re-open a board, or open a new board from an existing one -- this will preserve some of your state, which I think would feel nice. Not a big deal.

I'm also interested in this because it's easier than #4, but offers at least some of the advantages. Not as much for you though. 🙂