-
-
Notifications
You must be signed in to change notification settings - Fork 752
Popup Feature for List Food Item #4290
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
Open
lposhni
wants to merge
13
commits into
TandoorRecipes:develop
Choose a base branch
from
lposhni:feature/fetch
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+83
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merging Lena frontend to feature branch
…on the same so it complys w main repo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
New Feature
We implemented a popup screen feature that appears when a user clicks on a food item in the list. This popup displays all recipes that include the selected food item, using an API call to fetch the related recipes. Users can click on a recipe to be redirected to that specific recipe's details.
Context
This change is being made so users can quickly see how a specific food item is used across their recipes without leaving the main food list. It improves discoverability of recipes, helps with planning and ingredient substitution, and keeps the workflow inside a single, consistent UI.
Detailed Description
When a user clicks on a food name in the Food model list, the frontend now opens a dialog showing all recipes that use that food. User can click on the recipes so that they can be redirected to a specific recipe page.
The click handler:
v-dialog.ApiApi().apiRecipeList) with the selected food’s ID and a largepageSizeto retrieve all matching recipes.The dialog can be closed with a button, which clears the selected food and recipe list from local state.
Changes in the Codebase
ModelListPage.vue (Food View)
food-linkspan in theitem.nameslot.selectedFoodshowFoodDialogfoodRecipesloadingFoodRecipesNew Functions
openFoodUsageDialog(food: Food)
ApiApi().apiRecipeList({ food: food.id, pageSize: 350 })
markdown
closeFoodUsageDialog()
goToRecipe()
Styling
No backend changes; uses existing API endpoints.
Additional Information
This feature is intended to be incremental and non-breaking: if the API fails or returns no recipes, the rest of the page still functions normally and the dialog shows a safe fallback message. Basic manual testing has been done for:
Clicking different foods with/without associated recipes
Handling loading and error states
Closing and reopening the dialog
Associated Issue
#4128
Screenshots of new feature
1st Screenshot shows how each element is underlined because it's a link
2nd Screenshot shows what the popup looks like
3rd Screenshot is what is displayed after a recipe has been chosen from the popup