Skip to content

Conversation

@phoneuooyd
Copy link
Owner

This pull request adds support for drag-and-drop reordering and improved management of shopping list items, along with user confirmation dialogs for deleting ingredients and recipes. The changes introduce new converters and properties to support drag-and-drop UI feedback, update the shopping list service and model to maintain item order, and enhance the ViewModel with new commands and drag-and-drop logic.

Drag-and-drop and reordering support:

  • Added IsBeingDragged, IsBeingDraggedOver, and Order properties to the Ingredient model to track drag state and item order. (FoodbookApp.App/Models/Ingredient.cs)
  • Added Order property to ShoppingListItem to persist item order in the database. (FoodbookApp.App/Models/ShoppingListItem.cs)
  • Implemented new value converters (DragStateToColorConverter, DropZoneToColorConverter, DropZoneBorderColorConverter) for drag-and-drop visual feedback. (FoodbookApp.App/Converters/BoolToColorConverter.cs)
  • Updated ShoppingListDetailViewModel to include commands and logic for moving, dragging, and dropping items, and to handle property changes for saving order and state. (FoodbookApp.App/ViewModels/ShoppingListDetailViewModel.cs) [1] [2] [3] [4] [5]

Shopping list service improvements:

  • Modified GetShoppingListWithCheckedStateAsync to merge and order recipe and manually added ingredients, and persist order and quantity changes. (FoodbookApp.App/Services/ShoppingListService.cs) [1] [2]
  • Updated SaveAllShoppingListStatesAsync to save the order and prevent removal of manually added items. Added helper to identify manually added items. (FoodbookApp.App/Services/ShoppingListService.cs)
  • Added RemoveShoppingListItemAsync method to allow removal of individual shopping list items. (FoodbookApp.App/Services/IShoppingListService.cs, FoodbookApp.App/Services/ShoppingListService.cs) [1] [2]

User experience enhancements:

  • Added confirmation dialogs before deleting ingredients and recipes to prevent accidental deletions. (FoodbookApp.App/ViewModels/IngredientsViewModel.cs, FoodbookApp.App/ViewModels/RecipeViewModel.cs) [1] [2]

Implemented drag-and-drop and manual reordering for shopping list items, including new converters, model properties, and commands. Updated ShoppingListDetailViewModel and ShoppingListService to support item order persistence and removal. Unified delete button styles across views and added confirmation dialogs for deletions. Enhanced UI in ShoppingListDetailPage.xaml to support drag handles, drop zones, and visual feedback for reordering.
Enhanced visual feedback for drag-and-drop by adding DropZoneBorderColorConverter and updating drop zone background and border colors. Simplified item creation with an empty name by default. Removed redundant column headers and streamlined XAML for better maintainability and user experience.
Replaced AppThemeBinding-based styling in AddRecipePage.xaml and IngredientFormPage.xaml with simpler, static styles for frames, labels, and entries. Reduced padding and spacing for a more compact layout. Added new image assets: archive.png, redo.png, and save.png.
Replaces text-based action buttons with icon-based buttons (e.g., save, redo) for a more consistent and modern UI across AddRecipePage, IngredientFormPage, MealFormPage, PlannerPage, ArchivePage, RecipesPage, IngredientsPage, and ShoppingListPage. Updates button styling to improve visual consistency and accessibility, and removes redundant edit buttons in some list views in favor of tap gestures.
@phoneuooyd phoneuooyd self-assigned this Aug 28, 2025
@phoneuooyd phoneuooyd merged commit e5cf401 into main Aug 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant