Fix category handling, recipe management, and dark mode toggle tint

- Map uncategorized category between * (internal) and empty string
  (API) so selecting Sonstige/Other correctly persists to the server
- Default new recipes to Other (*) category and remove None option
- Add "New Category" option to category picker in recipe edit view
- Include newly created/imported recipes in recently viewed list and
  pre-fetch thumbnails so images display immediately
- Remove deleted recipes from recently viewed list
- Remove broad .tint(.primary) from RecipeTabView that caused white
  toggles in Settings during dark mode
- Rename German "Other" translation from Andere to Sonstige
- Add missing translations for Servings stepper and new category strings

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 07:13:01 +01:00
parent 02118e3d7a
commit fb6b16c1fc
7 changed files with 131 additions and 14 deletions

View File

@@ -487,6 +487,8 @@ struct RecipeViewToolBar: ToolbarContent {
let _ = await appState.getRecipe(id: id, fetchMode: .onlyServer, save: true)
// Fetch the image after upload so it displays in view mode
viewModel.recipeImage = await appState.getImage(id: id, size: .FULL, fetchMode: .onlyServer)
// Pre-fetch thumbnail so it's cached for recents and category lists
let _ = await appState.getImage(id: id, size: .THUMB, fetchMode: .onlyServer)
// Update recipe reference so the view tracks the server-assigned id
viewModel.recipe = Recipe(
name: viewModel.observableRecipeDetail.name,
@@ -497,6 +499,7 @@ struct RecipeViewToolBar: ToolbarContent {
imagePlaceholderUrl: "",
recipe_id: id
)
appState.addToRecentRecipes(viewModel.recipe)
}
viewModel.newRecipe = false
viewModel.editMode = false