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

Add undo/redo to webapp #65

Open
5 tasks
jkomoros opened this issue Sep 19, 2023 · 0 comments
Open
5 tasks

Add undo/redo to webapp #65

jkomoros opened this issue Sep 19, 2023 · 0 comments

Comments

@jkomoros
Copy link
Owner

Related to #6.

Some way to support undo/redo in the app.

Every operation that modifies any packets (create, delete, change) should go on a state stack. Literally push a new item onto .packets and have a currentPacketVersion which stays at 0 when it's at head, and is non-zero when it's not.

Pass into packet-editor canUndo and canRedo.

  • Make state.data.versionedPackets be an object with a packets array, and have getPacket know how to handle it
  • Add a state.data.versionedPacket.currentVersion= 0
  • Add a pushVersion(versionedState, newVersion : packet)
  • When doing an action that modifies packets, use pushVersion
  • Add a redo/undo functionality
jkomoros added a commit that referenced this issue Sep 20, 2023
Not used anywhere yet, and not exercised, but seems like it should work?

Part of #6. Part of #65.
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
This requires a lot of surgery on reducers/data.

I THINK everything seems to mostly work.

Note that this does NOT change the peristed data model, just the data model in memory.

There are currently no affordances to undo or redo, although versions are available in memory.

Part of #65.
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
This actually activates undoing and redoing in practice, and it appears to roughly work.

Part of #65.
jkomoros added a commit that referenced this issue Sep 20, 2023
jkomoros added a commit that referenced this issue Sep 20, 2023
@jkomoros jkomoros mentioned this issue Sep 21, 2023
2 tasks
jkomoros added a commit that referenced this issue Sep 21, 2023
This will allow us to version other properties on the undo stack, in particular the environment.

Part of #65. Part of #6.
jkomoros added a commit that referenced this issue Sep 21, 2023
…ate and currentPackets.

These were in different arms of the switch statement.

Part of #6. Part of #65.
jkomoros added a commit that referenced this issue Sep 21, 2023
Both branches should have copied the existing state.

There was no revealed bug yet because only packets is versioned, but that will soon change.

This is just clearer in intent.

Part of #6. Part of #65.
jkomoros added a commit that referenced this issue Sep 21, 2023
This means changes to environment are undoable.

Part of #65. Part of #6.
jkomoros added a commit that referenced this issue Sep 21, 2023
jkomoros added a commit that referenced this issue Sep 22, 2023
This is user-visible context for what the action is, that can be shown to a user to let them know what
action will be undone/redone.

Not yet shown to user, but all versioned actions now have a coherent description.

Part of #6. Part of #65.
jkomoros added a commit that referenced this issue Sep 22, 2023
jkomoros added a commit that referenced this issue Sep 22, 2023
The redoDescription message is a bit off, conceptually.

Part of #6. Part of #65.
jkomoros added a commit that referenced this issue Sep 22, 2023
jkomoros added a commit that referenced this issue Sep 22, 2023
This describes what the action will do.

Part of #6. Part of #65.
jkomoros added a commit that referenced this issue Sep 22, 2023
Before, there was an undo state at the very beginning for no reason.

Part of #6. Part of #65.
jkomoros added a commit that referenced this issue Sep 22, 2023
…on that was performed.

Previously they just mentioned the environment was changed.

Part of #65. Part of #6.
jkomoros added a commit that referenced this issue Sep 23, 2023
Before, if you undid a create_packet or _seed action you might get a non-existent seed/packet.

Part of #6. Part of #65.
jkomoros added a commit that referenced this issue Sep 23, 2023
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

1 participant