mealie-recipes / mealie

Mealie is a self hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the url and mealie will automatically import the relevant data or add a family recipe with the UI editor
https://docs.mealie.io
GNU Affero General Public License v3.0
6.78k stars 698 forks source link

[v1.0.0b] [Task] - Recipe scaling UX #1390

Closed Bentipa closed 2 days ago

Bentipa commented 2 years ago

What is the problem this task addresses?

This is an extension ticket for #1345.

In this task we need to find a good way of showing the scaled servings and making clear what the user can configure.

At the moment the only thing the user can change is the scale. This scale is then multiplied with the “base-servings”, configured in the recipe editor to calculate the final servings amount.

Proposed/Possible Solution(s)?

I would propose having two ways to configure the servings amount:

  1. Configure a scale
  2. Configure the amount of servings

Option 2 is only possible if the recipe has a “base-servings” configured, Option 1 is used when no “base-servings” are given.

This could then look like this: image

When clicking on the "Scale.." button, it will show the modal with the configuration of a scale. The scale is then used for the ingredient scaling.

When clicking on the "Servings.." button, it will show the modal with the configuration of target servings. The scale is here calculated automatically.

In addition to these features I would hide the scale button and hide/disable the "+/-" + tooltip functionality from the servings button if no scaling can be applied (if the recipe does not have its ingredients configured with amount).

Bentipa commented 2 years ago

@hay-kot what is your opinion and how can we proceed here?

hay-kot commented 2 years ago

🤷

I think it's fine the way it is now, which is why I was hoping some other folks would jump in with their thoughts.

ditmarvisser commented 2 years ago

This looks awesome! Being able to change the servings granularly instead of 2x, 1/2x, or whatever is something I miss right now.

m10x commented 2 years ago

I also really miss to change servings granularly. If a receipt is for e.g. 4 servings, I want to be able to calculate 5 or even 5,5 (if written with the keyboard) servings. This is also how I know it form other apps/websites: + equals +1 serving. - equals -1 serving and then there's also the possibility to click on the field to input a float number.

Bentipa commented 2 years ago

@m10x @ditmarvisser the feature itself was already implemented by me and waits for a release by @hay-kot. This issue covers if the UX of the scaling itself should be adapted (e.g. change scale or servings amount, if provided)

aureateflux commented 1 year ago

Would it be possible to add a way to configure a minimum usable amount for a particular ingredient and make it honor that amount and its multiples?

For example, if you're making guacamole, you can't exactly use half an avocado because it's difficult to store, so when scaling the recipe, you could toggle an option so it wouldn't allow scales that would call for less than the whole avocado.

If the servings version of this feature is implemented, this could also be useful for preventing Mealie from generating a scaled version of the recipe that would be impractical (but still togglable in case someone wants to deal with storing leftover ingredients).

AnnieSixgun commented 1 year ago

I am just a cook , and after reading the comment from aureateflux, I felt I needed to comment,, if you limit your recipe to whole units such as the avacodo example used in aureateflux comment, then what happens with a recipe that uses a watermelon, would that mean scaling up the other recipe ingredients to match using a whole watermelon .. ??? Just a thought.....

aureateflux commented 1 year ago

Right. That's why I was suggesting it be a toggle you could set for a specific ingredient. It shouldn't try to do this by default since it wouldn't be applicable to most ingredients.

Your point is a good one especially if there are multiple ingredients in the recipe that someone wants to try to set the toggle on since that might cause problems due to the increasing complexity, so it might be that users should only be able to set this toggle for one or maybe two ingredients in the recipe they are working with.

abate commented 12 months ago

I'd like to share my thoughts on recipe scaling without offering specific advice. It's a topic I've been pondering for some time now.

Recipe scaling can indeed be as complex as you make it out to be. When I was developing a personal software solution for this, my approach was to initially convert all ingredient quantities to the metric system. This makes scaling recipes significantly easier, eliminating the need to count tablespoons or teaspoons (imagine dealing with 35 tablespoons of sugar!). After the parser does its job, all ingredients should be standardized in a common database. I chose to use the USDA Food Composition Database (https://fdc.nal.usda.gov/) to associate each ingredient with a specific quantity. Using the same ingredients database for all recipes is crucial for creating coherent shopping lists.

Another important consideration is that not all ingredients should be scaled with a uniform factor. For instance, scaling spices at a 1-to-1 ratio isn't always feasible, especially given the imprecise nature of internet recipes. Often, I find myself using scaling factors like 0.8 or even 0.5 for spices such as chili or salt to avoid overdoing it.

With these principles in mind and a database of triplets (ingredient, quantity, scaling factor), you can effectively scale each ingredient. However, that's not the end of the story.

Internet-sourced recipes frequently use imprecise language when referring to quantities ("add 2 tablespoons of flour"). In contrast, professional recipes are much more precise, but they're not as common for everyday cooking. When scaling a recipe, ideally, these vague references should be replaced either with computed quantities or adjusted to remove ambiguity. In the latter case, every use of an ingredient in a recipe should be scaled individually. Consider, for instance, a cake recipe that requires flour for both the dough and the custard.

Moreover, when scaling a recipe for a small group, you can usually stick to the same kitchen tools. However, when you're massively increasing quantities, you'll often need to adjust your equipment as well. For instance, you can't expect to uniformly bake a cake simply by using a larger oven pan when you're making five times the original amount. It's a logistical challenge that requires careful consideration.

These are my thoughts on the matter. I hope they provide some insight into the complexities of recipe scaling.

Blackclaws commented 7 months ago

So using the scaling feature for the first time I was actually surprised that it scaled by the number of servings each time by default.

My original assumption would have been that I have a base recipe that makes a number of servings and I adjust the slider to say how many servings I want. Most recipes scale pretty well that way (since most of the world uses metric anyway scaling weird imperial units is really unimportant to me), and while I agree with @abate that there is indeed a logistical challenge involved with cooking an absurd amount of things, that isn't something mealie should be dealing with. I expect a bit of brainpower from myself when cooking :D

Nutellaeis commented 7 months ago

I agree with @Blackclaws on this one. It does not need to be overly complex. Mostly I will scale my recipes from 1 to 4 servings and even if I have the occasional 8 tablespoons that is fine. And the rare occasion of cooking for 20 people is an exception anyways. I would never expect Mealie to handle all that complexity for me.

Assuming Mealie is made for the enthusiast homecook and not for total beginners spices are always an approximate value. No need for Mealie to tell me I have to be careful with scaling the chilli ammount by 4. I know that myself.

So I would really love a simple multiplication/division of the base numerical value without any complicated extra steps. It will be useful 95% of the time.

andreapastorp commented 7 months ago

Agree with the previous 2 comments, and with others who have already raised this in https://github.com/mealie-recipes/mealie/issues/2896, https://github.com/mealie-recipes/mealie/discussions/2861 and https://github.com/mealie-recipes/mealie/discussions/1161#discussioncomment-5110337.

Usually, servings are used to determine amounts, so I don't quite understand the use case of the scale. Perhaps when you want to make "smaller" or "bigger" portions? (I'd be interested in learning how it is used by other people)

Currently, the process goes a little like:

I would expect this to end in the second step.

So indeed, doesn't need to be complex. Mealie can calculate a what a single serving is and I can just increase or decrease the number of servings I want to cook.

To the proposed solution I would just add that both Option 1 and 2 are technically the same functionality, Option 1 (scale) just has a different name when no number of servings can be identified from the recipe.

snickers2k commented 7 months ago

i don't even see that scale option anywhere ?! this is one of the best features with tandoor, although i like mealie better overall - but not without this feature.

its not a "nice to have" feature, but a "must have" and a "no-go" feature, if not working.

RealFoxie commented 7 months ago

In a recipe above 'ingredients' there is a + and - to scale. You can also click on the red 'amount' (servings) to set a custom scaling. The feature is there, the ux is just not friendly to go from e.g. a recipe for 5 people to a recipe for 3 people. Screenshot_20240302-195242

snickers2k commented 7 months ago

In a recipe above 'ingredients' there is a + and - to scale.

okay, thats odd... i don't have this button -/+ buttons

Bildschirmfoto 2024-03-03 um 14 01 55
Mraedis commented 7 months ago

This only works when you have ingredient amounts enabled @snickers2k . It can be done per-recipe and the default follows a global toggle.

snickers2k commented 7 months ago

ohh...! okay.. thank you

is it really a good idea to have this opt-in - disabled by default? Or is it because of still beta-feature? (and bugs needs to be fixed before default enabled?)

also where can i find this "global toggle"? :)

thank you

Mraedis commented 7 months ago

Mmm strange I could've sworn I had to toggle it somewhere before. Might be because I now use the ingredient parser for any recipe so the toggle is always switched. :)

snickers2k commented 7 months ago

😧 "ingredient parser" ..?! and there the next rabbit hole comes :D i just read some lines about that... again, is it a good idea to have this as opt-in?

mealie seems pretty mighty, i respect that, but for some things, people just want it up and running :/

at the end, i only want to store some recipes.. thought it's not too much of a rocket science

Mraedis commented 7 months ago

Yes, because the auto parser is hardly 100% accurate, so if you want to "just works" then you have to go with what works, which is parsing nothing smartly at all.

RealFoxie commented 7 months ago

The clue here is that you can't scale a recipe without the program knowing what an amount is to be scaled. for that you need to parse the ingredients. can be pretty quick for English, but depending on the input, it needs manual intervention.

In group settings you can set this global toggle. So in yourUrl.com/group

You can use mealie without it, but then you miss out on features like this.

It could also just scale 'any number' in a best-effort for non parsed ingredients. But I think most code contributors just use the parsing and have never had the need for that.

snickers2k commented 7 months ago

The clue here is that you can't scale a recipe without the program knowing what an amount is to be scaled.

i'm new to "own cookbook"-"game", and only quickly checked out tandoor as well. there it seems to be no problem at all. its automatically enabled and for what i seen in a few tests, works like charm

BlakeTech commented 7 months ago

Since the feature's being discussed, could I ask if it'd be possible for the reverse as well? Recipe scaling based on ingredient limits? Or maybe it's already in as part of the ingredients amounts parser, and I'm just not sure how to use it?

Say I have one ingredient of which I only have X amount left, where X is less than what the recipe asks for. Of course, I could just go and buy more, but I also just want to finish off the existing materials I have on hand, or maybe the ingredient is hard to come by.

In such cases, I'd just want to see how much of the other ingredients in relative proportion to this limiting ingredient quantity I'd need for the other materials.

lzsix commented 4 months ago

if you have your base recipe for 4 servings, the +- increases or decreases by 4 each time the button is pressed.

I'm also checking out tandoor in comparison, the best would be a combination of both tbh.

I would assume to increase/decrease the serving size +-1 each time i press it. My current workaround is so scale the recipe manually while importing it to 1 serving size.

I agree with BlakeTech specifying a limiting ingredient and scaling the recipe accordingly would indeed be a nice feature although i would'nt be used often.

boc-the-git commented 2 months ago

Lots of people have commented on this issue.. I'm wondering if anyone has a view on this PR. Please share your thoughts over there.