mirror of
https://github.com/bleackstorm/satiea.git
synced 2026-12-03 07:41:56 +01:00
feat: implement weekly meal planning and inventory
- Add Planning module with UI and ViewModel - Update database schema to support planned meals and inventory - Add camera permission for future features - Refactor food category handling to support multiple tags
This commit is contained in:
1 parent
1331fae119
commit
8e794e6da7
46 files changed
+6335
-192
No files matched your search
@@ -104,8 +104,8 @@ fun RecipesScreen(
|
||||
var selectedTag by rememberSaveable { mutableStateOf<String?>(null) }
|
||||
var cravingNote by rememberSaveable { mutableStateOf("") }
|
||||
|
||||
val customCategoryLookup = remember(customFoods) {
|
||||
customFoods.associate { it.name.lowercase(Locale.FRENCH).trim() to it.resolvedCategory() }
|
||||
val customCategoriesLookup = remember(customFoods) {
|
||||
CustomFoodEntry.buildCategoriesLookup(customFoods)
|
||||
}
|
||||
|
||||
val filteredRecipes = remember(recipes, searchQuery, selectedTag) {
|
||||
@@ -357,7 +357,7 @@ fun RecipesScreen(
|
||||
items(filteredRecipes, key = { it.id }) { recipe ->
|
||||
RecipeCardItem(
|
||||
recipe = recipe,
|
||||
customCategoryLookup = customCategoryLookup,
|
||||
customCategoriesLookup = customCategoriesLookup,
|
||||
onClick = { onRecipeClick(recipe) }
|
||||
)
|
||||
}
|
||||
@@ -390,13 +390,13 @@ fun RecipesScreen(
|
||||
@Composable
|
||||
private fun RecipeCardItem(
|
||||
recipe: RecipeEntry,
|
||||
customCategoryLookup: Map<String, FoodCategory>,
|
||||
customCategoriesLookup: Map<String, List<FoodCategory>>,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
val isDark = isSatieaDarkTheme()
|
||||
val ingredients = remember(recipe.ingredientsSerialized) { recipe.parsedIngredients() }
|
||||
val dominantCategories = remember(recipe.ingredientsSerialized, customCategoryLookup) {
|
||||
recipe.dominantCategories(customCategoryLookup).take(4)
|
||||
val dominantCategories = remember(recipe.ingredientsSerialized, customCategoriesLookup) {
|
||||
recipe.dominantCategories(customCategoriesLookup).take(4)
|
||||
}
|
||||
|
||||
Card(
|
||||
|
||||
Reference in new issue
Block a user