Skip to content

Commit 00191c0

Browse files
authored
Merge pull request AY2425S1-CS2103T-W10-4#262 from AY2425S1-CS2103T-W10-4/branch-UpdateDocumentation
Update UG and DG
2 parents d1d7aeb + 5cd6083 commit 00191c0

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

docs/UserGuide.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ The `undo` command allows you to reverse the last action performed, helping you
229229

230230
1. **Use Undo After a Mistake**: If you accidentally delete or modify a contact, you can quickly use `undo` to revert the last action and restore the previous state. <br>
231231
2. **Undo Works Only for Modifying Commands**: Only actions that modify the address book (like `add`, `edit`, or `delete`) can be undone. Commands like `list`, `filter`, or `find` do not trigger the undo mechanism. The reasoning behind this is that we consider them as view commands, not action commands that alter student data.
232+
3. **Undo Resets to Full View**: After using `undo`, the program will display all students in the address book, letting you confirm that your last change has been successfully reverted.
232233
</div>
233234

234235
<div markdown="span" class="alert alert-secondary">
@@ -280,6 +281,8 @@ The `redo` command allows you to reapply the last action that was undone, restor
280281

281282
1. **Use Redo to Restore Actions**: If you’ve undone an action by mistake, `redo` lets you reapply the change quickly. It’s useful when you second-guess your decision.
282283
2. **Redo Works Only After Undo**: `redo` will only work if an action has been undone previously. If you haven’t undone an action, `redo` will not perform anything.
284+
3. **Redo Resets to Full View**: After using `redo`, the program will show all students in the address book, allowing you to verify that your last action has been reapplied successfully.
285+
283286
</div>
284287

285288
<div markdown="span" class="alert alert-secondary">
@@ -293,10 +296,10 @@ Why does `redo` not work after I’ve made new changes to the address book? <br>
293296
Executing a command that modifies the address book (like `add`, `edit`, or `delete`) will **clear the redo stack**. This means once you undo a change and then modify the address book again, you will lose the ability to redo the previous undone action.
294297
</div>
295298

296-
#### Example Scenario:
299+
#### Example Scenario (Continuation from Undo):
297300
1. You undo a deletion of a contact.
298301
- *After Undo:* [After Undo Command] – The deleted contact is restored.
299-
2. You decide to redo the action and restore the contact again.
302+
2. You decide to redo the action and delete the contact again.
300303
- *After Redo:* [After Redo Command] – The contact is deleted once more.
301304

302305
**[After Redo Command]**

docs/diagrams/CommitActivityDiagram.puml

+19-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,28 @@ skin rose
33
skinparam ActivityFontSize 15
44
skinparam ArrowFontSize 12
55
start
6-
:User executes command;
76

8-
'Since the beta syntax does not support placing the condition outside the
9-
'diamond we place it as the true branch instead.
7+
:User inputs command;
108

11-
if () then ([command commits AddressBook])
12-
:Purge redundant states;
13-
:Save AddressBook to
14-
addressBookStateList;
9+
:Program checks command type;
10+
11+
if () then ([List, Find, Filter Command])
12+
13+
:Do not save to stateList;
1514
else ([else])
15+
if () then ([Archive Command])
16+
:Clear stateList;
17+
else ([Else])
18+
if () then ([Load Command])
19+
:Clear stateList;
20+
:Load original data as initialState to undo to;
21+
else ([Other Commands])
22+
:Purge redundant slide;
23+
:Execute the command;
24+
:Save current state to stateList;
25+
endif
26+
endif
1627
endif
28+
1729
stop
1830
@enduml

docs/images/CommitActivityDiagram.png

31.1 KB
Loading

0 commit comments

Comments
 (0)