davidhealey / waistline

Libre calorie counter app for Android. Built with Cordova.
568 stars 67 forks source link

Feature request: Change title of food editor to make it clear which item is being edited #250

Closed joshuakraemer closed 3 years ago

joshuakraemer commented 3 years ago

At the moment, food quantities can only be specified as number of servings (in the diary and in recipes). Could you please add the possibility to specify quantities in the product's base unit (e.g. g or ml) as well?

davidhealey commented 3 years ago

This is already possible in the current develop version, unless I'm misunderstanding what you want...

joshuakraemer commented 3 years ago

Ok, I think I understand now how it works: If you add a food from the local database to the diary, a copy of it is created in the diary. If you want to change the amount of the food added to the diary, you have to edit the copy in the diary after adding it and change "serving size" or "number of servings". I think this UI to adjust the amount of foods in the diary is confusing (at least it was for me). I actually expected that the entries in the diary are just links to the local food database. When I tried to change the amount of an enty in the diary, the common edit dialog appeared and I thought I would edit the original entry in my local database. Maybe the title of the edit dialog should read "Edit Diary Item" to make it clear that you are only editing a copy in the diary and not the original database entry.

davidhealey commented 3 years ago

I understand now, you're using the release version from one of the app stores. The current development version, which will be the next release version works in a completely different way. There are no longer multiple copies of foods. You can follow the updates here - https://github.com/davidhealey/waistline/issues/217

joshuakraemer commented 3 years ago

No, I am actually using the latest APK from https://github.com/davidhealey/waistline/issues/217.

When I add an item from the local database to the diary, I end up with a copy of the original food in the diary. If I change something in the diary (e.g. serving size), this change is not reflected in the original database entry.

If this is not how it's supposed to work, could you maybe explain how the amount of foods added to the diary should be specified?

davidhealey commented 3 years ago

If I change something in the diary (e.g. serving size), this change is not reflected in the original database entry.

Correct, but if you change it in the foodlist it will update in the diary. If it was the other way around then changing one diary entry would update all other diary entries and that's not good.

The diary doesn't keep it's own copy of the food. All it keeps is the id of the food and the portion/serving size info for that diary entry. The release version does make multiple copies though.

There is only a single food item editor that is shared between the foodlist, meals, recipes, food upload, and diary - no point in rewriting the same editor 5 times :)

I like your idea of adding more clarity to the editor titlebar, I'll add it to the list. I've changed the title of this thread so I can find it more easily.

joshuakraemer commented 3 years ago

The diary doesn't keep it's own copy of the food. All it keeps is the id of the food and the portion/serving size info for that diary entry.

What happens then when I change one of the other fields (e.g. calories) in the diary? Does it create a copy then? Those changes are still not reflected in the food list.

davidhealey commented 3 years ago

When you edit any of the nutriional info in the diary it will update the serving size.

So if you have an apple that is 100 calories and you enter 200 calories in the diary, the serving will be changed from 1 apple to 2 apple.

If you've made a mistake when entering the original food item and the 1 apple should have been 200 calories, then you can change that in the food list.

joshuakraemer commented 3 years ago

I see, thanks for explaining it.

I think there should be a short readme text in the release version to explain how the food editor works, especially the linked and unlinked modes.

davidhealey commented 3 years ago

Done the title thing - https://github.com/davidhealey/waistline/commit/d3a5bee311d2157afa1ed5bc74a773c250b11439