nus-cs2103-AY2223S1 / pe-dev-response

0 stars 0 forks source link

Edit function rejumbles duplicates #4156

Open nus-pe-bot opened 1 year ago

nus-pe-bot commented 1 year ago

As mentioned in the previous report, edit's index does not work on duplicates.

However, after one is edited such that they are no longer duplicates,

e.g. changing calories

running the next edit command works properly but the indexing jumps.

here, after running edit 3 c/2, 4 is edited instead.

Screenshot 2022-11-11 at 5.09.18 PM.png

however, edit 4 c/3 now works fine, which might be confusing to users.

Screenshot 2022-11-11 at 5.09.39 PM.png


[original: nus-cs2103-AY2223S1/pe-interim#4154] [original labels: type.FunctionalityBug severity.VeryLow]

xav168 commented 1 year ago

Team's Response

Similar to the other issue, the edit function does work on duplicates, but the index of the edited food changed in this case because the two foods were recorded at the same time in the data file. While we acknowledge that this could potentially be confusing, it does not violate the intended behaviour of our food list, which sorts food items by their meal type. Additionally, this only happens in very rare cases, which is when the user deliberately sets the timing of two foods to be the same in the data file. However, for normal usage, we believe it is quite difficult to use the CLI to add two foods at the exact same time.

Duplicate status (if any):

Duplicate of #4718