From 01bd9cfe810023786b8cf5e534a72a396d1282fe Mon Sep 17 00:00:00 2001 From: dillontkh Date: Mon, 15 Apr 2024 17:02:54 +0800 Subject: [PATCH 1/3] Format UG for PDF --- docs/UserGuide.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index f00e0a425f2..01670b4db83 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -24,6 +24,8 @@ The purpose of this user guide is to **walk you through installing FitBook**, as You can use the [Table of contents](#table-of-contents) to navigate directly to what you're looking for. +
+
:bulb: **Tips/Info** Be on the lookout for boxes like these, they usually contain important information and helpful tips! @@ -85,7 +87,7 @@ Java is a versatile programming language used for developing various application 1. A GUI similar to the one depicted below should appear in a few seconds. The app contains some sample data for you to familiarize yourself with the UI.
- +
FitBook Graphical User Interface
@@ -224,6 +226,8 @@ Format: `note INDEX [NOTE] ` > While this can also be done using the `edit` command, this `note` command serves as a faster way for users to directly modify a note. +
+ Examples: * `note 1 History of asthma` - Changes the note of the 1st client to `History of asthma`. @@ -253,6 +257,8 @@ Alternatively, you can use **one or more** of the supported prefixes to quickly Format: `fitadd INDEX [/arms] [/legs] [/chest] [/back] [/shoulders] [/abs] [/all]` +
+ * At least one or more of the default supported prefixes must be supplied. | Prefix | Exercises | @@ -270,6 +276,8 @@ Format: `fitadd INDEX [/arms] [/legs] [/chest] [/back] [/shoulders] [/abs] [/all You must either specify an exercise name, or use one or more of the default supported prefixes, but not both together.
+
+
:warning: **Warning** @@ -297,6 +305,8 @@ exercise value(s). Exercise values that are not specified will remain unchanged. > ![fitadd-overwrite-reps-break](images/FitaddOverwriteRepsBreak.png)
+
+
:warning: **Warning** @@ -328,6 +338,8 @@ Examples: * `Reps`: 5 (specified value). * `Break between sets`: 0 seconds (default value). +
+ * `fitadd 1 n/burpees s/3 r/5 b/30` - Adds `burpees` exercise to the client at index `1` with the following values: * `Sets`: 3 (specified value). * `Reps`: 5 (specified value). @@ -358,6 +370,7 @@ Format: `fitdelete INDEX n/EXERCISE_NAME` * `EXERCISE_NAME` is **case-insensitive**. * Refer to the [parameter constraints table](#parameter-constraints) for more details about input restrictions. +
:warning: **Warning** @@ -425,6 +438,8 @@ Format: `find [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [w/RANGE] [h/RANGE] [nt/N * But `find t/fRieNd` will match the tag `friend`
+
+
:bulb: **Tip:** * If no prefix is specified for the first argument, it will be used to search for a client's name. @@ -459,6 +474,8 @@ Examples:
+
+ ### Clearing all entries : `clear` Clears all client information from FitBook. @@ -502,7 +519,7 @@ Furthermore, certain edits can cause FitBook to behave in unexpected ways (e.g. ### Save contact to phone
- +
QR Code Contact Card
@@ -538,6 +555,8 @@ While most modern smartphones are able to scan QR codes with the default camera **A**: Open a command prompt, and run the command `java --version`. +
+ ###### Why doesn't FitBook start when I double-click? **A**: If double-clicking to open FitBook doesn't work, try running it via the command line: @@ -569,6 +588,8 @@ While most modern smartphones are able to scan QR codes with the default camera
+
+ ## Command summary | Command | Format, Examples | @@ -586,6 +607,8 @@ While most modern smartphones are able to scan QR codes with the default camera | [**note**](#adding-a-note-to-a-client--note) | `note INDEX [NOTE]`

Example:
{::nomarkdown}
  • {:/} `note 2 Sprained right ankle in the past`{::nomarkdown}
  • {:/}

    `note INDEX /edit`

    Example:
    {::nomarkdown}
  • {:/}`note 1 /edit`{::nomarkdown}
  • {:/} | | [**weight**](#adding-or-removing-weight-of-a-client--weight) | `weight INDEX [WEIGHT]`

    Example:
    {::nomarkdown}
  • {:/} `weight 3 70`{::nomarkdown}
  • {:/} | +
    + ## Parameter Constraints | Parameter | Constraints | @@ -605,6 +628,8 @@ While most modern smartphones are able to scan QR codes with the default camera | **Exercise Reps** | {::nomarkdown}
    • Must be a positive integer.
    • A reasonable maximum value of 1000000 is allowed.
    {:/} | | **Exercise Break** | {::nomarkdown}
    • Must be a non-negative integer.
    • A reasonable maximum value of 1000000 is allowed.
    {:/} | +
    + ### Duplicate Clients FitBook does not allow duplicate clients. Clients are considered duplicates if they have the same values for all of the following fields. From f0f8f9430097dddbb2c298a91143da4e8cd759a8 Mon Sep 17 00:00:00 2001 From: dillontkh Date: Mon, 15 Apr 2024 17:24:41 +0800 Subject: [PATCH 2/3] Format DG for PDF --- docs/DeveloperGuide.md | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 7bbdc264f55..fa1c0fd4e57 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -2,6 +2,7 @@ layout: page title: Developer Guide --- +## Table of contents * Table of Contents {:toc} @@ -28,6 +29,8 @@ title: Developer Guide -------------------------------------------------------------------------------------------------------------------- +
    + ## **Setting up, getting started** Refer to the guide [_Setting up and getting started_](SettingUp.md). @@ -90,6 +93,8 @@ implementation of a component), as illustrated in the (partial) class diagram be The sections below give more details of each component. +
    + ### UI component The **API** of this component is specified @@ -130,6 +135,8 @@ Here's a (partial) class diagram of the `Logic` component: +
    + The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("delete 1")` API call as an example. @@ -149,6 +156,8 @@ How the `Logic` component works: several interactions (between the command object and the `Model`) to achieve. 1. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`. +
    + Here are the other classes in `Logic` (omitted from the class diagram above) that are used for parsing a user command: @@ -162,6 +171,8 @@ How the parsing works: * All `XYZCommandParser` classes (e.g., `AddCommandParser`, `DeleteCommandParser`, ...) inherit from the `Parser` interface so that they can be treated similarly where possible e.g., during testing. +
    + ### Model component **API** : [`Model.java`](https://github.com/AY2324S2-CS2103T-T17-3/tp/tree/master/src/main/java/seedu/address/model/Model.java) @@ -180,6 +191,8 @@ The `Model` component, * does not depend on any of the other three components (as the `Model` represents data entities of the domain, they should make sense on their own without depending on other components) +
    +
    :information_source: **Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list in the `AddressBook`, which `Person` references. This allows `AddressBook` to only require one `Tag` object per unique tag, instead of each `Person` needing their own `Tag` objects.
    @@ -193,6 +206,8 @@ The `Model` component, +
    + The `Storage` component, * can save both address book data and user preference data in JSON format, and read them back into corresponding @@ -237,6 +252,8 @@ The following sequence diagram illustrates this. ![QrAddPersonSequenceDiagram](images/QrAddPersonSequenceDiagram.png) +
    + We considered generating the QR code upon the creation of a `Person` object. However, we discovered that it was possible for a `Person` to be created, but never added to the address book, as shown in the following activity diagram. ![AddCommandActivityDiagram](images/AddCommandActivityDiagram.png) @@ -251,6 +268,8 @@ QR codes associated with a client are saved in the `data/qrcodes` folder as `.pn * [HASHCODE].png, where [HASHCODE] is the result of the `hashCode()` function of a `Person`. +
    + ### Deleting a client from FitBook The activity diagram below illustrates what happens when a client is deleted from `FitBook`. @@ -345,6 +364,8 @@ The following activity diagram summarizes what happens when a client is added or ![AddAndEditCommandSequenceDiagram](images/AddAndEditCommandActivityDiagram.png) +
    + ### Adding, editing or deleting exercises for a client FitBook enables our target user (personal trainers) to add, edit and delete custom exercises for each of their clients. The management of these custom exercises is performed using the `fitadd` and `fitdelete` commands. @@ -372,6 +393,8 @@ The following factors were taken into consideration when selecting a suitable da Upon listing out our requirements, we found that Java `HashSet` to be the most suitable one because it implements the Java `Set` interface. Apart from this, the `Set` interface exposes the `contains` method to check for duplicates. +
    + #### Detecting duplicate exercises Another point of consideration was with regard to how we should determine whether two exercises belonging to the same client @@ -396,6 +419,8 @@ The correct format is as follows : `add n/NAME p/PHONE` | `add p/PHONE` | _Name parameter missing!_ | | `add NAME` | _Invalid command format!_ | +
    + Now lets look at the `delete` command for another example The correct format is as follows : `delete INDEX` @@ -423,6 +448,8 @@ was trivial. **_Activity diagram for specialised error message outputs by AddCommandParser_** ![SpecialisedErrorMessages](images/SpecialisedErrorMessagesDiagram.png) +
    + ### \[Proposed\] Undo/redo feature #### Proposed Implementation @@ -445,6 +472,8 @@ initial address book state, and the `currentStatePointer` pointing to that singl ![UndoRedoState0](images/UndoRedoState0.png) +
    + Step 2. The user executes `delete 5` command to delete the 5th client in the address book. The `delete` command calls `Model#commitAddressBook()`, causing the modified state of the address book after the `delete 5` command executes to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book @@ -462,6 +491,8 @@ the `addressBookStateList`.
    +
    + Step 4. The user now decides that adding the client was a mistake, and decides to undo that action by executing the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous address book state, and restores the address book to that state. @@ -498,6 +529,8 @@ Thus, the `addressBookStateList` remains unchanged. ![UndoRedoState4](images/UndoRedoState4.png) +
    + Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not pointing at the end of the `addressBookStateList`, all address book states after the `currentStatePointer` will be purged. Reason: It no longer makes sense to redo the `add n/David …​` command. This is the behavior that most modern @@ -547,6 +580,8 @@ The following activity diagram summarizes what happens when a user executes a ne **Value proposition**: FitBook will help to keep track of client-specific information such as progress, goals, and preferences all in one place, allowing the user to organize and manage their clients' information efficiently. +
    + ### User stories Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*` @@ -571,6 +606,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli | `*` | user with many clients | sort contacts based on next session | easily locate the details of the client I am going to meet next | | `*` | user with many contacts in the address book | sort contacts by name | locate a client easily | +
    + ### Use cases **System**: FitBook @@ -613,6 +650,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
    +
    + **System**: FitBook **Use case**: UC03 - Add new contact @@ -657,6 +696,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
    +
    + **Use case**: UC05 - Add or overwrite exercise for a client **System**: FitBook @@ -742,6 +783,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
    +
    + **System**: FitBook **Use case**: UC08 - Edit a client's details @@ -779,6 +822,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
    +
    + **System**: FitBook **Use case**: UC09 - Adding/removing weight of a client @@ -874,6 +919,8 @@ testers are expected to do more *exploratory* testing. 1. Re-launch the app by double-clicking the jar file.
    Expected: The most recent window size and location is retained. +
    + ### Deleting a client 1. Deleting a client while all clients are being shown @@ -905,6 +952,8 @@ testers are expected to do more *exploratory* testing. Expected: FitBook starts with an empty address book. No clients are loaded. +
    + ## Parameter Constraints | Parameter | Constraints | @@ -924,6 +973,8 @@ testers are expected to do more *exploratory* testing. | **Exercise Reps** | {::nomarkdown}
    • Must be a positive integer.
    • A reasonable maximum value of 1000000 is allowed.
    {:/} | | **Exercise Break** | {::nomarkdown}
    • Must be a non-negative integer.
    • A reasonable maximum value of 1000000 is allowed.
    {:/} | +
    + ## Appendix: Planned Enhancements FitBook's team size is 5. @@ -949,6 +1000,9 @@ FitBook's team size is 5. For advanced users, we can provide a better keyboard navigation experience by making the element being selected with `Tab` clearer. We also plan to remove unnecessary `Tab` presses between elements of interest. e.g. to get from the command input box to the client list requires 2 `Tab`s even though the user cannot interact with the result response box. +
    + +{:start="5"} 1. **Adaptive client list entries** The client list will always show the most important information at a glance. To reduce clutter, each entry of the client list will only show the following fields, each in a single line. @@ -976,6 +1030,9 @@ FitBook's team size is 5. For example, the `fitdelete` command currently has the format `fitdelete INDEX n/EXERCISE_NAME`. Removing the requirement of specifying the `n/` prefix will provide greater convenience to the user by requiring them to type less. Furthermore, it will address issues that come with specifying multiple `n/` prefixes. +
    + +{:start="10"} 1. **Show an error message on the GUI when JSON file is corrupted** Currently, FitBook starts with an empty client list when it tries to load a corrupted JSON data file. The user does not get notified in the GUI that the previous data file had been corrupted, and only sees an empty client list in the FitBook GUI. From 5540a3e0e2e5c20c6b1f6835f5015df609ca7b45 Mon Sep 17 00:00:00 2001 From: dillontkh Date: Mon, 15 Apr 2024 17:48:20 +0800 Subject: [PATCH 3/3] Center images --- docs/DeveloperGuide.md | 98 +++++++++++++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 25 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index fa1c0fd4e57..23777409069 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -46,7 +46,9 @@ Refer to the guide [_Setting up and getting started_](SettingUp.md). ### Architecture - +
    + +
    The ***Architecture Diagram*** given above explains the high-level design of the App. @@ -76,7 +78,9 @@ The bulk of the app's work is done by the following four components: The *Sequence Diagram* below shows how the components interact with each other for the scenario where the user issues the command `delete 1`. - +
    + +
    Each of the four main components (also shown in the diagram above), @@ -89,7 +93,9 @@ the `LogicManager.java` class which follows the `Logic` interface. Other compone through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below. - +
    + +
    The sections below give more details of each component. @@ -100,7 +106,9 @@ The sections below give more details of each component. The **API** of this component is specified in [`Ui.java`](https://github.com/AY2324S2-CS2103T-T17-3/tp/tree/master/src/main/java/seedu/address/ui/Ui.java) -![Structure of the UI Component](images/UiClassDiagram.png) +
    + +
    The UI consists of a `MainWindow` that is made up of parts: @@ -133,14 +141,18 @@ The `UI` component, Here's a (partial) class diagram of the `Logic` component: - +
    + +
    The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("delete 1")` API call as an example. -![Interactions Inside the Logic Component for the `delete 1` Command](images/DeleteSequenceDiagram.png) +
    + +
    :information_source: **Note:** The lifeline for `DeleteCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.
    @@ -160,7 +172,9 @@ How the `Logic` component works: Here are the other classes in `Logic` (omitted from the class diagram above) that are used for parsing a user command: - +
    + +
    How the parsing works: @@ -177,7 +191,9 @@ How the parsing works: **API** : [`Model.java`](https://github.com/AY2324S2-CS2103T-T17-3/tp/tree/master/src/main/java/seedu/address/model/Model.java) - +
    + +
    The `Model` component, @@ -195,8 +211,9 @@ The `Model` component,
    :information_source: **Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list in the `AddressBook`, which `Person` references. This allows `AddressBook` to only require one `Tag` object per unique tag, instead of each `Person` needing their own `Tag` objects.
    - - +
    + +
    @@ -204,7 +221,9 @@ The `Model` component, **API** : [`Storage.java`](https://github.com/AY2324S2-CS2103T-T17-3/tp/tree/master/src/main/java/seedu/address/storage/Storage.java) - +
    + +
    @@ -250,13 +269,17 @@ Whenever a new client is added to the address book, a QR code is generated for t The following sequence diagram illustrates this. -![QrAddPersonSequenceDiagram](images/QrAddPersonSequenceDiagram.png) +
    + +
    We considered generating the QR code upon the creation of a `Person` object. However, we discovered that it was possible for a `Person` to be created, but never added to the address book, as shown in the following activity diagram. -![AddCommandActivityDiagram](images/AddCommandActivityDiagram.png) +
    + +
    Thus, we chose to only generate QR codes when the person is successfully added to avoid unnecessary QR code generations. @@ -274,7 +297,9 @@ QR codes associated with a client are saved in the `data/qrcodes` folder as `.pn The activity diagram below illustrates what happens when a client is deleted from `FitBook`. -![DeleteCommandActivityDiagram](images/DeleteCommandActivityDiagram.png) +
    + +
    ### Additional user details in FitBook On top of what AB3 has to offer, FitBook allows users to add additional details to each client to better track their health status. Some key features include: @@ -292,7 +317,9 @@ For more details on how the `note` field interacts with the `add` and `edit` com The sequence diagram below shows how the components interact with each other when the user inputs the command `note 1 Likes to eat`. -![AddNoteSequenceDiagram](images/AddNoteSequenceDiagram.png) +
    + +
    The diagram highlights the four main components of FitBook, highlighted in their respective colors. For more information regarding the four main components, see [Main components of the architecture](#main-components-of-the-architecture). @@ -306,7 +333,10 @@ We can refer to the sequence diagram [above](#interacting-with-the-note-command) For more details on how the `weight` field interacts with the `add` and `edit` commands, refer [here](#adding-or-editing-a-client). The activity diagram below illustrates what happens when a user enters a `weight` command. -![WeightCommandActivityDiagram](images/WeightCommandActivityDiagram.png) + +
    + +
    #### Height value of a client The `height` feature allows users to track a client's height. Since a client's height typically remains constant, we decided not to implement `height` as a trackable value (unlike [weight](#weight-tracking-feature)). @@ -470,7 +500,9 @@ Given below is an example usage scenario and how the undo/redo mechanism behaves Step 1. The user launches the application for the first time. The `VersionedAddressBook` will be initialized with the initial address book state, and the `currentStatePointer` pointing to that single address book state. -![UndoRedoState0](images/UndoRedoState0.png) +
    + +
    @@ -479,13 +511,17 @@ calls `Model#commitAddressBook()`, causing the modified state of the address boo to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state. -![UndoRedoState1](images/UndoRedoState1.png) +
    + +
    Step 3. The user executes `add n/David …​` to add a new client. The `add` command also calls `Model#commitAddressBook()`, causing another modified address book state to be saved into the `addressBookStateList`. -![UndoRedoState2](images/UndoRedoState2.png) +
    + +
    :information_source: **Note:** If a command fails its execution, it will not call `Model#commitAddressBook()`, so the address book state will not be saved into the `addressBookStateList`. @@ -497,7 +533,9 @@ Step 4. The user now decides that adding the client was a mistake, and decides t the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous address book state, and restores the address book to that state. -![UndoRedoState3](images/UndoRedoState3.png) +
    + +
    :information_source: **Note:** If the `currentStatePointer` is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The `undo` command uses `Model#canUndoAddressBook()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the undo. @@ -506,7 +544,9 @@ than attempting to perform the undo. The following sequence diagram shows how an undo operation goes through the `Logic` component: -![UndoSequenceDiagram](images/UndoSequenceDiagram-Logic.png) +
    + +
    :information_source: **Note:** The lifeline for `UndoCommand` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram. @@ -514,7 +554,9 @@ The following sequence diagram shows how an undo operation goes through the `Log Similarly, how an undo operation goes through the `Model` component is shown below: -![UndoSequenceDiagram](images/UndoSequenceDiagram-Model.png) +
    + +
    The `redo` command does the opposite — it calls `Model#redoAddressBook()`, which shifts the `currentStatePointer` once to the right, pointing to the previously undone state, and restores the address book to that state. @@ -527,7 +569,9 @@ Step 5. The user then decides to execute the command `list`. Commands that do no as `list`, will usually not call `Model#commitAddressBook()`, `Model#undoAddressBook()` or `Model#redoAddressBook()`. Thus, the `addressBookStateList` remains unchanged. -![UndoRedoState4](images/UndoRedoState4.png) +
    + +
    @@ -536,11 +580,15 @@ pointing at the end of the `addressBookStateList`, all address book states after purged. Reason: It no longer makes sense to redo the `add n/David …​` command. This is the behavior that most modern desktop applications follow. -![UndoRedoState5](images/UndoRedoState5.png) +
    + +
    The following activity diagram summarizes what happens when a user executes a new command: - +
    + +
    #### Design considerations: