Merged
Conversation
Introduces caching for ingredients in IngredientService and AddRecipeViewModel to reduce database calls and improve performance. Adds cache invalidation after ingredient modifications and debounced nutritional value calculations to prevent redundant computations during rapid changes. Updates AddRecipePage to use debounced async recalculation, and refactors related methods to leverage the new caching and debouncing mechanisms.
Introduces async database migration and reset logic in MauiProgram and exposes them via new commands in SettingsViewModel. Updates SettingsPage UI to provide migration and reset controls with status feedback, adds related styles, and integrates new converters. Also improves AddRecipeViewModel validation and logging, and minor style/color resource updates.
Updated BoolToColorConverter to provide theme-aware colors for text, borders, and backgrounds, supporting both light and dark modes. Refactored AddRecipePage.xaml and IngredientFormPage.xaml to use a modern tab bar style with underline indicators, improved color handling, and increased tab button font size for better usability and visual consistency.
Replaced the default SearchBar on IngredientsPage and RecipesPage with a custom modern search bar using Frame, Entry, and a clear button. Added new styles for the modern search bar components in Styles.xaml. Introduced ClearSearchCommand in both IngredientsViewModel and RecipeViewModel to support clearing the search text.
Introduced a reusable FloatingActionButton style in Styles.xaml and replaced the top action buttons on IngredientsPage and RecipesPage with floating action buttons. Updated the RecipesPage code-behind to remove the now-unnecessary OnAddRecipeClicked handler, switching to command-based navigation for consistency.
Introduced reusable styles for list items, nutrition info, and delete buttons in Styles.xaml. Refactored IngredientsPage.xaml and RecipesPage.xaml to use these styles, improving visual consistency and maintainability across the app.
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.
This pull request introduces significant improvements to the application's database reliability, data seeding performance, and UI theming. The most notable changes include the addition of robust database migration and schema validation logic, batching for ingredient seeding, theme-aware color logic in converters, and new value converters for UI binding. Below are the most important changes grouped by theme:
Database Migration, Validation, and Seeding Improvements
MauiProgram.cs, including logic to validate table schemas, add missing columns, manage schema versions, and apply migrations safely. This ensures the database structure is always up-to-date and resilient to schema drift. [1] [2]SeedData.csby batching inserts for better performance and UI responsiveness, and improved logging for batch progress and errors.UI and Theming Enhancements
BoolToColorConverterto provide theme-aware color responses for various UI elements, including text, tab backgrounds, and borders, ensuring consistent appearance in both light and dark modes.SecondaryDark, to the color resources for improved dark mode support.Converters and Styles
IsNotNullOrEmptyConverterfor use in XAML bindings, and registered multiple converters inStyles.xamlfor streamlined UI development. [1] [2]