RecipeSage icon indicating copy to clipboard operation
RecipeSage copied to clipboard

Add yield and fraction button to scale modal

Open DanTup opened this issue 1 year ago • 3 comments

I added the Pizza Dough recipes from Ooni which makes 4x 12" pizza doughs. I entered '4 12" Pizzas' in the Yield field and copied the ingredients amounts as-is, and I see there's a Scaling option when I view the recipe, but because the original recipe is for 4 doughs, the scaling options are slightly awkward (eg. I'd have to enter 1/4 if I wanted to make one, or 5/4 if I wanted to make 5).

While I could scale the default recipe down to 1/4 of the amounts and then the scaling amounts would be "per dough", it might be nice if the yield info could be used in the UI for scale. Eg. if I enter "4 Doughs" (or "4 People") in the yield box, have the scaling UI show "1 Dough", "2 Doughs" etc.. That would make it easier to make "5 doughs" from a "4 dough" recipe, for example.

(Thanks for the app! I'm trying to find a decent recipe app that I can access across devices - all the others I've tried so far have had annoyances that made me discount them very quickly, but so far I quite like this one :-))

DanTup avatar Sep 20 '24 16:09 DanTup

While I'd love to do this, I do believe this has a high chance of being inconsistent unfortunately. It would also involve a lot of language-specific parsing.

I do believe there are two approaches we could take here to improve the experience:

  1. Display the yield within the scale modal
  2. Add a 1/2 button to the scale modal

julianpoy avatar Oct 24 '24 23:10 julianpoy

There's already a 1/2 button for scaling, but you still have to do the maths in your head (like if it makes 5 portions, 1/2 doesn't help). Showing the yield field on the popup would definitely help.

What about recognising something very specific, like "(\d+) portions" in the yield field, and if it matches then on the scale popup, show an additional label with the new portion number? You could show a tip: "Enter yield as x portions for easier scaling" to encourage people to do this, but if they enter free text it'd still work as-is today.

Eg.:

  • if my yield says "2 portions" and I select 4 on the scale poup, show "8 portions"
  • if my yield says "2 dough balls" and I select 4 on the scale popup, just shows "4x 2 dough balls"

This would allow the maths to be done automatically if we stick to the format, but doesn't risk showing anything incorrectly for those that don't. (you could probably even support some additional strings like "portions|person|people" where it's clear they'd work correctly, even if the tip only suggests one of them).

DanTup avatar Oct 25 '24 07:10 DanTup

I also would like to have this feature, and I think it can be done quite simply: just parse the first number in the yield field regardless of what text is after (before) it. I think this number is most likely the number you would like to scale then. Making the number bold would also help detecting problems of course. Showing the yield in the scale modal is also a good idea, together with this feature or if all else fail, on it's own.

PredaGergely avatar Jan 20 '25 22:01 PredaGergely