nightscout / Trio

MIT License
45 stars 125 forks source link

[Feature request] Add a Food Manager & Database #268

Open LiroyvH opened 1 month ago

LiroyvH commented 1 month ago

Shamelessly copied from my submission to iAPS:

This is quite a huge feature request. Zero expectation it'll ever be built. :P But I'll make this request anyway just in case someone sees this and thinks "oh yeah, that's something I wanna code!!". :) And I know many people loved this feature in the past.

## Is your feature request related to a problem? Please describe. Quite a few people in the community probably remember Spike and a couple of us may actually still be using it; such as myself. But it's on its deathbed really as it runs on ancient code that cannot be ported due to all kinds of dependencies (like Adobe Air runtime) and to be honest I'm surprised I still managed to get it running on iOS 17. Anyway:

An integral part of Spike was the "Food Manager". This allowed you to:

You could then select multiple ingredient, enter how many of it you ate or how much weight or volume you ate/drink and put that in a "shopping cart" to get a final total sum of nutritional information. The final output of your selection/weight of ingredients gave a total sum of carbs, fats, proteins and calories for you to review. (The calories are important for people who count calories.) Then if that looked good to you, you could either store them directly as carbs and finish up or it could be fed (no pun intended) to its Bolus Calculator. (In Trio's case, you'd also want the proteins and fat fields populated in the calculator if user has enabled that.) Once you submit it, either through adding carbs or in the bolus calculator: it will also sync up with Nightscout. (That's my current setup, Trio gets my carb inputs from Spike.)

Currently, Trio does not have such a food manager. It only has a rather rudimentary basic storage.

## Describe the solution you'd like Being able to at least store ingredients/products with their nutritional info and then combine multiple items manually is the most important part. So you can select "150gr Potatoes + 200gr broccoli + 300gr spareribs" or something and it calculates the total carbs + proteins + fats and allows you to add that and/or feed to Trio bolus calculator.

The creation of an ingredient looks like so: image image

When you tap the created entry, it'll show as such and allows you to change the "amount" (essentially serving size/weight change - in this case from 100ml set in the ingredient to the 250ml (glass) I'll be consuming as an example):

image

As you can see it runs the calculations itself. Then you tap "Add" which adds it to the shopping cart.

When you're going to consume several items, such as a composed meal, all items will stack up in the shopping cart. For example, I've now added to my shopping cart: Yoghurt (kwark), Cruesli (muesli) with their respective weight and the 250ml of Coca Cola. It does the math and shows:

image

(This allows you to save this as a "recipe" if you always eat this configuration of ingredients for breakfast).

If it looks good in your shopping cart, just press "Finish" which will take the carbs total + timestamp + all ingredients in a note (to push to Nightscout) and allows you to add it or feed it to the bolus calculator. It only does carbs, but obviously in iAPS it would also be nice to have the fats and proteins field populated. image image

## Describe alternatives you've considered The alternative is using other apps to calculate carb/fat/protein(/calories) intake, many of which do not sync to Nightscout and are often not as user friendly. Another alternative is manually doing calculations based on the food labels on the packaging of whatever you're eating/drinking.

## Additional context Already provided in the solution description.

## Technical Details I've thought about this for a bit, but I don't think this needs changes to existing functionalities other than perhaps removing the rudimentary food storage thingy that is currently in the app. Feeding the carbs to the bolus calculator is likely done automatically by adding the carbs, just like when manually adding them now. I don't think there are dependencies, unless you want to link with public food API's, though those are scarce. I don't think there are risks involved, other than users inputting the wrong food details or something like that.

## User Impact I think this would be super super awesome, but I also understand it is A LOT of work and it is 100% luxury. But just in case someone sees this and thinks "zomg yes" and knows swift... I'd be really cool to have and extremely useful for both children as well as adults. Thank you for your consideration.