Commit Graph

164 Commits

Author SHA1 Message Date
285e91a429 Fix meal plan removal ignored on first attempt after app launch
Guard reconcileFromServer() with a syncStartTime so that entries
modified locally during an active performSync() cycle are never
overwritten by stale server data. This prevents the race condition
where a user removes a meal plan entry while Phase 2 of sync is
still iterating server recipes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 11:54:13 +01:00
1f7f19c74b Fix meal plan not populating on first login and add pull-to-refresh sync
Rewrite MealPlanSyncManager.performSync() (renamed from performInitialSync) to
discover _mealPlanAssignment metadata from all server recipes, not just locally-
known ones. On first sync all recipes are checked; on subsequent syncs only
recipes modified since lastMealPlanSyncDate are fetched (max 5 concurrent).

Trigger meal plan sync from pull-to-refresh on both the recipe and meal plan
tabs, and from the "Refresh all" toolbar button.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 11:40:31 +01:00
c8d9ab7397 Consolidate onboarding into single login page with native styling and full localization
Merge the two-page welcome/login flow into a single page with the app icon,
title, subtitle, and login inputs all on one screen. Replace the custom blue
background and white-on-blue styling with native iOS system colors and
button styles. Add missing translations (de, es, fr) for all onboarding
strings and fix localization by using LocalizedStringKey and String(localized:).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 10:44:51 +01:00
ce2a814e5a Add Share Extension for importing recipes via URL
Adds a Share Extension so users can share URLs from Safari (or any app)
to open the main app with the ImportURLSheet pre-filled. Uses a custom
URL scheme (nextcloud-cookbook://) as the bridge between the extension
and the main app.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 10:17:22 +01:00
151e69ff28 Avoid reusing category thumbnail images in all recipes preview mosaic
Track which recipe IDs are used as category thumbnails and prefer
different images for the all recipes 2x2 mosaic, falling back to
category thumbnails only when not enough other images are available.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 07:52:18 +01:00
5307b502e9 Add category and recipe sorting with multiple modes and order inversion
Categories on the main page can be sorted by Recently Used, Alphabetical,
or Manual (drag-to-reorder). The sort menu appears inline next to the
Categories header. All Recipes is included in the sort order and manual
reorder sheet. Recipes within category and all-recipes lists can be sorted
by Recently Added or Alphabetical, with the sort button in the toolbar.
All non-manual sort modes support order inversion via a Reverse/Default
Order toggle. Date parsing handles both formatted strings and Unix
timestamps, with recipe_id as fallback when dates are unavailable.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 07:46:23 +01:00
fb6b16c1fc 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>
2026-02-15 07:13:01 +01:00
02118e3d7a Add dark mode support with appearance picker and fix hardcoded colors
Add user-facing appearance setting (System/Light/Dark) wired via
preferredColorScheme at the app root. Replace hardcoded .black tints
and foreground styles with .primary so toolbar buttons and text remain
visible in dark mode. Remove profile picture from settings and
SwiftSoup from acknowledgements.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 06:31:14 +01:00
c38d4075be Fix grocery sync deletions not persisting and Reminders race condition
Stop cascading syncs by adding an isReconciling flag so that
reconcileFromServer no longer triggers scheduleSync via addItem/deleteItem.
Make Reminders write-only by removing the diff/sync logic from the
onDataChanged callback. Fetch fresh server state in RecipeView reconcile
instead of using stale local cache. Track pending removal recipe IDs via
DataStore so performInitialSync can push deletions for recipes whose
grocery keys have already been removed from groceryDict.

Fix a race condition in RemindersGroceryStore where EKEventStoreChanged
notifications triggered load() before saveMappings() finished writing to
disk, causing the correct in-memory state to be overwritten with stale
data. Add ignoreNextExternalChange flag to skip self-triggered reloads.

Restyle the add/remove all grocery button to match the Plan recipe button
style using Label, subheadline font, and rounded rectangle background.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 06:04:41 +01:00
8b23652f10 Add meal plan feature with cross-device sync and automatic stale data cleanup
Introduces weekly meal planning with a calendar-based tab view, per-recipe
date assignments synced via Nextcloud Cookbook custom metadata, and 30-day
automatic pruning of old entries on load, save, and sync merge.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 05:23:29 +01:00
5890dbcad4 Add cross-device grocery list sync via Nextcloud Cookbook API
Store a _groceryState JSON field on each recipe to track which
ingredients have been added, completed, or removed. Uses per-item
last-writer-wins conflict resolution with ISO 8601 timestamps.
Debounced push (2s) avoids excessive API calls; pull reconciles
on recipe open and app launch. Includes a settings toggle to
enable/disable sync.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 04:14:02 +01:00
501434bd0e Redesign ingredient list with swipe-to-add grocery action and add-all button
Remove checkbox icons and tap-to-select state from ingredient items. Replace
with bullet points and a small green cart indicator for items already in the
grocery list. Add a full-width "Add All to Grocery List" / "Remove from
Grocery List" button below ingredients. Swipe right on individual ingredients
shows a rounded green/red cart icon to add/remove single items.

Add DE/ES/FR translations for new grocery list button strings.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 03:44:00 +01:00
1536174586 Redesign recipe creation and edit view with Form-based layout and URL import
Replace the single "+" button with a 2-option menu (Create New Recipe / Import
from URL) across RecipeTabView, RecipeListView, and AllRecipesListView. Add
ImportURLSheet for server-side recipe import with loading and error states.

Completely redesign edit mode to use a native Form layout with inline editing
for all sections (metadata, duration, ingredients, instructions, tools,
nutrition) instead of the previous sheet-based EditableListView approach. Move
delete action from edit toolbar to view mode context menu. Add recipe image
display to the edit form.

Refactor RecipeListView and AllRecipesListView to use closure-based callbacks
instead of Binding<Bool> for the create/import actions. Add preloadedRecipeDetail
support to RecipeView.ViewModel for imported recipes.

Add DE/ES/FR translations for all new UI strings.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 03:29:20 +01:00
98c82dc537 Add Apple Reminders integration for grocery list with local mapping persistence
Introduce a GroceryListManager facade that delegates to either the existing
in-app GroceryList or a new RemindersGroceryStore backed by EventKit. Users
choose the mode in Settings; when Reminders mode is active the Grocery List
tab is hidden. Recipe-to-reminder grouping uses a local mapping file
(reminder_mappings.data) instead of polluting the reminder's notes field,
with automatic pruning when reminders are deleted externally.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 02:54:52 +01:00
6824dbea6b Fix settings page dismissing immediately by replacing multiple isPresented navigation destinations with value-based NavigationPath
The settings view was being popped immediately after push because multiple
navigationDestination(isPresented:) modifiers on the same view caused SwiftUI
to reset bindings when appState published changes. Replaced with a single
navigationDestination(for: SidebarDestination.self) using an explicit
NavigationStack(path:). Also fixed @ObservedObject -> @StateObject on
SettingsView.ViewModel, added AllRecipesListView/AllRecipesCategoryCardView,
and added translations for new strings.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 02:20:38 +01:00
c8ddb098d1 Redesign search tab, add category cards, recent recipes, and complete German translations
Overhaul SearchTabView with search history, empty/no-results states, and dynamic
navigation title. Extract CategoryCardView and RecentRecipesSection into standalone
views. Update RecipeTabView, RecipeListView, RecipeCardView, and MainView for the
modernized UI. Add all 12 missing German translations in Localizable.xcstrings.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 01:47:16 +01:00
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
527acd2967 Raise deployment target to iOS 18 and modernize SwiftUI APIs
Adopt modern SwiftUI patterns now that the minimum target is iOS 18:
NavigationStack, .toolbar, .tint, new Tab API with sidebarAdaptable
style, and remove iOS 17 availability checks. Add Liquid Glass effect
support for iOS 26 in TimerView and fix an optional interpolation
warning in AppState.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 23:14:57 +01:00
VincentM
512d534edf Update README.md 2024-10-29 13:44:16 +01:00
VincentM
c4be0e98b9 Merge pull request #25 from VincentMeilinger/1.10.1
Recipe decoding fixes
2024-05-05 10:35:13 +02:00
VincentMeilinger
b66ef63b6a Recipe decoding fixes 2024-05-05 10:33:33 +02:00
VincentM
b4b6afb45a Update README.md 2024-04-23 17:10:26 +02:00
VincentM
d6cfa6b01d Update README.md 2024-03-26 18:21:28 +01:00
VincentM
498ed0d8ff Merge pull request #21 from VincentMeilinger/1.10
1.10
2024-03-26 18:18:35 +01: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
VincentM
1c0c10957c Update README.md 2024-03-10 18:17:38 +01:00
VincentM
53ee76a4c6 Update README.md 2024-03-10 18:16:45 +01:00
VincentM
7195f5a7e8 Merge pull request #20 from VincentMeilinger/1.9.1
1.9.1
2024-03-10 18:13:40 +01:00
VincentMeilinger
f495449368 Minor UI adjustemnts 2024-03-10 18:11:57 +01:00
VincentMeilinger
da30c11e50 Updated README.md with a roadmap of upcoming features 2024-03-10 18:10:36 +01:00
VincentMeilinger
31a796e8a4 Added localization for success alerts 2024-03-10 16:06:47 +01:00
VincentMeilinger
d6caa18578 Minor bug fix 2024-03-10 16:00:26 +01:00
VincentMeilinger
5d82cdf0c2 Fixed a crash due to a race condition in RecipeListView 2024-03-10 12:50:42 +01:00
VincentMeilinger
2c749754f4 Bug fixes and UI polish 2024-03-10 11:56:51 +01:00
VincentMeilinger
29872611da Fixed: edited recipes were not saved locally 2024-03-08 17:45:26 +01:00
VincentMeilinger
dbe626d595 Bug fixes and UI polish 2024-03-07 19:09:39 +01:00
VincentMeilinger
92decb773e Recipe edit view fixes 2024-03-05 22:07:51 +01:00
VincentMeilinger
11359e11d4 Recipe edit view polish 2024-03-05 21:42:02 +01:00
VincentMeilinger
b5dbaad9aa Recipe edit UI polish 2024-03-05 08:39:06 +01:00
VincentMeilinger
597477544d Creating and updating recipes works in the new edit view 2024-03-04 11:58:16 +01:00
VincentMeilinger
aa45bbdbd8 Improved Recipe Editing 2024-03-01 17:35:12 +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
VincentMeilinger
d3e0366ce6 New Recipe Edit View 2024-02-18 12:25:18 +01:00
VincentMeilinger
e88f1d329d hotfix 2024-02-07 20:07:03 +01:00
VincentMeilinger
b39ca5e29f version number update 2024-02-04 16:49:56 +01:00