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

Maintaining Sort order when adding or editing contacts #213

Conversation

AbdulrahmanAlRammah
Copy link
Collaborator

@AbdulrahmanAlRammah AbdulrahmanAlRammah commented Nov 7, 2024

Closes #175

@AbdulrahmanAlRammah AbdulrahmanAlRammah added this to the v1.5 milestone Nov 7, 2024
@AbdulrahmanAlRammah AbdulrahmanAlRammah self-assigned this Nov 7, 2024
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 76.74419% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../java/seedu/address/commons/core/SortSettings.java 66.66% 7 Missing ⚠️
...rc/main/java/seedu/address/model/ModelManager.java 85.71% 2 Missing ⚠️
src/main/java/seedu/address/model/UserPrefs.java 87.50% 1 Missing ⚠️
Files with missing lines Coverage Δ Complexity Δ
...java/seedu/address/logic/commands/SeedCommand.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
src/main/java/seedu/address/model/Model.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
...a/seedu/address/model/person/PersonComparator.java 50.00% <ø> (ø) 5.00 <0.00> (ø)
src/main/java/seedu/address/model/UserPrefs.java 83.78% <87.50%> (+3.78%) 12.00 <2.00> (+2.00)
...rc/main/java/seedu/address/model/ModelManager.java 96.82% <85.71%> (-3.18%) 27.00 <3.00> (+3.00) ⬇️
.../java/seedu/address/commons/core/SortSettings.java 66.66% <66.66%> (ø) 5.00 <5.00> (?)

... and 6 files with indirect coverage changes

@AbdulrahmanAlRammah AbdulrahmanAlRammah marked this pull request as ready for review November 7, 2024 10:57
Copy link

@liauzhanyi liauzhanyi left a comment

Choose a reason for hiding this comment

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

Just some naming issues to fix, otherwise I think great idea to make use of the preferences.json!

@@ -20,6 +22,8 @@
*/
public class ModelManager implements Model {
private static final Logger logger = LogsCenter.getLogger(ModelManager.class);
private static final String RESORT_ERROR = "Error: User Prefs had an invalid sort parameter. "
+ "Resorting after changes were made to the addressbook was abandoned.";

Choose a reason for hiding this comment

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

I think should be "Re-sorting"?

setSortSettings(new SortSettings(parameter, isAscending));
}

private void resortPersonList(SortSettings sortSettings) {

Choose a reason for hiding this comment

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

not sure if its just me but since "resort" is an actual word, it kind of requires at least a second read in order to understand what it meant. I think maybe sortPersonListAgain might be better? or if you prefer re-sort then reSortPersonList?

Copy link

@liauzhanyi liauzhanyi left a comment

Choose a reason for hiding this comment

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

lgtm

@liauzhanyi liauzhanyi merged commit 534c698 into AY2425S1-CS2103-F10-2:master Nov 7, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.Medium Nice to have
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintaining Sort Order
2 participants