feat: collections overhaul — reorder, search, edit/delete, tags (v0.53.0)

Seven related improvements to collections:

- Drag-and-drop reorder (dnd-kit, same pattern as the shopping list) — new
  collection_recipes.position column (migration 0049, backfilled from
  existing added_at order so nothing jumps around on upgrade).
- Search collections by name/description (server-side, list page) and
  search recipes within a collection (client-side filter, already loaded).
- Edit collection: name/description/tags/private notes via a new dialog;
  new collections.notes + collections.tags columns.
- Delete collection with a choice to also delete its recipes — only ones
  the deleting user actually owns, never recipes shared in by others.
- Collection detail (both owner and public view) now renders the same
  RecipeGridCard used on /recipes, instead of the older, plainer RecipeCard.
- Collection list cards redesigned — photo-collage preview (first 4 recipe
  covers/placeholders), tag badges, cleaner layout.
- Fixed the recipe count shown on a collection card: the query capped the
  `recipes` relation at 1 for thumbnail purposes and then read `.length`
  off that same capped array, so it never showed more than 1. Now a
  proper grouped count query, separate from the thumbnail fetch.

New/changed endpoints documented in OpenAPI: PATCH /collections/{id}/reorder,
DELETE /collections/{id}?deleteRecipes, PUT /collections/{id}'s new
notes/tags fields.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-19 18:44:08 +02:00
parent 5403a06348
commit e8c687e53a
19 changed files with 6300 additions and 82 deletions
+18
View File
@@ -1176,6 +1176,10 @@
"empty": "No collections yet",
"emptyDescription": "Group your recipes by theme, occasion, or however makes sense to you.",
"emptyCollection": "No recipes in this collection yet.",
"searchPlaceholder": "Search collections…",
"noSearchResults": "No collections match your search",
"searchRecipesPlaceholder": "Search recipes in this collection…",
"noRecipeSearchResults": "No recipes match your search",
"public": "Public",
"recipeCount": "{count} recipe",
"recipeCountPlural": "{count} recipes",
@@ -1209,6 +1213,20 @@
"removeFromCollectionFailed": "Failed to remove from collection",
"removeFromCollectionConfirmTitle": "{count, plural, one {Remove 1 recipe from this collection?} other {Remove {count} recipes from this collection?}}",
"removeFromCollectionConfirmDescription": "The recipe itself won't be deleted, just removed from this collection.",
"reorderFailed": "Failed to save the new order",
"editTitle": "Edit collection",
"editSuccess": "Collection updated",
"editFailed": "Failed to update collection",
"saving": "Saving…",
"notesLabel": "Notes",
"notesPlaceholder": "Private notes about this collection — only you see these.",
"tagsLabel": "Tags",
"deleteSuccess": "Collection deleted",
"deleteFailed": "Failed to delete collection",
"deleteConfirmTitle": "Delete this collection?",
"deleteConfirmDescription": "This removes the collection. Recipes in it stay untouched unless you check the box below.",
"deleteRecipesToo": "Also delete the recipes in this collection (only ones you own — nothing shared by others is touched)",
"deleting": "Deleting…",
"generateMeal": "Generate meal",
"generateMealTitle": "Generate a complete meal",
"generateMealDescription": "AI generates one recipe per course, all matching the same theme, and adds them to this collection.",