processing / processing/p5.js-web-editor

Incremental auto-save?

Open
#558 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing Save, Download, and Duplicate flows described in the issue, including how sketch URLs identify the current version. Compare those flows with the three proposed versioning alternatives and clarify which behavior should be implemented, how script text is stored, and how older versions are retrieved. Done means an agreed versioning design is implemented and its fallback behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
full-stack
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.