From c4195243c001fa1981957d0bec59cb9a478e19de Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Mon, 6 Jul 2026 20:57:53 +0200 Subject: [PATCH] feat(sharing): let share recipients recolour a shared calendar The colour dot for a shared (non-owned) local calendar was disabled and the colour write hit the owner-only PUT /calendars/{id} (404 for recipients). The dot is now always editable and colour changes go through the dedicated PUT /calendars/{id}/color endpoint, storing a recipient's own per-user colour server-side (synced across devices) without granting write or rename. Renaming stays owner-only. Parity with Android + server. Co-Authored-By: Claude Opus 4.8 --- Calendarr iOS/Services/CalendarrAPI.swift | 5 ++++- Calendarr iOS/Views/AccountsView.swift | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Calendarr iOS/Services/CalendarrAPI.swift b/Calendarr iOS/Services/CalendarrAPI.swift index 7b8d2a3..444f6b5 100644 --- a/Calendarr iOS/Services/CalendarrAPI.swift +++ b/Calendarr iOS/Services/CalendarrAPI.swift @@ -426,8 +426,11 @@ class CalendarrAPI { // MARK: – Calendar colour + /// Colour-only update: works for owners AND share recipients (recipients get + /// their own per-user colour; owners change the calendar's colour) — unlike + /// the owner-only PUT /calendars/{id}, and never touches the name. func updateLocalCalendarColor(id: Int, color: String) async throws { - _ = try await request("/api/local/calendars/\(id)", method: "PUT", body: ["color": color]) + _ = try await request("/api/local/calendars/\(id)/color", method: "PUT", body: ["color": color]) } func updateICalColor(id: Int, color: String) async throws { diff --git a/Calendarr iOS/Views/AccountsView.swift b/Calendarr iOS/Views/AccountsView.swift index 06beb11..99b005c 100644 --- a/Calendarr iOS/Views/AccountsView.swift +++ b/Calendarr iOS/Views/AccountsView.swift @@ -169,7 +169,9 @@ struct AccountsView: View { } else { ForEach(localCalendars) { cal in HStack { - CalendarColorDot(hex: cal.color, editable: cal.owned) { hex in + // Recipients of a shared calendar may recolour it (their + // own per-user colour); renaming stays owner-only. + CalendarColorDot(hex: cal.color, editable: true) { hex in try? await api.updateLocalCalendarColor(id: cal.id, color: hex) } Text(cal.name)