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

Undo redo refactor #140

Merged
merged 7 commits into from
Oct 29, 2020

Conversation

TanLeYang
Copy link
Collaborator

Closes #139

Change how undo and redo works. Now all the commands will call the method Model#save() to enable them to be undoable instead of each individual method in Model saving state on its own.

Every command is now undoable other that help and exit, tried it out a bit and it feels more natural that every action made can be undone compared to how it was previously.

Furthermore, undo and redo is now improved to be able to undo back to exactly how the screen was like for the user before he made the command. This is done by mapping each stored State to the correct view type for the Ui to use.

@codecov-io
Copy link

Codecov Report

Merging #140 into master will increase coverage by 0.34%.
The diff coverage is 96.82%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #140      +/-   ##
============================================
+ Coverage     70.97%   71.32%   +0.34%     
- Complexity      734      745      +11     
============================================
  Files           125      127       +2     
  Lines          2384     2420      +36     
  Branches        270      271       +1     
============================================
+ Hits           1692     1726      +34     
- Misses          595      596       +1     
- Partials         97       98       +1     
Impacted Files Coverage Δ Complexity Δ
...a/seedu/bookmark/logic/commands/CommandResult.java 85.00% <ø> (-2.50%) 11.00 <0.00> (ø)
src/main/java/seedu/bookmark/model/Model.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...a/seedu/bookmark/model/history/HistoryManager.java 85.71% <ø> (ø) 21.00 <0.00> (ø)
...rc/main/java/seedu/bookmark/logic/ViewManager.java 84.61% <84.61%> (ø) 5.00 <5.00> (?)
src/main/java/seedu/bookmark/logic/ViewType.java 100.00% <100.00%> (ø) 1.00 <1.00> (?)
...java/seedu/bookmark/logic/commands/AddCommand.java 100.00% <100.00%> (ø) 9.00 <0.00> (ø)
.../seedu/bookmark/logic/commands/AddNoteCommand.java 95.00% <100.00%> (+0.26%) 12.00 <0.00> (ø)
...va/seedu/bookmark/logic/commands/ClearCommand.java 100.00% <100.00%> (ø) 2.00 <0.00> (ø)
...in/java/seedu/bookmark/logic/commands/Command.java 100.00% <100.00%> (ø) 4.00 <3.00> (+3.00)
...a/seedu/bookmark/logic/commands/DeleteCommand.java 100.00% <100.00%> (ø) 7.00 <0.00> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fbc0b6f...3479429. Read the comment docs.

Copy link
Collaborator

@angrybunny123 angrybunny123 left a comment

Choose a reason for hiding this comment

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

LGTM! Nice job!

Copy link
Collaborator

@pennhanlee pennhanlee left a comment

Choose a reason for hiding this comment

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

LGTM!

@TanLeYang TanLeYang merged commit d8ab0e8 into AY2021S1-CS2103T-F13-2:master Oct 29, 2020
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.

Undo bug with Add command and Edit command
4 participants