Add option to show quantities next to ingredients in recipe text #91
+40
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to show ingredient quantites with their units next to the ingredients in the recipe text. It also adds a new "Preferences" route and navigation element to toggle the display of this new setting. This is just quickly added by me to use the feature at all, this may need a seperate issue to handle how preferences are accessed. The new option is also saved to local storage and retrieved if found.
I think this change is very useful for recipes where you need the same ingredient multiple times. Consider a recipe of mine where I need 225g of butter in the beginning and then later at a different step I need 115g again. In the recipe listing, these are two different entries:
But in the recipe itself, I have no way of differentiating which quantity of "butter" is supposed to be used without writing it manually (which would clash with serving size scaling). With the PR, the text now shows the unit size with the ingredient itself:
And for completeness, this is the preferences pane:
