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

Project history #605

Open
14 tasks
amyjko opened this issue Nov 29, 2024 · 0 comments
Open
14 tasks

Project history #605

amyjko opened this issue Nov 29, 2024 · 0 comments
Assignees
Labels
buildable When an enhancement has a design ready to be built enhancement New or improved feature projects Anything related to project management.

Comments

@amyjko
Copy link
Collaborator

amyjko commented Nov 29, 2024

What are you trying to do that you can't?

A teacher partner has expressed a key requirement: a project version history that allows students to be able to view previous versions of projects to copy code, or to fully restore a project. This gives students a sense of security about not making mistakes.

The key requirements are:

  • Project versions are saved when 1) an edit occurs and there has not been a save for more than 3 minutes, 2) a save is explicitly requested, 3) a chat (in a forthcoming feature) is created on a specific line of code.
  • Project versions can be viewed by timestamp, output, and full source
  • A project can be restored to a prior version, overriding the project's current source with the prior version's source
  • When a project version only stores it's source, not other project metadata
  • Project history is not allowed to be more than 200K, to ensure the project document size doesn't go beyond Firestore's 1MB document size limit.
  • Project history can be cleared

What is your idea?

The simplest design for this would be:

  • Add a history field to the project schema, which contains a list of UTC time stamped source schemas, mirroring the sources field on the current schema
  • Update ProjectsDatabase so that any time a project's source is revised, it's history is updated if the last history was more than 10 minutes ago, or there is a request to explicitly snapshot the history before the edit.
  • When the history is updated, the code point length of all source files in the history is computed, and if it is greater than 250K, older history is trimmed until it is less than 250K.
  • Add a history dialog to the project view that shows a timestamped list of project source versions, and for each, the ability to view or restore, and a preview of it's output.
  • The history dialog also has a button to explicitly save a snapshot of the current source.
  • The history dialog also has a button to clear the history.
  • Viewing a history enters a "history" mode in the project view, which uses the old source instead of the new source, changes the footer color to indicate the mode, and shows a button to leave the view mode, as well as a restore button. In this mode, creators can copy code.
  • Pressing restore in either the history mode or the dialog takes the old source and makes it the project's new source, but also saves an entry in the history for the source that was overwritten.

This feature needs to be released by February 1st, 2025, to support the teacher's teaching.

@amyjko amyjko added enhancement New or improved feature projects Anything related to project management. buildable When an enhancement has a design ready to be built labels Nov 29, 2024
@amyjko amyjko self-assigned this Nov 29, 2024
@amyjko amyjko modified the milestones: 1.0, Adrienne's February unit Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buildable When an enhancement has a design ready to be built enhancement New or improved feature projects Anything related to project management.
Projects
None yet
Development

No branches or pull requests

1 participant