Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ability to Have Range of Serving Sizes #598

Open
arsocha opened this issue Feb 18, 2021 · 5 comments
Open

Add Ability to Have Range of Serving Sizes #598

arsocha opened this issue Feb 18, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@arsocha
Copy link

arsocha commented Feb 18, 2021

Is your feature request related to a problem? Please describe.
In my experience, the serving size field only accepts a single integer value. Many recipes have ranges of expected servings based on a variety of factors. When I try to put in a range (e.g. 12-18) the results defaults to "1".

Describe the solution you'd like
Allow the "serving size" field to accept a range of serving sizes. (Solution potentially in the form of changing to a text field?)

Describe alternatives you've considered
If I would like a range I currently just put this in the description as a note, but a more flexible serving size field would be more convenient.

@arsocha arsocha added the enhancement New feature or request label Feb 18, 2021
@seyfeb
Copy link
Collaborator

seyfeb commented Feb 18, 2021

Just to clarify: You mean the number of servings (recipe yield) and not the "serving size" (which is part of the nutrion information and means the size of a single serving (mass or volume)). In the second case there is a text input field, so I’m pretty sure you mean the first.

Looking at the schema.org definition for a recipe which we are following here, a text input seems to be fine, so this could be changed.

@arsocha
Copy link
Author

arsocha commented Feb 20, 2021

Hi @seyfeb, thanks for the follow-up question. I am indeed talking about the number servings (recipe yield) and not the nutrition information.

e.g.
image

One question on my end though is I wonder if there are any requested features (or things in progress) that would benefit from a numeric field for recipe yield? I was thinking about it more and I could see how people might want to be able to change the # of servings and get automatically updated recipe inputs.

I don't if there is a way to get the best of both worlds or perhaps if automatic adjustment features in the future could try and guess based on text input (e.g. 1st numeric value in a string?)

@seyfeb
Copy link
Collaborator

seyfeb commented Feb 20, 2021

Indeed, there is #116 where multiplying ingredient quantities was requested, although this has more (actually kind of the same) problems as the number (or text) of the servings field .

@christianlupus
Copy link
Collaborator

In general, parsing is hard as we are talking of natural language. Different languages have different grammars and even different measure systems (see e.g. the American system of fractions of cups (2 3/4 cups) vs the European system of using liter and decimal fractions of it (0.5l)).

I have a suggestion to keep this at bay:
We define a range to save the 12 to 16 servings in the real JSON as suggested. In an extension (will require #340) we can specify an exact number that the recipe will serve (a mean value). Once the UI detects that a non-literal number is typed, a new field is shown to let the user specify this average serving number that could be used for further calculations.

Would that work?

@arsocha
Copy link
Author

arsocha commented Mar 4, 2021

@christianlupus thanks for the reply! I certainly get that a text-parsing solution would probably be difficult, messy, and insufficient flexibility needed across languages - just a first pass thought.

I also read through #340 and won't pretend to understand all the technical detail. If the proposed re-definition as a defined range via JSON is feasible then I am all for if in your estimation it doesn't trade one feature for another set of challenges.

Not quite sure how I can help otherwise given my lack of technical skills in this arena but happy to try if there is anything I can do on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants