-
Notifications
You must be signed in to change notification settings - Fork 0
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
Undo system #150
Undo system #150
Conversation
bug: undo with adding/removing sheets |
meeting notes: current issues: grapher don't observe state but flows new issue: flow watching the state or vice versa |
77cbfa1
to
99aee60
Compare
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 |
Let's rethink this and go with a system that makes snapshots of the Show state, and then restores those snapshot. |
What we do is we have the undo system implemented as a stack of show snap shots. When we do an undo, we restore the show to a previous state. 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. Fixing up linting and tests.
Updated to be based on a snapshotting system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the work on this! Left some suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the work on this! Left some suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the snapshot idea compared to the equal-and-opposite solution the undoable-action-list solution. I found a bug while testing it out and I included a video in the slack channel! Also a few other smaller bugs that I found:
- Dot type appearance changes are not undoable
- Undoing will reset the selected beat to Hup/0
I think 10 undos total is a bit on the shorter side but we can address that when we get #183 and #184.
I fixed up the bug, but I don't think I can merge till the approvals are done. |
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
npm run serve
and:npm run lint
npm run test:unit
npm run test:e2e
and ran relevant testsScreenshots/GIFs
[Attach screenshots if making a visible change!]