Skip to content

Commit

Permalink
Merge 5b4d17f into a655396
Browse files Browse the repository at this point in the history
  • Loading branch information
jonchan51 committed Nov 6, 2019
2 parents a655396 + 5b4d17f commit 24e4c44
Show file tree
Hide file tree
Showing 21 changed files with 19 additions and 39 deletions.
6 changes: 3 additions & 3 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ The following activity diagram summarizes what happens when a user executes a ne

image::CommitActivityDiagram.png[]

The addition of undo redo complicates certain commands. An example of this complication is when undoing add or delete commands. Originally, deleting a Meme will delete the corresponding image file on the disk. However, this means it is not possible to retrieve the file afterwards. Hence, the current implementation is to delete the Meme Entry in the json, but keep the original image file until Weme is closed. When Weme is closed, a thread will clean up all unreferenced image files in the image folder. This is part of the reason why certain commands such as `load` are not supported.
The addition of undo redo complicates certain commands. An example of this complication is when undoing add or delete commands. Originally, deleting a Meme will delete the corresponding image file on the disk. However, this means it is not possible to retrieve the file afterwards when attempting to undo. Hence, the current implementation is to delete the Meme entry in the json, but keep the original image file until Weme is closed. When Weme is closed, a thread will clean up all unreferenced image files in the image folder. This is part of the reason why certain commands such as `load` are not supported.

The following sequence diagram shows how the clean up works:

image::CleanUpSequenceDiagram.png[]

When the handleExit command is called, MainWindow will create a Thread to call `logic.cleanUp()` to prevent the GUI from slowing down. The thread then further spawns other threads to clean up the files in the data folder, deleting those images that are not found in the memes and templates list stored on Weme.
When the handleExit command is called, MainWindow will create a Thread to call `logic.cleanUp()` to prevent the GUI from slowing down. The thread then further spawns other threads to clean up the files in the data folder, deleting those images that are not found in the memes and templates list stored on Weme. The `cleanTemplateStorage()` part of the UML diagram has been truncated as it is similar to `cleanMemeStorage()`.

==== Design Considerations

Expand Down Expand Up @@ -288,7 +288,7 @@ When the handleExit command is called, MainWindow will create a Thread to call `
* **Alternative 2:** Implement a recycle bin to move files to/from on command.
** Pros: Commands do what they are fully expected to do (Delete deletes the image as well).
** Cons: Heavily complicates the logic with a need to copy and paste when undoing and redoing. Very difficult to understand and error-prone. Still needs to eventually clear the recycle bin on exit. Repeated work.
* **Alternative 3:** Make file commands undoable.
* **Alternative 3:** Make file-related commands undoable.
** Pros: No need to deal with file manipulation.
** Cons: Makes undo redo feature a lot more useless as it loses support for certain key commands.
// end::undoredo[]
Expand Down
3 changes: 3 additions & 0 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window.
* Items in square brackets are optional e.g `p/PATH [t/TAG]` can be used as `p//Users/Me/Downloads/meme.jpg t/cs2103` or as `p//Users/Me/Downloads/meme.jpg`.
* Items with `…`​ after them can be used multiple times including zero times e.g. `[t/TAG]...` can be used as `{nbsp}` (i.e. 0 times), `t/cs2103`, `t/soc t/funny` etc.
* Parameters can be in any order e.g. if the command specifies `p/PATH d/DESCRIPTION`, `d/DESCRIPTION p/PATH` is also acceptable.
* Commands that do not require parameters will ignore additional parameters provided. e.g. `list 1` is the same as `list`.
* Whenever `INDEX` is encountered, it refers to the index in the currently displayed list and *must be a positive integer*.
====

Expand All @@ -61,6 +62,7 @@ e.g. typing *`help`* and pressing kbd:[Enter] will open the help window.

Format: `help`

// tag::undoredo[]
==== Undoing previous commands : `undo`

Undoes commands and tells you the command you just undid. +
Expand All @@ -78,6 +80,7 @@ Example: `redo`
include::./DeveloperGuide.adoc[tag=undoable]
****
// end::undoredo[]

==== Switching tabs : `tab`

Expand Down
2 changes: 0 additions & 2 deletions docs/diagrams/CleanUpSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@startuml
scale 1.5
!include style.puml

box UI UI_COLOR_T1
Expand Down Expand Up @@ -66,5 +65,4 @@ deactivate MainWindow
deactivate MainWindow
end


@enduml
1 change: 0 additions & 1 deletion docs/diagrams/CommitActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@startuml
scale 1.5
start
:User executes command;

Expand Down
1 change: 0 additions & 1 deletion docs/diagrams/UndoRedoState0.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@startuml
scale 1.5
!include style.puml
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
Expand Down
1 change: 0 additions & 1 deletion docs/diagrams/UndoRedoState1.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@startuml
scale 1.5
!include style.puml
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
Expand Down
1 change: 0 additions & 1 deletion docs/diagrams/UndoRedoState2.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@startuml
scale 1.5
!include style.puml
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
Expand Down
1 change: 0 additions & 1 deletion docs/diagrams/UndoRedoState3.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@startuml
scale 1.5
!include style.puml
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
Expand Down
1 change: 0 additions & 1 deletion docs/diagrams/UndoRedoState4.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@startuml
scale 1.5
!include style.puml
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
Expand Down
1 change: 0 additions & 1 deletion docs/diagrams/UndoRedoState5.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@startuml
scale 1.5
!include style.puml
skinparam ClassFontColor #000000
skinparam ClassBorderColor #000000
Expand Down
1 change: 0 additions & 1 deletion docs/diagrams/UndoSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@startuml
scale 1.5
!include style.puml

box Logic LOGIC_COLOR_T1
Expand Down
Binary file modified docs/images/CleanUpSequenceDiagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/CommitActivityDiagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/UndoRedoState0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/UndoRedoState1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/UndoRedoState2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/UndoRedoState3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/UndoRedoState4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/UndoRedoState5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/UndoSequenceDiagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 13 additions & 26 deletions docs/team/jonchan51.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,36 @@
* *Major enhancement*: added *the ability to undo/redo previous commands*
** What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command.
** Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them.
** Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.
** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_
** Highlights: This enhancement affects existing and future commands, as well as the structure of the model part of the application. Especially due to the inclusion of files in the form of images, an in-depth analysis of design alternatives had to be considered. It was challenging to ensure that the implementation supported existing commands, while keeping in mind and support the features our application will deliver.
** Credits: Basic idea from AB4 implementation.

* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys.
* *Minor enhancement*:
** Added archive-related commands for Memes and Templates [https://github.com/AY1920S1-CS2103-T16-3/main/pull/133[#133]]
** Added logic for tabs [https://github.com/AY1920S1-CS2103-T16-3/main/pull/40[#40]]

* *Code contributed*: [https://github.com[Functional code]] [https://github.com[Test code]] _{give links to collated code files}_
* *Code contributed*: [https://nus-cs2103-ay1920s1.github.io/tp-dashboard/#search=&sort=groupTitle&sortWithin=title&since=2019-09-06&timeframe=commit&mergegroup=false&groupSelect=groupByRepos&breakdown=false&tabOpen=true&tabType=authorship&tabAuthor=jonchan51&tabRepo=AY1920S1-CS2103-T16-3%2Fmain%5Bmaster%5D[RepoSense Code]]

* *Other contributions*:

** Project management:
*** Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub
*** Extensively reviewed most of peer's pull requests before merging into master [https://github.com/AY1920S1-CS2103-T16-3/main/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+reviewed-by%3Ajonchan51[Reviews]]
*** Managed issues and milestones on GitHub for weekly deadlines.
** Enhancements to existing features:
*** Updated the GUI color scheme (Pull requests https://github.com[#33], https://github.com[#34])
*** Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests https://github.com[#36], https://github.com[#38])
*** Fixed SampleDataUtil for file support [https://github.com/AY1920S1-CS2103-T16-3/main/pull/67[#67]]
** Documentation:
*** Did cosmetic tweaks to existing contents of the User Guide: https://github.com[#14]
*** Assisted with update of documentation from addressbook3 to Weme [https://github.com/AY1920S1-CS2103-T16-3/main/pull/75[#75]]
** Community:
*** PRs reviewed (with non-trivial review comments): https://github.com[#12], https://github.com[#32], https://github.com[#19], https://github.com[#42]
*** Contributed to forum discussions (examples: https://github.com[1], https://github.com[2], https://github.com[3], https://github.com[4])
*** Reported bugs and suggestions for other teams in the class (examples: https://github.com[1], https://github.com[2], https://github.com[3])
*** Some parts of the history feature I added was adopted by several other class mates (https://github.com[1], https://github.com[2])
*** Reported bugs and suggestions for other teams [https://github.com/jonchan51/ped/issues[PED]]
** Tools:
*** Integrated a third party library (Natty) to the project (https://github.com[#42])
*** Integrated a new Github plugin (CircleCI) to the team repo

_{you can add/remove categories in the list above}_
*** Added support for Travis-CI, AppVeyor, Coveralls and Netlify [https://github.com/AY1920S1-CS2103-T16-3/main/pull/1[#1]]

== Contributions to the User Guide


|===
|_Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users._
|===

include::../UserGuide.adoc[tag=delete]
include::../UserGuide.adoc[tag=undoredo]

== Contributions to the Developer Guide

Expand All @@ -60,11 +55,3 @@ include::../UserGuide.adoc[tag=delete]

include::../DeveloperGuide.adoc[tag=undoredo]

include::../DeveloperGuide.adoc[tag=dataencryption]


== PROJECT: PowerPointLabs

---

_{Optionally, you may include other projects in your portfolio.}_

0 comments on commit 24e4c44

Please sign in to comment.