Git Product home page Git Product logo

Comments (9)

catarak avatar catarak commented on June 19, 2024 1

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

from p5.js-web-editor.

shiffman avatar shiffman commented on June 19, 2024 1

@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.

from p5.js-web-editor.

catarak avatar catarak commented on June 19, 2024

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

from p5.js-web-editor.

shiffman avatar shiffman commented on June 19, 2024

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?

from p5.js-web-editor.

lmccart avatar lmccart commented on June 19, 2024

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.

from p5.js-web-editor.

shiffman avatar shiffman commented on June 19, 2024

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

from p5.js-web-editor.

shiffman avatar shiffman commented on June 19, 2024

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?

from p5.js-web-editor.

catarak avatar catarak commented on June 19, 2024

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.

from p5.js-web-editor.

catarak avatar catarak commented on June 19, 2024

Just noticed a bug with autosave:

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

from p5.js-web-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.