forked from nus-cs2103-AY2425S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Persistent search #129
Merged
jan-kai1
merged 11 commits into
AY2425S1-CS2103T-F09-2:PersistentSearch
from
jan-kai1:PersistentSearch
Oct 29, 2024
Merged
Persistent search #129
jan-kai1
merged 11 commits into
AY2425S1-CS2103T-F09-2:PersistentSearch
from
jan-kai1:PersistentSearch
Oct 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jan-kai1
added
type.Enhancement
An enhancement to an existing story
priority.Medium
Nice to have
labels
Oct 29, 2024
jan-kai1
merged commit Oct 29, 2024
a9846ef
into
AY2425S1-CS2103T-F09-2:PersistentSearch
3 of 4 checks passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trial Implementation of a persistent search function to group multiple selections
Issues
UI
Currently no way to see who you are trying to add
Testing
SearchModeSearchCommands
due to difficulty in checking Predicate EqualityCommands generated by
SearchModeSearchCommandParser
are based on Strings, making it difficult to check equality of differentSearchModeSearchCommands
generated.No idea how to check equality of different Predicates
FieldContainsKeyWordPredicate
currently uses a lambda function to parse out the target field from a person object. May be difficult to test equalityAlternative: Separate each field Predicate into its own separate method.
ErrorHandling
searchmode implementation
searchmode is tracked by a boolean value
searchMode
in the ModelManager class. WhensearchMode
is true, the commands accepted by the app changes.lastPredicate
The displayed list will be modified by chaining
lastPredicate
with Predicates generated based on user parameter input using FieldContainsKeywordPredicate classEnter search mode using
searchmode
Searchmode commands
exitsearchmode
Exits searchmode, returning to view of all contacts
search n/{String} e/{String p/ ...
Searches for contacts that matches ALL search parameter criteria
The search parsing currently implemented to check if a person field contains or contains a word equal to the string
This is done in the using the FieldContainsKeywordsPredicate class
This is currently implemented using a SearchModeSearchCommand class that tracks a Set<Predicate>
Upon .execute, the Set<Predicate> is reduced using the .and method to create a final predicate used to filter the list
The predicates are currently stored in a set rather than immediately chaining them using .and due to equality checking
Chaining Searches
Searches with multiple criteria can be chained using separate search commands
search n/Alex
would first add to the displayed list all Persons with name containing Alex
search n/Roy
Adds again to the current displayed list all Persons with name containing Roy
This is done using .or method to combine the new SearchModeSearchCommand predicate with
lastPredicate
in model manager