El bug de los pasos 5 y 6 era invisible a los tests unitarios: el contrato de
datos estaba bien, lo que fallaba era que la vista se desmontaba antes de pintar
el aha moment y el paywall. Hace falta recorrer la UI de verdad.
Anade el target MealMoodUITests (solo simulador, sin firma) y un test que hace
el onboarding entero en instalacion limpia y comprueba que Week Ready y el
paywall aparecen antes de la Home.
Los CTA del onboarding llevan ahora accessibilityIdentifier para que el test no
dependa de los textos, que estan en 6 idiomas.
Validado en los dos sentidos: pasa con el fix, y revirtiendo temporalmente
markFinished: false falla en la asercion de Week Ready. Suite completa: 27 tests.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ks8uUcMA9mjypVK7F2Pkt
El archive con firma automática no podía incluir la capability Push de
forma headless. Se pasan los targets MealMood y MealMoodWidget (config
Release) a firma manual con "Apple Distribution" y sus perfiles AppStore
(regenerados con Push). Build 63 sube a TestFlight con aps-environment
production para el sync CloudKit en tiempo real.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A3HaWmmtTQ1vdTERtSYU6p
NSPersistentCloudKitContainer solo sincronizaba de forma oportunista (sin
push), por lo que un plato nuevo tardaba mucho o no aparecía en el otro
dispositivo. Se activa el push de CloudKit:
- aps-environment en MealMood.entitlements vía variable APS_ENVIRONMENT
(development en Debug, production en Release) para no romper TestFlight.
- AppDelegate con registerForRemoteNotifications() + manejo del push
silencioso; el mirror de SwiftData importa al ser despertado.
- (Capability Push Notifications habilitada en el App ID por API.)
Pendiente: regenerar el provisioning profile AppStore con Push antes de
la build 63, y validar el sync push en iPhone+iPad vía TestFlight.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A3HaWmmtTQ1vdTERtSYU6p
- Dictado por voz (Speech/SFSpeechRecognizer, on-device) en el nombre de
plato y en ingredientes, con transcripción en vivo.
- Un solo texto dictado se separa en ingredientes individuales vía Apple
Foundation Models on-device (IngredientParser), con fallback heurístico.
- Permisos de micrófono y reconocimiento de voz en Info.plist.
- Cadenas de dictado en los 6 idiomas.
- iPad/Mac: el calendario reclama ~50% de la altura disponible en lugar
de quedar fijo a ~240px; iPhone (compact) sin cambios.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A3HaWmmtTQ1vdTERtSYU6p
Foundation for 2.1 family sharing (CKShare needs these models + container).
SwiftData cannot share across Apple IDs today, so 2.0 ships true multi-device
sync for the same account instead:
- Models made CloudKit-compatible: dropped @Attribute(.unique) on all 5,
inline defaults on every attribute, WeekPlan.slots stored as optional
relationship (name preserved → lightweight migration) with non-optional
slotList facade; ~73 call sites renamed.
- Container: cloudKitDatabase .automatic, falling back to the local-only
store when CloudKit is unavailable; failures recorded to Crashlytics.
- Entitlements: iCloud CloudKit service (container already existed);
remote-notification background mode for push-driven sync.
- Legacy KV snapshot sync (ICloudSyncService) stays inert when CloudKit is
active — kept only for 1.x devices.
- DeduplicationService collapses cross-device duplicates deterministically on
launch (settings singleton, default tags with tagId remapping, same-week
plans).
- Note: AppSettings.isPremium now syncs across same-Apple-ID devices; StoreKit
(PremiumSyncService + Transaction.updates) remains the source of truth and
reconciles on every launch/foreground.
All 21 unit tests pass, including ICloudSyncPremiumIsolationTests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BkanrydYtrme8wipTzWssG
- ShoppingItem model (per-week lines; dish-derived or free-text) + schema.
- ShoppingListService.reconcile mirrors planned dishes' ingredients into the
list, preserving check-off state and user items; plain-text export helper.
- ShoppingListView: grouped by dish, check-off, swipe-delete, free-text adds,
clear-checked, ShareLink export, and inline on-device "Generate" for planned
dishes without ingredients (paywall after 3 free generations,
source=ingredient_generation).
- Home toolbar: cart entry point (all users) + sheet.
- Analytics: shopping_list_opened, shopping_item_added, ingredients_generated.
- Localized in all 6 languages.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BkanrydYtrme8wipTzWssG
- Dish: ingredients [String] (default [], never required) and photoData
(externalStorage). Additive SwiftData migration — existing stores unaffected.
- ICloudSyncService: sync ingredients (optional in payload so pre-2.0 snapshots
still decode); photos deliberately excluded from KV sync (1MB limit).
- IngredientGenerator: Foundation Models (iOS 26+) generates localized
ingredient lines from the dish name, fully on-device. isAvailable gates the
UI affordance on older OS/devices; failures record to Crashlytics and
return [].
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BkanrydYtrme8wipTzWssG
- New "Week Ready" onboarding step: auto-fills the first week inline right
after dish creation, then pitches the Sunday reminder with context before
requesting OS notification permission (no more cold prompt on Home)
- Notifications section in Settings: weekly reminder toggle, deep-link to
system settings when permission is denied
- NotificationService: remindersEnabled preference, requestPermission(),
authorizationStatus(), cancelAllReminders()
- Post-onboarding premium prompt deferred to 2nd session (paywall was just
shown as the final onboarding step — 2s-later alert was prompt fatigue)
- Back navigation blocked after onboarding commit to avoid duplicate dishes
- 10 new strings × 6 languages
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UtWT52pAE91D7mbDda1cAM
Build 50 uploaded to TestFlight. Also migrates Fastfile from
Apple ID + app-specific-password to App Store Connect API key
(via pass) to avoid session expiry on future uploads.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A) Implicit: HomeViewModel tracks auto-assigned slot IDs after each
autocomplete run. When the user manually replaces one of those dishes,
the rejected dish ID is recorded in FeedbackStore (UserDefaults).
AutocompleteEngine applies a 25% penalty per rejection (floor 0.30).
B) Explicit: WeekPlan gains userRating (0/1/-1). Past weeks with dishes
show a compact 👍/👎 row (Premium only). Liked weeks boost their
dishes (+0.20 each, max +0.50); disliked weeks penalise them
(-0.25 each, max -0.50). Signal is intentionally modest so the
period cycle score remains dominant.
Also adds Stats + week-rating localization strings to all 6 languages
(were missing from the previous commit).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AutocompleteEngine: MRV heuristic picks the most-constrained slot first
at each step; historical scoring deprioritises dishes used in recent
weeks (decay: 0.20 last week → 0.90 four+ weeks ago)
- HomeViewModel: passes last 4 weeks as recentPlans to autocomplete
- StatsView (Premium): streak, weeks planned, completion rate, top 8
dishes with bar charts, top 6 tags with colour bars — 6 languages
- StoreManager: update product ID to approved bundle-ID convention
- Version bump to 1.1.3 / build 48
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove legacy CONSUMABLE fallback from monthlyProduct — when the
subscription fails to load, the UI now shows the retry state instead
of silently offering the legacy one-time product for purchase.
Legacy purchasers retain access via hasActiveSubscription() as before.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch premium to AutoRenewable subscription (com.mealmood.premium.monthly.sub);
legacy one-time purchasers retain lifetime access via StoreManager fallback
- Add ITSAppUsesNonExemptEncryption=false to Info.plist (no custom encryption)
- Update storekit config with both legacy NonConsumable and new subscription
- Bump version 1.1.1 build 46; update fastlane metadata and release notes (6 langs)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Dish.isPriority: mark dishes as priority; auto-assign gives them 2.5x weight
- Tag.dayRestriction: restrict tags to weekdays or weekend only
- Auto-assign CTA banner shown when there are empty slots (was hidden in context menu)
- Tap on filled slot opens picker to replace dish directly (no need to remove first)
- Export callout visible as soon as ≥1 slot is filled (not only when week is complete)
- WeekPlanShareView shows localized "TBD" / "Eating out" for empty/eating-out slots
- Second Sunday 17:00 push notification to plan next week
- DishDrawer sorts: priority first, then by historical usage, then alphabetically
- Search in SlotDishPickerSheet already shipped in 1.0.5 (verified ✓)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Eating out: tap any empty slot → "Mark as eating out"; shows teal indicator,
skipped by auto-assign, counts as complete, tap again to unmark
- Rule violations panel: access via wand long-press context menu when conflicts exist;
shows all isRuleOverridden slots with Fix (clear) or Ignore (acknowledge) actions
- Firebase Crashlytics integrated: CrashlyticsService + dSYM upload build phase,
isPremium property tracked per session
- PremiumSyncService: extracted premium state machine, StoreKit Transaction.updates
listener, isPremium no longer synced via iCloud to avoid stale state
- StoreManager: analytics on purchase/restore, bundle ID fallback for product ID lookup
- Search bar contrast bug fixed: TextField now has explicit foreground color for dark mode
- WelcomeStepView: redesigned onboarding welcome screen with week preview
- Version bump: 1.0.5 build 22
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AutocompleteEngine: no-repeat rule now applies to all dishes (not just tagless ones); fallback still allows repeats when no alternative exists
- CalendarService: update existing events instead of delete+create to prevent duplicates; fix weekStartDate using plan date instead of currentWeekStart
- DishFormView: form stays open after saving in create mode for quick multi-dish entry; Done button to close; saved feedback banner
- OnboardingViewModel/FirstDishesStepView: dishes are now optional during onboarding; Finish button always enabled
- AnalyticsService: new events — onboarding_step_viewed(step) and auto_assign_used(filled, unfilled)
- Localization: dish_done and first_dishes_optional_hint added in 6 languages; release notes updated in all 6 languages
- Version bump: 1.0.3 → 1.0.4 (build 19)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add localisations for German, French, Italian, and Brazilian Portuguese
- Redesign WeekPlanShareView with richer layout and sharing options
- Improve HomeView with various UI enhancements
- Update AppSettings and Tag models for new features
- Minor iCloud sync and Settings fixes
- Add archive & upload script for App Store submissions
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>