-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
feat: Recipe Finder (aka Cocktail Builder) #4542
base: mealie-next
Are you sure you want to change the base?
feat: Recipe Finder (aka Cocktail Builder) #4542
Conversation
Finally had the time to glance at this PR 👀 Sidebar IconJust from my first impression i think adding this to the sidebar under Something similar to this is what i had in mind, but this does not feel 100% right. MobileIt seems like this is not yet optimized for mobile. The filter section should probably be above the found recipes instead of keeping the column layout |
I wanted to avoid putting this on the main search page mostly because that page is already super complicated. Also if we wanted to do anything with query params (e.g. save which mode you're in so you could direct link to the cocktail builder) we couldn't do that easily due to how we implement the search page. However if you or I can think of a way to integrate it without it feeling like more bloat I'd be in favor of that. This is the kind of site I was thinking of during implementation: https://www.cocktailbuilder.com/
Good point! I'll get on that |
I’m with you on most of what you said—let’s keep our main page from getting overloaded. 👍 When I first used it, I found the interface a bit tricky. I was adding foods and expecting recipes to pop up right away, but that didn’t happen. I think it would be more user-friendly if the recipe finder displayed recipes as soon as you add your first ingredient, like cocktailbuilder does. Plus, the finder is great because it shows what's missing, letting me skip over recipes I can’t make at the moment. A lot of the recipes I use rely on ingredients I usually have (but have not marked as "on Hand" or can easily substitute, which I don’t always think to add in the recipe finder. Another cool feature would be to make the missing foods clickable (a checkbox probably) to allow the user to easily add them while you’re scrolling through the recipes. |
Yeah this makes sense. Originally I didn't require a suggested recipe to include one of the user's selected foods, so I got a ton of irrelevant results, but that's not a problem anymore. I'll bump up the default number of missing foods/tools, maybe to 20?
Love this |
It's similar to the search where if you add a bunch of foods at once, it's going to call the API every time you add a food. So we want it at least somewhat debounced (e.g. try checking 3-4 foods at once). I'll try turning it down to 500 (that's what the recipe search is at) let me know how you feel about it. |
What type of PR is this?
(REQUIRED)
What this PR does / why we need it:
(REQUIRED)
This PR adds the Recipe Finder. This enables users to find recipes based on particular ingredients.
It has its own sidebar entry:
Including for public users:
Users can select any number of ingredients and we'll match them with recipes they're ready to make or almost ready to make:
As seen above, if a user can almost make something, they can see those recipes as well as a list of foods/tools they're missing.
This is also true for tools:
The user can configure how much leniency they want, or if they want to turn off "almost ready" entirely:
As hinted in the above screenshot, we also consider "on hand" foods/tools when suggesting recipes (unless turned off). For public users these options are set to false (and removed from settings):
Other filters gives you access to a query filter builder, so you can customize what you want (e.g. if you're only looking for cocktails, you can filter by a category):
Which issue(s) this PR fixes:
(REQUIRED)
N/A
Special notes for your reviewer:
(fill-in or delete this section)
The suggestion algorithm exclusively uses the database ORM, so it's very fast. It basically takes your inputs and ranks them against what I think makes sense. Here are the high-level rules (other than the obvious ones):
The order of results is ranked using the following logic:
If any recipes tie using that criteria, we fall back to the user-provided sort (which is
createdAt
; the UI doesn't allow you to customize this, even though the API does).After this PR is merged, there are several improvements I'd like to make. These all require additional work:
Testing
(fill-in or delete this section)
Lots of frontend testing. Added backend tests for the search algorithm.