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 UndoCommand Feature #107

Merged
merged 6 commits into from
Mar 16, 2021

Conversation

nickyfoo
Copy link

Add a StateHistory class to keep track of the states of the address book as it changes, and an UndoCommand to make use of this.

Fixes #101.

Shift responsibility of adding state to StateHistory to Commands which alter the address book,
instead of the model manager
@nickyfoo nickyfoo added this to the v1.2b milestone Mar 14, 2021
@nickyfoo nickyfoo marked this pull request as draft March 14, 2021 17:58
@nickyfoo nickyfoo marked this pull request as ready for review March 15, 2021 06:26
@pyuxiang
Copy link
Member

pyuxiang commented Mar 15, 2021

What's the syntax to test this?

Courtesy of @nickyfoo: Just "undo". It will undo the last change to the AB (by add, delete, edit or clear).

@pyuxiang
Copy link
Member

INFO: Added state to stateHistory. Current number of states is: 2. Currently on state: 1 is the logged message. Seems like we can have a feature to easily redo as well.

Copy link
Member

@pyuxiang pyuxiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nickyfoo
Copy link
Author

INFO: Added state to stateHistory. Current number of states is: 2. Currently on state: 1 is the logged message. Seems like we can have a feature to easily redo as well.

Yup, definitely planning to in a future iteration. I mentioned it in a currently unimplemented nextState method in StateHistory

Copy link

@garyljj garyljj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@garyljj garyljj merged commit 9191f10 into AY2021S2-CS2103-W16-3:master Mar 16, 2021
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

Successfully merging this pull request may close these issues.

📖 As a clumsy user, I can undo commands
3 participants