Commit Graph

11 Commits

Author SHA1 Message Date
7c824b492e Modernize networking layer and fix category navigation and recipe list bugs
Network layer:
- Replace static CookbookApi protocol with instance-based CookbookApiProtocol
  using async/throws instead of tuple returns
- Refactor ApiRequest to use URLComponents for proper URL encoding, replace
  print statements with OSLog, and return typed NetworkError cases
- Add structured NetworkError variants (httpError, connectionError, etc.)
- Remove global cookbookApi constant in favor of injected dependency on AppState
- Delete unused RecipeEditViewModel, RecipeScraper, and Scraper playground

Data & model fixes:
- Add custom Decodable for RecipeDetail with safe fallbacks for malformed JSON
- Make Category Hashable/Equatable use only `name` so NavigationSplitView
  selection survives category refreshes with updated recipe_count
- Return server-assigned ID from uploadRecipe so new recipes get their ID
  before the post-upload refresh block executes

View updates:
- Refresh both old and new category recipe lists after upload when category
  changes, mapping empty recipeCategory to "*" for uncategorized recipes
- Raise deployment target to iOS 18, adopt new SwiftUI API conventions
- Clean up alerts, onboarding views, and settings

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 00:47:28 +01:00
VincentMeilinger
b66ef63b6a Recipe decoding fixes 2024-05-05 10:33:33 +02:00
VincentMeilinger
6ae9926c41 Code cleanup, translations, show empty categories 2024-03-26 18:13:24 +01:00
VincentMeilinger
d201690332 UI bug fixes (regarding recipe servings adjustment) 2024-03-22 14:31:45 +01:00
VincentMeilinger
7b59c79222 Number formatting settings, recipe ingredient amount calculation 2024-03-20 08:53:58 +01:00
VincentMeilinger
054e222d8e Adjustable recipe ingredient amount 2024-03-18 09:09:49 +01:00
VincentMeilinger
eae72eb0ce Basic ingredient amount adjustment 2024-03-11 20:07:50 +01:00
VincentMeilinger
dbe626d595 Bug fixes and UI polish 2024-03-07 19:09:39 +01:00
VincentMeilinger
b5dbaad9aa Recipe edit UI polish 2024-03-05 08:39:06 +01:00
VincentMeilinger
650df2b67e Updated Duration Picker during Recipe Editing 2024-03-01 15:32:04 +01:00
VincentMeilinger
744ea76a34 Updated RecipeView 2024-03-01 14:17:24 +01:00