Birthdays: explicit calendar creation, sync never auto-creates (iOS)

- Contacts sync fills only an EXISTING birthday calendar (birthdayCalendar),
  never auto-creates it — deleting it no longer resurrects it on sync
- Accounts + menu gains "Geburtstagskalender" (only when none exists) to create
  the single birthday calendar explicitly
- the Birthdays-from-Contacts section shows a "create one first" hint when there
  is no birthday calendar; enabling sync only requests Contacts access

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-13 21:25:06 +02:00
parent 69ed8bf67d
commit d4fd7beaf7
3 changed files with 37 additions and 19 deletions

View File

@@ -141,7 +141,10 @@ enum BirthdaysImporter {
guard isEnabled else { return }
guard await requestAccess() else { return }
guard let contacts = try? readContactBirthdays() else { return }
guard let cal = await ensureBirthdayCalendar(api: api) else { return }
// Only fill an EXISTING birthday calendar never auto-create it. The
// calendar is created explicitly; deleting it means sync has nowhere to
// go (and must not resurrect it).
guard let cal = await birthdayCalendar(api: api) else { return }
guard let existing = try? await api.getBirthdayEntries(calendarId: cal.id) else { return }
// Only reconcile THIS device's contact rows; leave other devices'