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

add activity diagrams, autocomplete dg writeup #218

Merged

Conversation

nicleejy
Copy link

@nicleejy nicleejy commented Apr 8, 2023

No description provided.

@codecov
Copy link

codecov bot commented Apr 8, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (de46f89) 47.58% compared to head (a45d907) 47.58%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #218   +/-   ##
=========================================
  Coverage     47.58%   47.58%           
  Complexity      493      493           
=========================================
  Files           109      109           
  Lines          2482     2482           
  Branches        265      265           
=========================================
  Hits           1181     1181           
  Misses         1195     1195           
  Partials        106      106           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines +407 to +422
### \[Implemented\] Category Autocomplete feature

The category autocompletion feature in FastTrack is implemented using two `UI` classes, namely the `SuggestionListPanel` and the `CommandBox`.

The `SuggestionListPanel` is a JavaFX `UI` component responsible for displaying the suggestion list for the category autocomplete feature. It receives two parameters in its constructor, namely an `ObservableList<Category>` and a `CommandBox`.
The `ObservableList<Category>` contains all available categories in FastTrack, and the `CommandBox` is the `UI` component that contains a text field which allows users to enter commands, as well as for setting text to autofill.

To filter the categories based on the user's input, the `SuggestionListPanel` makes use of a `FilteredList<Category>`. This filtered list is used as the data source for the `ListView` `UI` component of the `SuggestionListPanel`.
The `FilteredList<Category>` displays filtered categories based on whether the category name matches the user's input.

Upon initialization, the `SuggestionListPanel` sets up autocomplete handlers for the suggestion list by calling the `SuggestionListPanel#initialiseAutocompleteHandlers()` method. This method registers listeners for focus changes, key presses, and autocomplete filters, which work together to ensure the autocomplete feature works responsively.

When the user enters a command, they can trigger the autocomplete feature by typing `c/` followed by a few characters. These characters can then be used to filter the categories, and the most likely suggestions are displayed in the suggestion list.
To load the filter for autocompletion, the `SuggestionListPanel#loadAutocompleteFilter()` method within `SuggestionListPanel#initialiseAutocompleteHandlers()` sets up a listener for changes in the text field of the `CommandBox`.
If the user types `c/` to start entering a category name, the `SuggestionListPanel#getAutocompleteSuggestions()` method is called to retrieve the most likely suggestions based on the user's input so far.
This method filters the categories based on the user's input and updates the filtered categories as the items in the `ListView` `UI` component of the `SuggestionListPanel`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job

@shirsho-12 shirsho-12 merged commit 8d92f58 into AY2223S2-CS2103T-W09-2:master Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants