calband / calchart-redesign

Calchart 4 for the web! 🌐
https://calband.github.io/calchart-redesign/
4 stars 0 forks source link

Undo system #150

Closed rmpowell77 closed 3 years ago

rmpowell77 commented 3 years ago

This closely follows the outline by Anthony Gore: https://vuejsdevelopers.com/2017/11/13/vue-js-vuex-undo-redo/

What we do is we have the undo system implemented as a stack of Store Commit changes. When we do an undo, we go back to an initial state and redo all of the Store commit commands. With CalChart, not every Store commit is a change we want to undo, so we have a filter where we only save certain commits.

Adding bottom row buttons using hotkeys. adding File/Edit menu.

Pre-PR checklist

Screenshots/GIFs

[Attach screenshots if making a visible change!]

vhlee7 commented 3 years ago

bug: undo with adding/removing sheets

vhlee7 commented 3 years ago

meeting notes:

current issues: dots are not connected to their continuities -dots do not regenerate flows when moving dot, state has updated but not the dot image

grapher don't observe state but flows

new issue: watches to auto regenerate the flow

flow watching the state or vice versa

rmpowell77 commented 3 years ago

Looks like this is still failing if you do the following:

Add a sheet, remove a sheet.

We need to make sure we reset these to 0:

selectedSS selectedDotIDs beat grapherToolDots

rmpowell77 commented 3 years ago

Let's rethink this and go with a system that makes snapshots of the Show state, and then restores those snapshot.

rmpowell77 commented 3 years ago

Updated to be based on a snapshotting system.

rmpowell77 commented 3 years ago

I fixed up the bug, but I don't think I can merge till the approvals are done.