Add shopping lists for cooking and crafting pages#159
Conversation
- Hide the functionality with the feature gate - Extract the filtering logic to utils - Reurse the same filtering/composing logic on both pages - Use shared layout for ingredients list on both pages
|
@bozheville is attempting to deploy a commit to the stardew Team on Vercel. A member of the Team first needs to authorize it. |
|
As you noted, this is very similar to what I did in #157. It looks like the main differences are:
You also seem to have a better handling of React features than I do (been a while since I've done web dev). |
|
@FracturedShader you are right, except for one: I do sort ingredients; not by name though -- I sort by number of needed ingredients. The idea is if you need 8 eggs -- it comes before one midnight carp.
The rest is correct. I didn't to recursive ingredients on purpose. For example you need hashbrowns for dish o' the sea. You don't need two potatoes to cook both. You need one: cook hashbrowns -> add sardines, cook dish o' the sea. Same for the bread and bruschetta. But I do agree that my implementation is less functional :) What if I reduce the PR to just have the feature gate, and then we will merge all the functionality both of us implemented? So after we're done -- we open the gate. |
|
Oops, was tracking field indices in my head and just assumed by-name. My bad! That's a good point on recursion though. You don't need to ship each recipe for it to count, just craft it. That would mean you only need one potato to support the chain of recipes. That makes the need for recursive expansion context dependent. I can't think of any set of recipes that violates the single chain nature (e.g. no two recipes need fried egg), but I don't know for sure. That sounds like a good plan. I'm torn about the best way to sort things. Alphabetically will make scanning through the list easy to do consistently, but you already have full text search. I can add the list-specific features into mine with you as a co-author (text search and sorting). Would you be able to add the feature-gating aspect after I've done that? It might be good to poll a few people on their expectations for how the list would function and any assumed defaults as well. Your feature-gated deployment approach would be a good way to do that. |
|
Absolutely yes! I am good to integrate the feature gate after you merge your changes. Do you mean integrating the core feature through the feature gate or updating the feature using feature gates? Both ways are good, just trying to understand :) |
|
Updating the feature using the gate. Let me see if I can grant you push access to my fork to make that easier. It looks like the changes would primarily be:
Quick aside: I did discover that Hashbrowns are used by more than one recipe. I'm just about to push my changes to https://github.com/FracturedShader/stardew.app/tree/feature/ingredients-lists, so you should be able to grab them in a few minutes. |

Description
Add the lists of all the ingredients needed for crafting/cooking all the selected recipes.
Demo
Hard changes
bundleItemNamefunction andcategoryItemslist to utils.Soft changes
cooking-ingredientsquery parameter.crafting-ingredientsquery parameter.QA hints
Scenario 1
Check the default behaviour -- no changes expected
Scenario 2
?cooking-ingredients=1query parameter -- the ingredients list should appear and only show ingredients for the recipes appearing on the page right now.?crafting-ingredients=1query parameter -- the ingredients list should appear and only show ingredients for the recipes appearing on the page right now.Scenario 3
Global rollout
cooking-ingredientsorcrafting-ingredientsor both feature gates.cooking-ingredients=0orcrafting-ingredients=0query parameter of the relevant page to disable the experimental component.Suggested rollout strategy
cooking-ingredientsandcrafring-ingredientsquery parameters