Repository: AY2425S2-CS2103T-T17-1/tp
Pull request #328: Update UG
Author: login: carineang
Labels: name: type.Task
description: Something that needs to be done, but not a story, bug, or an epic
name: type.Bug
description: A bug
name: priority.High
description: Must do
Created: 2025-04-06T16:31:04Z | Merged: 2025-04-07T10:15:27Z

Closes #266 
Closes #291
Closes #311

Linked issue #266: [PE-D][Tester E] UG - `sort` feature - Number of prefixes not stated
![image.png](https://raw.githubusercontent.com/wzhua02/ped/main/files/e1f3dc92-1c45-45b8-9d9c-64fbcd091916.png)

After reading the UG, I thought about trying 3 or more prefixes to sort by, to which I do encounter an error stating incorrect number of prefixes. I think it is good that the application fails this input appropriately, but maybe this should be documented in the UG too.

![image.png](https://raw.githubusercontent.com/wzhua02/ped/main/files/923661ae-07a5-45ce-8100-84d8466eefec.png)



<!--session: 1743753742286-af602dbf-747b-45a1-81b0-d4fde150cc5b-->
<!--Version: Desktop v3.6.0-->

-------------
Labels: `type.DocumentationBug` `severity.Low`
original: wzhua02/ped#3
Linked issue comments: user: login: Wrongian
created_at: 2025-04-06T06:29:33Z
body: UG issue just state can alr
author_association: NONE

Diff:
diff --git a/docs/UserGuide.md b/docs/UserGuide.md
index 6c7acecfc90..176764abaca 100644
--- a/docs/UserGuide.md
+++ b/docs/UserGuide.md
@@ -122,7 +122,7 @@ A GUI similar to the below should appear in a few seconds. Note how the app cont
 
 ![Ui](images/Ui.png)
 
-1. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.<br>
+1. Type the command in the input box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.<br>
    Some example commands you can try:
 
     * `list` : Lists all contacts.
@@ -141,21 +141,31 @@ A GUI similar to the below should appear in a few seconds. Note how the app cont
 
 ## Navigating the GUI
 
-### Basic Orientation
+1. At the main window, you can type the commands in the input box. The results of your commands will show up in the command output.
+2. In the contacts list, it will show all the contacts stored in Notarius.
+
 <p align="center">
   <img src="images/userinterface1.png" alt="Ui" />
 </p>
 
-### Contact Card
+3. When a contact is selected, you can view more details at the contact information card.
+
 <p align="center">
   <img src="images/userinterface2.png" alt="Ui" />
 </p>
 
-### Contact Details
+4. At the **contact list**, you can view the name, phone number, address, email and tags of the person. When a person is pinned, the pin icon will show up.
+
 <p align="center">
   <img src="images/userinterface3.png" alt="Ui" />
 </p>
 
+5. At the **contact information card**, you can view the person's note.
+
+<p align="center">
+  <img src="images/userinterface4.png" alt="Ui" />
+</p>
+
 --------------------------------------------------------------------------------------------------------------------
 
 ## Features
@@ -266,11 +276,19 @@ Adds a client contact to the address book.
 
 Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​`
 
+<div markdown="span" class="alert alert-primary">:bulb: **Tip:**
+
+* A client contact is considered a duplicate if another client contact has the same email (case-insensitive)
+and this duplicate email will be rejected.
+
+* Any additional white spaces detected in name, address, tags will be trimmed.
+
 <div markdown="block" class="alert alert-warning">
 :exclamation: **Constraints:**<br>
 * A client contact is considered a duplicate if another client contact has the same email(case-insensitive)
 and this duplicate email will be rejected.<br><br>
 * Phone number must be a number with 3 to 15 digits.
+
 </div>
 
 Examples:
@@ -422,19 +440,32 @@ Examples:
 
 #### Sorting of client contacts : `sort`
 
-Sort the address book by specified prefix in lexicographical order.
+Sort the contacts in Notarius by specified prefixes in lexicographical order.
 
 Format: `sort PREFIX`
 
+For **sorting by one prefix**, the following commands are allowed:
 * `sort n/` sorts contacts by ascending names.
 * `sort p/` sorts contacts by ascending phone numbers.
 * `sort e/` sorts contacts by ascending emails.
 * `sort a/` sorts contacts by ascending addresses.
 * `sort t/` sorts contacts by ascending tags.
-* `sort t/ n/` sorts contacts by tags first, then names.
-* `sort t/ p/` sorts contacts by tags first, then phone numbers.
-* `sort t/ e/` sorts contacts by tags first, then emails.
-* `sort t/ a/` sorts contacts by tags first, the addresses.
+
+For **sorting by two prefixes**, the first prefix must be `t/`. The following commands are allowed:
+* `sort t/ n/` sorts contacts by tags first, followed by names.
+* `sort t/ p/` sorts contacts by tags first, followed by phone numbers.
+* `sort t/ e/` sorts contacts by tags first, followed by emails.
+* `sort t/ a/` sorts contacts by tags first, followed by addresses.
+
+<div markdown="block" class="alert alert-warning">
+
+**:exclamation: Sorting constraints:**<br>
+
+* You are only allowed to use up to **two prefixes**.
+
+* All other sorting combinations, other than those listed above, are **not allowed**.
+
+</div>
 
 Examples:
 * `sort n/` returns contact by ascending names `Alex`, `Bernice`, `Charlotte`.
@@ -450,9 +481,9 @@ correct sorted order. To maintain the sorted order, you will need to run the `so
 
 * **Sorting Multiple Tags:**<br>
   It sorts the **first tag** in **alphabetical order**.<br>
-  e.g. `t/colleagues t/friends` will sort by `colleagues` tag first and followed by `friends` tag.<br>
-  e.g. If `t/colleagues t/friends` and `t/lawyer t/colleagues` are sorted, `t/colleagues t/friends` will appear before
-  `t/lawyer t/colleagues`, because `colleagues` tag comes first in the sorting order.
+  * `t/Criminal Case t/Defendant` will sort by `Criminal Case` tag first and followed by `Defendant` tag.<br>
+  * `t/Criminal Case t/Defendant` and `t/Plantiff t/Criminal Case` are sorted, `t/Criminal Case t/Defendant` will appear before
+  `t/Plantiff t/Criminal Case`, because `Criminal Case` tag comes first in the sorting order.
 </div>
 
 
diff --git a/docs/images/Ui.png b/docs/images/Ui.png
index f8754263525..b33e5480f44 100644
Binary files a/docs/images/Ui.png and b/docs/images/Ui.png differ
diff --git a/docs/images/userinterface1.png b/docs/images/userinterface1.png
index 4baf99b65bd..6022b47044a 100644
Binary files a/docs/images/userinterface1.png and b/docs/images/userinterface1.png differ
diff --git a/docs/images/userinterface2.png b/docs/images/userinterface2.png
index 8a8b3d95521..475ebfd5a9e 100644
Binary files a/docs/images/userinterface2.png and b/docs/images/userinterface2.png differ
diff --git a/docs/images/userinterface3.png b/docs/images/userinterface3.png
index f8335cdd319..392063d1c0d 100644
Binary files a/docs/images/userinterface3.png and b/docs/images/userinterface3.png differ
diff --git a/docs/images/userinterface4.png b/docs/images/userinterface4.png
new file mode 100644
index 00000000000..e165885f7c0
Binary files /dev/null and b/docs/images/userinterface4.png differ


Reviews:
user: login: Wrongian
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-06T16:42:35Z
user: login: Wrongian
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-06T16:54:32Z
user: login: Wrongian
body: Might want to address the tagging thing
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-06T17:52:04Z
user: login: clx3210
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-07T01:24:54Z
user: login: carineang
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-07T08:43:10Z
user: login: Wrongian
body: Seemsgood
state: APPROVED
author_association: NONE
submitted_at: 2025-04-07T09:46:25Z

Review comments:
path: docs/images/Ui.png
user: login: Wrongian
body: Nice
created_at: 2025-04-06T16:42:35Z
author_association: NONE
path: docs/UserGuide.md
user: login: Wrongian
body: I cant see what it looks like but hopefully its visually compact 
created_at: 2025-04-06T16:47:37Z
author_association: NONE
diff_hunk: @@ -350,19 +360,32 @@ Examples:
 
 #### Sorting of client contacts : `sort`
 
-Sort the address book by specified prefix in lexicographical order.
+Sort the contacts in Notarius by specified prefixes in lexicographical order.
 
 Format: `sort PREFIX`
 
+For **sorting by one prefix**, the following commands are allowed:
 * `sort n/` sorts contacts by ascending names.
 * `sort p/` sorts contacts by ascending phone numbers.
 * `sort e/` sorts contacts by ascending emails.
 * `sort a/` sorts contacts by ascending addresses.
 * `sort t/` sorts contacts by ascending tags.
-* `sort t/ n/` sorts contacts by tags first, then names.
-* `sort t/ p/` sorts contacts by tags first, then phone numbers.
-* `sort t/ e/` sorts contacts by tags first, then emails.
-* `sort t/ a/` sorts contacts by tags first, the addresses.
+
+For **sorting by two attributes**, the following commands are allowed:
+* `sort t/ n/` sorts contacts by tags first, followed by names.
+* `sort t/ p/` sorts contacts by tags first, followed by phone numbers.
+* `sort t/ e/` sorts contacts by tags first, followed by emails.
+* `sort t/ a/` sorts contacts by tags first, followed by addresses.
+
+<div markdown="block" class="alert alert-warning">
+
+**:exclamation: Sorting constraints:**<br>
+
+* You are only allowed to use up to **two prefixes**.
+
+* All other sorting combinations, other than those listed above, are **not allowed**.
+
path: docs/UserGuide.md
user: login: Wrongian
body: i dont know whether you wrote this 
but did you mention that the /t first should be first if there are 2 tags
created_at: 2025-04-06T16:53:13Z
author_association: NONE
path: docs/images/userinterface4.png
user: login: Wrongian
body: I think the someone should not have the tag client
because it is assumed they are already clients
created_at: 2025-04-06T17:50:57Z
author_association: NONE
path: docs/images/userinterface3.png
user: login: Wrongian
body: Same over here I dont think the client tag works
created_at: 2025-04-06T17:51:15Z
author_association: NONE
path: docs/images/userinterface2.png
user: login: Wrongian
body: I dont think the lawyer tag should be a thing because these are supposed to be for client contacts
created_at: 2025-04-06T17:51:46Z
author_association: NONE
diff_hunk: @@ -378,8 +401,8 @@ correct sorted order. To maintain the sorted order, you will need to run the `so
 
 * **Sorting Multiple Tags:**<br>
   It sorts the **first tag** in **alphabetical order**.<br>
-  e.g. `t/colleagues t/friends` will sort by `colleagues` tag first and followed by `friends` tag.<br>
-  e.g. If `t/colleagues t/friends` and `t/lawyer t/colleagues` are sorted, `t/colleagues t/friends` will appear before
+  * e.g. `t/colleagues t/friends` will sort by `colleagues` tag first and followed by `friends` tag.<br>
path: docs/UserGuide.md
user: login: clx3210
body: Can consider removing the 'e.g.' since its already mentioned that this section contains examples
created_at: 2025-04-07T01:24:49Z
author_association: COLLABORATOR
diff_hunk: @@ -378,8 +401,8 @@ correct sorted order. To maintain the sorted order, you will need to run the `so
 
 * **Sorting Multiple Tags:**<br>
   It sorts the **first tag** in **alphabetical order**.<br>
-  e.g. `t/colleagues t/friends` will sort by `colleagues` tag first and followed by `friends` tag.<br>
-  e.g. If `t/colleagues t/friends` and `t/lawyer t/colleagues` are sorted, `t/colleagues t/friends` will appear before
+  * e.g. `t/colleagues t/friends` will sort by `colleagues` tag first and followed by `friends` tag.<br>
path: docs/UserGuide.md
user: login: carineang
body: Fixed
created_at: 2025-04-07T08:43:10Z
author_association: NONE
diff_hunk: @@ -350,19 +360,32 @@ Examples:
 
 #### Sorting of client contacts : `sort`
 
-Sort the address book by specified prefix in lexicographical order.
+Sort the contacts in Notarius by specified prefixes in lexicographical order.
 
 Format: `sort PREFIX`
 
+For **sorting by one prefix**, the following commands are allowed:
 * `sort n/` sorts contacts by ascending names.
 * `sort p/` sorts contacts by ascending phone numbers.
 * `sort e/` sorts contacts by ascending emails.
 * `sort a/` sorts contacts by ascending addresses.
 * `sort t/` sorts contacts by ascending tags.
-* `sort t/ n/` sorts contacts by tags first, then names.
-* `sort t/ p/` sorts contacts by tags first, then phone numbers.
-* `sort t/ e/` sorts contacts by tags first, then emails.
-* `sort t/ a/` sorts contacts by tags first, the addresses.
+
+For **sorting by two attributes**, the following commands are allowed:
+* `sort t/ n/` sorts contacts by tags first, followed by names.
+* `sort t/ p/` sorts contacts by tags first, followed by phone numbers.
+* `sort t/ e/` sorts contacts by tags first, followed by emails.
+* `sort t/ a/` sorts contacts by tags first, followed by addresses.
+
+<div markdown="block" class="alert alert-warning">
+
+**:exclamation: Sorting constraints:**<br>
+
+* You are only allowed to use up to **two prefixes**.
+
+* All other sorting combinations, other than those listed above, are **not allowed**.
+
path: docs/UserGuide.md
user: login: Wrongian
body: not sure if this is resolved but I think it is?
created_at: 2025-04-07T09:45:03Z
author_association: NONE

PR comments:
user: login: codecov[bot]
created_at: 2025-04-06T16:32:08Z
body: ## [Codecov](https://app.codecov.io/gh/AY2425S2-CS2103T-T17-1/tp/pull/328?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103T-T17-1) Report
All modified and coverable lines are covered by tests :white_check_mark:

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
author_association: NONE
user: login: carineang
created_at: 2025-04-07T08:44:02Z
body: > Might want to address the tagging thing

Updated tags
author_association: NONE
user: login: carineang
created_at: 2025-04-07T08:59:53Z
body: added note about trimmed white spaces for name, address, tags
author_association: NONE
user: login: pranavyey
created_at: 2025-04-07T11:09:35Z
body: Closes #335 
author_association: NONE