feat: nutrition tracking#853
Open
johannesvedder wants to merge 59 commits into
Open
Conversation
feat: foundation of nutritional intake
…m and app widget.
…recall and meal entry screens and add Map parsing to the Answer model.
… and refine nutrition task result loading with dependency updates.
feat: nutrition question
…forms, screens, and models.
… selection cards and separate lists for surveys and nutrition tasks.
…d enable/disable logic in the measurements form.
…zation and form fields.
… fields based on view model state.
…lEntryScreen, adding task-specific submission logic and result handling.
- Refactor Daily Recall logic into NutritionTaskWidget and DailyRecallEntryViewModel - Localize MealEntryScreen and FoodEntryScreen - Add localization keys to app_en.arb and generate AppLocalizations - Remove obsolete buttons and clean up UI
…rman localization, and refactor color alpha application.
…alculations, and refine ViewModel listener management.
…ving, viewing, and selection.
- Add USDA FoodData Central API integration (usda_api_service.dart) - Integrate barcode scanning via mobile_scanner (barcode_scanner_screen.dart) - Add dual-API food search (food_search_screen.dart - OpenFoodFacts + USDA) - Merge new dependencies: http ^1.2.2, mobile_scanner ^7.1.4, openfoodfacts ^3.21.0 - Add camera permissions for Android/iOS barcode scanning - Maintain nutrition observation autosave and core ViewModel architecture - Keep localized UI strings over hardcoded API branch versions - Add search icon to food_entry_screen.dart for quick food lookup Conflict resolution strategy: - Removed duplicate DailyRecallEntryScreen (kept superior ViewModel pattern) - Retained NutritionTaskWidget.route() for navigation (ViewModel integration) - Combined localized labels with new search functionality - Preserved autosave manager and study subject integration
…n-observation merge: api integration nutrition observation
Resolved conflict in food_entry_screen.dart: - Kept both search button (from nutrition-observation) and template save button (from template-meals) - Combined imports from both branches - AppBar now shows both action buttons for search and save-as-template functionality
feat: nutrition observation
…egration and dynamically setting app bar titles for add/edit.
- **UI/UX Enhancements**: - Overhauled `NutritionTaskWidget`, `MealEntryScreen`, `FoodEntryScreen`, and `RecipeBuilderScreen` with a modern, card-based layout using Material 3 design principles. - Improved visual hierarchy with consistent iconography, refined spacing, and better use of theme-based surface colors. - Redesigned the food search interface with auto-focus, better loading states, and a new "Quick Actions" section. - Added formatted time and date displays to improve readability in the recall diary. - **Refactor & Cleanup**: - Simplified `DailyRecallEntryViewModel` by removing redundant update methods and consolidating state management. - Extracted multiple private sub-widgets in nutrition screens to improve code maintainability and separation of concerns. - Standardized localizations and theme usage across the nutrition module. - Cleaned up unused imports and simplified navigation logic in the barcode scanner and food search screens. - **Infrastructure**: - Updated `mobile_scanner` to version 7.0.0. - Added comprehensive AI coding rules for the project in `CLAUDE.md`.
- Improve dropdown styling using `isDense: true`, `isExpanded: true`, and `TextOverflow.ellipsis` to prevent layout issues. - Update `description` text field to support variable heights (`minLines: 1`, `maxLines: 2`). - Fix minor indentation in `carbsController` field.
… update designer forms for various task types.
- Pass NutritionTask to MealEntryScreen so settings are available at entry time - collectMealContext: hide meal context/company/distraction fields when disabled; skip toggle always shown - allowRecipes: suppress Create Recipe tile and recipe templates in FoodSearchScreen when disabled - minimumMealsRequired: enforce via PopScope confirmation dialog on back navigation; show current/minimum progress chip in meals header - customMealTypes: render researcher-defined chips in MealTypeSelector instead of default MealType enum - Designer: add customMealTypes FormArray with dynamic add/remove UI in nutrition form - Designer: add min(1) validation on minimumMealsRequired for publish/test sets - Designer: fix default title hardcoded string — use translation key - i18n: add EN/DE keys for min_meals_not_met_title, min_meals_not_met_message, leave_anyway, customMealTypes labels
refactor(analyze-food-image): remove unused imports from index.ts and clean up deno.json
22224c7 to
03203bf
Compare
529576c to
bd5d5bd
Compare
|
Visit the preview URL for this PR (updated for commit 10e6c9f):
(expires Thu, 02 Jul 2026 23:09:27 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 2149dad49ed83535217e50d5c18c0c8c90da629b |
# Conflicts: # app/lib/l10n/app_de.arb # app/lib/l10n/app_en.arb # app/lib/l10n/app_localizations.dart # app/lib/l10n/app_localizations_de.dart # app/lib/l10n/app_localizations_en.dart # app/lib/widgets/questionnaire/question_container.dart # app/lib/widgets/questionnaire/questions/date_question_widget.dart # core/lib/src/models/questionnaire/answer.dart # core/lib/src/models/questionnaire/questions/date_question.dart # core/lib/src/models/questionnaire/questions/date_question.g.dart # core/lib/src/models/questionnaire/questions/questions.dart # designer_v2/lib/features/design/measurements/measurements_form_controller.dart # designer_v2/lib/features/design/shared/questionnaire/question/question_form_controller.dart # designer_v2/lib/features/design/shared/questionnaire/question/question_form_data.dart # designer_v2/lib/features/design/shared/questionnaire/question/types/date_question_form_view.dart # designer_v2/lib/features/design/shared/questionnaire/question/types/question_type.dart
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
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.
Summary
Test Plan