Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autosave bugs #5

Closed
shiffman opened this issue Jun 16, 2016 · 9 comments
Closed

autosave bugs #5

shiffman opened this issue Jun 16, 2016 · 9 comments

Comments

@shiffman
Copy link
Member

I am opening some issues to track high priority "next step" features @catarak and I discussed today.

A key feature is for users to be able to "save" projects and have a file management system that allows them to open past projects.

@catarak
Copy link
Member

catarak commented Jul 7, 2016

This is mostly working on the development branch, but I've been doing some future thinking...

Do we want to eventually add autosave? I like the way CodePen has it set up. What should happen when a user first opens the editor, starts writing some code, and hasn't saved yet? What should happen if the user closes the window? From that CodePen blog post, it seems like storing the project in localStorage can lead to some strange behavior.

A user can save projects without logging in right now. Not sure if we want to keep this or not.

cc @shiffman @lmccart

@shiffman
Copy link
Member Author

shiffman commented Jul 8, 2016

I agree that some sort of autosave feature is important. The main thing we want to avoid is users losing their code as that can be a major source of frustration. I read through the codepen page you linked to and seems like they have a smart, thoughtful way of doing this.

I'm not sure about the ability to save without logging in, there's probably a convenience to allowing this and quick and dirty testing out ideas, but there may be some issues that arise that we can't think of at the moment. Maybe we should say yes to that for now, but no uploading of media / files unless logged in?

@lmccart
Copy link
Member

lmccart commented Jul 11, 2016

I like the codepen setup. I'd be fine matching this model exactly. I don't know if we really need a toggle off autosave at this point though.

Another reference point is gist.github.com. I love that you can quickly save a snippet even if you're not logged in. They have something like one "anonymous" username that it is stored under: https://gist.github.com/anonymous/199be9f7ac2e94d9e7af896bc91d0e22. You can't click the anonymous username and see any other ones though, so they're still hidden.

One idea is to (differing from codepen a bit here), autosave from the start but don't have it actually show up in any account. The only purpose of the save is to restore if you close the window. We could use cookies to keep track of the most recent sketch open and automatically pull that up, in the way that osx windows restore files after reboot. I also think this could be overkill and it's enough just to pop up an alert if the user tries to close the window without saving.

@shiffman
Copy link
Member Author

I'm going to rename this thread to "autosave" since that's what we are discussing and the general saving is now working.

@shiffman shiffman changed the title save projects autosave projects Jul 21, 2016
@catarak
Copy link
Member

catarak commented Aug 9, 2016

Woohoo just added this to master! Projects save every 30s if autosave is on.

@shiffman
Copy link
Member Author

I'm not sure how to best resolve this but several students lost their work when they coded for a while, but never clicked save for the first time (and then their internet cut out or they navigated away by accident, etc.) I wonder if when a new project is created it should be "saved" immediately and then auto-save starts? But you can't press "new" again if you haven't actually edited any code?

@catarak
Copy link
Member

catarak commented Sep 16, 2016

I noticed this as well when I was teaching the p5.js class at Pioneer Works. Maybe the user flow should be something like

  1. A user clicks the new button
  2. A popup appears asking them to give the new sketch a name
  3. User can start editing the sketch, autosave is enabled

Another related issue is #84, which will prompt the user to save if they try to refresh/navigate away from the page.

@shiffman
Copy link
Member Author

@catarak I like this user flow very much. I think the same flow could be applied to "save as" (or "copy"?) as discussed in #98.

@catarak
Copy link
Member

catarak commented Nov 29, 2016

Just noticed a bug with autosave:

If autosave is enabled, and a user logs out, the sketch will still continue to autosave.

@catarak catarak changed the title autosave projects autosave bugs Nov 29, 2016
@catarak catarak added the bug label Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants