Skip to content

Commit

Permalink
Merge pull request #308 from belligerentbeagle/246-dg-command-history…
Browse files Browse the repository at this point in the history
…-retrieval-implementation

Improve Command History implementation
  • Loading branch information
belligerentbeagle authored Apr 15, 2024
2 parents e2c61d5 + 8f768d4 commit db2c9bb
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,18 @@ The <span class="badge bg-light text-dark"><i class="fa-regular fa-square-caret-
retrieves the last command from the `CommandHistory` Singleton object.
<puml src="diagrams/CommandHistorySequenceDiagram.puml" alt="Command History Sequence Diagram" />

<box type="info" light>

**Note:** The `CommandHistory` Singleton object is used to store the command history. It is a Singleton object to ensure that there is only one instance of the `CommandHistory` object throughout the application.

</box>

Below is the activity diagram that shows how the process of a user interacting with the input field to retrieve the
last command executed.

<puml src="diagrams/CommandHistoryActivityDiagram.puml" width="400" />


{{ newPage }}

### \[Proposed\] Undo/Redo Feature
Expand Down
29 changes: 29 additions & 0 deletions docs/diagrams/CommandHistoryActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@startuml
skin rose
skinparam ActivityFontSize 15
skinparam ArrowFontSize 12
start


:Input field is empty;

if () then ([up or down arrow key pressed])
:Retrieves previousCommand
from CommandHistory
if available;
note
previousCommand is a generic variable
representing a command from CommandHistory.
Therefore it can contain an older or nere
command depending on the current command
end note
:previousCommand fills Input field;
else ([else])
:User enters command in Input field;
endif
:User executes command;
:Command saved in CommandHistory;
:Input field is cleared;

stop
@enduml

0 comments on commit db2c9bb

Please sign in to comment.