Skip to content

Incremental auto-save? #558

Closed as duplicate
Closed as duplicate

Description

@cshirky

Nature of issue?

  • Existing feature enhancement
  • New feature request

Feature enhancement details:

This is midway between an enhancement and a new feature request, since Save is already a function.
Right now, the sketch is saved if the user chooses Save, edits a file name after the first save or if the user Duplicates or (after bug fix) Downloads the file.

All of these behaviors follow the 20th century pattern of 'Remember to save your work!", which was a trail of tears.

Here are three alternatives for versioning, which could help even first-time users get to the essential value of versioning, which is "User can always fall back to most recent working version."

Alternative 1: Manual

Everytime a user saves or downloads, a version of the file is saved, and the URL contains a version counter that increments by 1, so that the URL after the third save would look like

http://alpha.editor.p5js.org/cshirky/sketches/S1KgQrXPz/3
or
http://alpha.editor.p5js.org/cshirky/sketches/S1KgQrXPz?version=3

Each version would be accessible by a URL of this form, and the bare URL would always refer to the most recent version (as now.)

The versions would only be the script text (or even a diff of the text); assets would still be pointed to externally.

Alternative 2: Auto on success

This would work identically to Alternative 1, except that it would auto-save every changed version that plays without run-time errors. This would build up many more versions, but would really save people, and especially novices, from having a working sketch, modifying it til it breaks, then not being able to fall back.

Alternative 3: Auto on run, saving errors

This would work identically to Alternative 2, except that it would auto-save every played version with changes. When there are run-time errors, it would save those alongside the version. This would build up many more versions still, but would allow anyone using the editor in an instructional context to capture all the student errors for study.

Activity

  1. catarak commented on Feb 21, 2018

    @catarak
    Member

    First of all, just want to make sure that autosave is working (though it does not save the version).

    Since saving a new version every time the sketch is run or saved would exponentially increase the size of the database, and each file has its own undo stack, maybe it would make sense to have an explicit button that's like 'save the sketch at this time to a version' and then maybe there's a GUI for users to see all of the versions for a sketch, and a user could access the version by a query string parameter as well. I guess I'm for Alternative 1 but more manual.

    Open to other thoughts!

  2. clairep94 commented on Oct 2, 2026

    @clairep94
    Collaborator

    Hi this is being worked on in the parent issue. I will mark as closed to de-dupe. Thank you flagging this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestProposal for adding a new functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions