Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final tweaks to docs #188

Merged
merged 25 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
344 changes: 291 additions & 53 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

268 changes: 138 additions & 130 deletions docs/UserGuide.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/_sass/minima/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@
page-break-before: always !important;
}


tr {
page-break-inside: avoid;
}

}
12 changes: 10 additions & 2 deletions docs/_sass/minima/custom-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ img.emoji {
}

// Syntax highlighting term overrides
// - Multiline
.language-sh, .language-bash, .language-shell {
.highlight code {
.nb {
Expand All @@ -68,6 +69,13 @@ img.emoji {
}
}
}
// - Inline
code.language-plaintext, code.language-sh, code.language-bash, code.language-shell {
.nt {
/* do not wrap --flags */
white-space: nowrap;
}
}

// Pill styles
.pill {
Expand All @@ -83,6 +91,8 @@ img.emoji {
font-size: 75%;
vertical-align: text-bottom;

display: inline-block;

.pill {
/* so nesting pills will look the same */
font-size: 100%;
Expand Down Expand Up @@ -139,10 +149,8 @@ img.emoji {
border-color: #e8e6e5;
color: #444444;

padding: 4px 12px;
padding-right: 2px;
margin: 4px 2px;
display: inline-block;

&.jobby-data-class:not(:first-child) {
margin-left: 0;
Expand Down
61 changes: 61 additions & 0 deletions docs/diagrams/AutocompleteClasses.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@startuml
!include style.puml
skinparam arrowThickness 1.2
skinparam arrowColor LOGIC_COLOR_T4
skinparam classBackgroundColor LOGIC_COLOR

skinparam class {
'workaround to render generics properly without breaking the rest
BorderColor LOGIC_COLOR
BorderThickness 0

StereotypeFontColor LOGIC_COLOR_T2
StereotypeFontSize 14
}

'hidden boxes
class " " as HiddenOutside1 <<Hidden>>
class " " as HiddenOutside2 <<Hidden>>
skinparam class {
BorderColor<<Hidden>> #FFFFFF
BackgroundColor<<Hidden>> #FFFFFF
StereotypeFontColor<<Hidden>> #FFFFFF
StereotypeFontSize<<Hidden>> 1
}

'packages
package Autocomplete as AutocompletePackage <<Rectangle>> {
class AutocompleteGenerator
class AutocompleteSupplier

class "AutocompleteItemSet<T>" as AutocompleteItemSet
class "<<interface>>\nAutocompleteConstraint<T>" as AutocompleteConstraint

class "<<interface>>\nFlagValueSupplier" as FlagValueSupplier
class PartitionedCommand
}

package Model as ModelPackage {
}
package "Parser classes" <<Rectangle>> {
class Flag
}

'relationships
HiddenOutside1 .down.> AutocompleteGenerator
HiddenOutside2 .right.> AutocompleteSupplier

AutocompleteGenerator -down-> "1" AutocompleteSupplier : uses >

AutocompleteSupplier --> "1" AutocompleteItemSet
AutocompleteSupplier --> "*" FlagValueSupplier
AutocompleteSupplier ..> Flag

AutocompleteItemSet --> "*" AutocompleteConstraint : contains >

AutocompleteGenerator ..> PartitionedCommand : creates >
FlagValueSupplier .right.> PartitionedCommand : uses >

FlagValueSupplier ..down.> ModelPackage : uses >
PartitionedCommand ..down.> Flag
@enduml
6 changes: 3 additions & 3 deletions docs/diagrams/LogicClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ skinparam classBackgroundColor LOGIC_COLOR

package Logic as LogicPackage {

Class AddressBookParser
Class AppParser
Class XYZCommand
Class CommandResult
Class "{abstract}\nCommand" as Command
Expand All @@ -27,8 +27,8 @@ Class HiddenOutside #FFFFFF
HiddenOutside ..> Logic

LogicManager .right.|> Logic
LogicManager -right->"1" AddressBookParser
AddressBookParser ..> XYZCommand : creates >
LogicManager -right->"1" AppParser
AppParser ..> XYZCommand : creates >

XYZCommand -up-|> Command
LogicManager .left.> Command : executes >
Expand Down
6 changes: 6 additions & 0 deletions docs/diagrams/style.puml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
!define STORAGE_COLOR_T3 #806600
!define STORAGE_COLOR_T2 #544400

!define AUTOCOMPLETE_COLOR #3333C4
!define AUTOCOMPLETE_COLOR_T1 #C8C8FA
!define AUTOCOMPLETE_COLOR_T2 #6A6ADC
!define AUTOCOMPLETE_COLOR_T3 #1616B0
!define AUTOCOMPLETE_COLOR_T4 #101086

!define USER_COLOR #000000

skinparam Package {
Expand Down
Binary file added docs/images/AutocompleteClasses.png
Loading
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/LogicClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ title: Jobby

**Acknowledgements**

* Libraries used: [JavaFX](https://openjfx.io/), [Jackson](https://github.com/FasterXML/jackson), [JUnit5](https://github.com/junit-team/junit5)
Refer to the [Developer Guide's Acknowledgements section](DeveloperGuide.html#acknowledgements).
99 changes: 30 additions & 69 deletions docs/team/wxwern.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,103 +7,64 @@ title: Wern's Project Portfolio Page

### Project: Jobby

Jobby is a desktop application used for tracking job applications.
Jobby is a desktop application used for managing your job applications and associated organization and recruiter contacts.

Given below are my contributions to the project.

* **New Feature**:
* **New Feature**: Command Autocompletion ([PR #63](https://github.com/AY2324S1-CS2103T-W08-3/tp/pull/63))

* **Command Autocompletion**

* This allows users to autocomplete their commands, just like command terminals or programming IDEs, such as by pressing **TAB**.
* This allows users to autocomplete their commands, just like command terminals or programming IDEs, such as by pressing **TAB**, and even undo when you **BACKSPACE**.

* Like an IDE, it does a _subsequence_ match, so typing `-dsp` then **TAB** can select `--description`, allowing for fast disambiguation from another similar term like `--descending`.

* As a bonus, it also supports undoing with **BACKSPACE**. It keeps a complete undo history, so you can do multiple undos for the same command as long if you did not move your text cursor from the end point.

* **Rationale:**

* When developing Jobby, we started having too many command parameters with clashing prefixes, so it no longer make sense to offer single letter parameter names.

* Memorizing multi-letter abbreviations for a bunch of parameter is more difficult than a full name.

* However, a full parameter name takes much longer to type, which means it's no longer optimized for fast typists.

* Hence, autocompletion was implemented to resolve all of these concerns.

* **Implementation:** The internal implementation is written completely from scratch. This allows it to:

* specifically parse our custom command structure, and

* dynamically determine what should or should not be suggested next based on a given set of rules, or available data in the app.

* **UI:** The autocompletion UI is adapted from [@floralvikings's AutoCompleteTextBox.java](https://gist.github.com/floralvikings/10290131) with significant enhancements. These include:
* **Rationale:** It allows for faster command input, and reduces command syntax memorization.

* overhauling the implementation in modern Java syntax and JavaFX method calls,
* **Implementation:** The internal implementation is written completely from scratch to support our custom formats - more information available in the Developer Guide.

* modified the implementation idea to support for our custom `Stream`-based autocompletion result suppliers,

* integrating it directly within FXML,

* improved the UI to support adding indicators for invoking the best (first-in-list) autocomplete result,

* added support for auto-highlighting only the postfix term that is suggested for improved glancability,

* added support for external parties to invoke autocompletion (e.g., via preferred key events or UI buttons), and

* added support for undoing autocompleted results (and similarly for external parties to invoke undo).
* **UI:** The autocompletion UI is adapted from [@floralvikings's AutoCompleteTextBox.java](https://gist.github.com/floralvikings/10290131). The reference text box only has a barebones context menu, but significant enhancements has been made to the styling and behavior to improve readability and UX (like partial term highlighting and undo support), which can be seen when using Jobby.

* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2324s1.github.io/tp-dashboard/?search=AY2324S1-CS2103T-W08-3&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2023-09-22&tabOpen=true&tabType=authorship&tabAuthor=wxwern&tabRepo=AY2324S1-CS2103T-W08-3%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~other~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false)

* **Project management**:

* To be added...
* Configuring the Issue Tracker Tags and Milestones for the project.
* Setting up GitHub Actions for the project, including Java CI, CodeCov, GitHub Pages, PR Checks.
* Managed releases [v1.2 and v1.3](https://github.com/AY2324S1-CS2103T-W08-3/tp/releases).
* Styling the website for optimal readability and print formatting, including:

* **Enhancements to existing features**:
* Styling headers with improved spacing, typography and color for increased readability.

* Revamped the parameter syntax to use a prefix of `--param`.
* Tweaking the page-break rules for different elements, such as preventing page breaks on crucial boxes or enforcing page breaks immediately after certain headers.

* This allows for improved autocompletion UX as compared to `param/`, since we can immediately determine if the user intends to type it based on the first character.
* Styling custom unified UG elements, like the following:
* <span class="learning-outcome pill">:trophy: How to perform a task</span> <span class="information pill">:information_source: An info pill</span> <span class="warning pill">:warning: A warning pill</span> <span class="danger pill">:warning: A danger pill</span>
* <span class="applies-to pill"><span class="jobby-data-class pill">Organization</span> <span class="jobby-data-class pill">Recruiter</span> <span class="jobby-data-class pill">Job Application</span></span>
* <span class="beginner pill">Beginner</span> <span class="intermediate pill">Intermediate</span> <span class="expert pill">Expert</span><br><br>

* It is also much less likely to clash with an existing user input.
* **Enhancements to existing features**:

* Revamped the parameter syntax to use a prefix of `--param`.
* This allows for improved autocompletion UX as compared to `param/`, since we can immediately determine if the user intends to type a parameter based on the first character.
* It is also much less likely to clash with an existing user input.<br><br>
* Swapped out random ID generation with an implementation to derive IDs from an input name.

* This allows for improved UX when editing details that require an ID, combined with autocomplete integration.

* Previously, it was implemented by another team member by generating random RFC 4122 UUIDs instead.

* Now, random IDs are derived from the name, e.g., `google-sg-a8b3fe` from an input of `Google SG`.
* e.g., `google-sg-a8b3fe` can be derived from an input of `Google SG`.<br><br>

* **Documentation**:

* User Guide:

* Added a simpler command syntax introduction.

* Improved explanation of command symbols used in the guide.

* Added a structured command syntax introduction, and instructions to interpret command formats.
* Added usage guides for command autocompletion.

* Styling the website for improved overall glancability and support for fully-automated print formatting, including:

* Styling headers with improved spacing, typography and color for increased readability.

* Tweaking the page-break rules for different elements, such as preventing page breaks on crucial boxes or enforcing page breaks immediately after certain headers.

* Styling custom unified UG elements for readability, like the following:
* <span class="learning-outcome pill">:trophy: How to perform a task</span> <span class="information pill">:information_source: An info message pill</span>
* <span class="warning pill">:warning: A warning message pill</span> <span class="danger pill">:warning: A danger message pill</span>
* <span class="beginner pill">Beginner</span> <span class="intermediate pill">Intermediate</span> <span class="expert pill">Expert</span>
* <span class="applies-to pill"><span class="jobby-data-class pill">Organization</span> <span class="jobby-data-class pill">Recruiter</span> <span class="jobby-data-class pill">Job Application</span></span>

* Styling the website for improved overall readability and automated print formatting (see above in Project Management).<br><br>
* Developer Guide:

* Added a quick explanation of how "Parser classes" may obtain the properties of our custom `Flag`s (like `--name`) from a command via `ArgumentMultimap` and `ArgumentTokenizer`.

* Added a high-level end-to-end explanation of Jobby's internal autocomplete implementation and interactions.
* Integrated explanations of how "Autocomplete classes" work in the context of the `Logic` package.
* Updated how `AppParser` (formerly `AddressBookParser`) operates in the context of our app, since we now dynamically look up details and also support autocompletion.
* Added a complete high-level explanation of Jobby's internal autocomplete implementation.
* Added use cases for autocompletion.<br><br>

* **Community**:
* To be added...
* Detailed PR Reviews (e.g., [#32](https://github.com/AY2324S1-CS2103T-W08-3/tp/pull/32), [#34](https://github.com/AY2324S1-CS2103T-W08-3/tp/pull/34), [#39](https://github.com/AY2324S1-CS2103T-W08-3/tp/pull/39), [#69](https://github.com/AY2324S1-CS2103T-W08-3/tp/pull/69), [#183](https://github.com/AY2324S1-CS2103T-W08-3/tp/pull/183))
* Forum contributions (e.g., [#30](https://github.com/nus-cs2103-AY2324S1/forum/issues/30), [#103](https://github.com/nus-cs2103-AY2324S1/forum/issues/103))
* Reported bugs and suggestions for other teams (e.g., during PE-D)

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ private static Optional<Stream<String>> getPossibleValues(
) {
Optional<String> flagString = command.getLastConfirmedFlagString();
if (flagString.isEmpty()) {
return supplier.getValidValues(null, command, model);
return supplier.getValidValuesForFlag(null, command, model);
}

Optional<Flag> targetFlag = Flag.findMatch(
flagString.get(),
supplier.getAllPossibleFlags().toArray(Flag[]::new)
);
return targetFlag.flatMap(f -> supplier.getValidValues(f, command, model));
return targetFlag.flatMap(f -> supplier.getValidValuesForFlag(f, command, model));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public Set<Flag> getOtherPossibleFlagsAsideFromFlagsPresent(Set<Flag> flagsPrese
* @param currentCommand The current command structure. This should not be null.
* @param model The model to be supplied for generation. This may be null if the model is unavailable.
*/
public Optional<Stream<String>> getValidValues(Flag flag, PartitionedCommand currentCommand, Model model) {
public Optional<Stream<String>> getValidValuesForFlag(Flag flag, PartitionedCommand currentCommand, Model model) {
try {
return Optional.ofNullable(
this.values.getOrDefault(flag, (c, m) -> Stream.empty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,19 @@ public void getValidValues() {
var emptyCommand = new PartitionedCommand("");

// Should use the lambda's values
assertEquals(LIST_A, supplier.getValidValues(FLAG_A, emptyCommand, null)
assertEquals(LIST_A, supplier.getValidValuesForFlag(FLAG_A, emptyCommand, null)
.get().collect(Collectors.toList()));
assertEquals(LIST_B, supplier.getValidValues(FLAG_B, emptyCommand, null)
assertEquals(LIST_B, supplier.getValidValuesForFlag(FLAG_B, emptyCommand, null)
.get().collect(Collectors.toList()));
assertEquals(LIST_C, supplier.getValidValues(FLAG_C, emptyCommand, null)
assertEquals(LIST_C, supplier.getValidValuesForFlag(FLAG_C, emptyCommand, null)
.get().collect(Collectors.toList()));
assertEquals(LIST_EMPTY, supplier.getValidValues(FLAG_D, emptyCommand, null)
assertEquals(LIST_EMPTY, supplier.getValidValuesForFlag(FLAG_D, emptyCommand, null)
.get().collect(Collectors.toList()));
assertEquals(LIST_EMPTY, supplier.getValidValues(FLAG_E, emptyCommand, null)
assertEquals(LIST_EMPTY, supplier.getValidValuesForFlag(FLAG_E, emptyCommand, null)
.get().collect(Collectors.toList()));

// NPEs should be caught if the lambda does not handle it
assertEquals(LIST_EMPTY, supplier.getValidValues(FLAG_F, emptyCommand, null)
assertEquals(LIST_EMPTY, supplier.getValidValuesForFlag(FLAG_F, emptyCommand, null)
.get().collect(Collectors.toList()));
}

Expand Down
Loading