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
@@ -86,8 +86,8 @@ fun JournalScreen(
|
||||
) {
|
||||
var showDietaryGuide by remember { mutableStateOf(false) }
|
||||
|
||||
val customCategoryLookup = remember(customFoods) {
|
||||
customFoods.associate { it.name.lowercase(Locale.FRENCH).trim() to it.resolvedCategory() }
|
||||
val customCategoriesLookup = remember(customFoods) {
|
||||
CustomFoodEntry.buildCategoriesLookup(customFoods)
|
||||
}
|
||||
|
||||
Box(
|
||||
@@ -151,7 +151,7 @@ fun JournalScreen(
|
||||
item {
|
||||
DailyBenchmarksCard(
|
||||
todayMeals = todayMeals,
|
||||
customCategoryLookup = customCategoryLookup,
|
||||
customCategoriesLookup = customCategoriesLookup,
|
||||
onOpenGuideClick = { showDietaryGuide = true }
|
||||
)
|
||||
}
|
||||
@@ -221,7 +221,7 @@ fun JournalScreen(
|
||||
items(meals, key = { it.id.ifEmpty { it.mealTimestamp.toString() } }) { meal ->
|
||||
MealCardItem(
|
||||
meal = meal,
|
||||
customCategoryLookup = customCategoryLookup,
|
||||
customCategoriesLookup = customCategoriesLookup,
|
||||
onEdit = { onEditMeal(meal) },
|
||||
onDelete = { onDeleteMeal(meal.id) }
|
||||
)
|
||||
@@ -353,7 +353,7 @@ private fun DailyOverviewCard(todayMeals: List<MealEntry>) {
|
||||
@Composable
|
||||
private fun MealCardItem(
|
||||
meal: MealEntry,
|
||||
customCategoryLookup: Map<String, FoodCategory>,
|
||||
customCategoriesLookup: Map<String, List<FoodCategory>>,
|
||||
onEdit: () -> Unit,
|
||||
onDelete: () -> Unit
|
||||
) {
|
||||
@@ -551,7 +551,7 @@ private fun MealCardItem(
|
||||
parsedFoods.forEach { food ->
|
||||
FoodCategoryBadge(
|
||||
text = food.displayBadge(),
|
||||
category = food.resolvedCategory(customCategoryLookup)
|
||||
categories = food.resolvedCategories(customCategoriesLookup)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user