Bring CalendarrKit into the repo and fix the iOS build
The monorepo's Xcode project referenced ../CalendarrKit, but the package was never brought across: it is the one repo that never had a remote, so it existed only on one machine. Added as a subtree at the root, where that existing relative path resolves, so the project needs no change. History is preserved — the commits explaining why the snapshot colours sit flat on the wire and why the package must stay Foundation-only are the kind of thing that cannot be reconstructed later. The iOS target also did not compile on beta, independent of any of this. The attachments section combined a string title with a footer, and SwiftUI has no initializer for that pair: the title then binds as the first positional argument of Section(content:footer:), which is what the three misleading "generic parameter 'Content'" errors were. Rewritten as header:/footer:, the way the reminders section directly above already does it. Carries over the pending change from the archived iOS repo: each calendar source now reports its own failure instead of being swallowed by `try?`, so an absent Home Assistant calendar can finally be diagnosed from the app. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
dccf8671b2
commit
ab0c64a9e1
@@ -35,6 +35,18 @@ struct EventEditorSheet: View {
|
||||
private var isEditing: Bool { editingEvent != nil }
|
||||
private var isCopying: Bool { copyFrom != nil && editingEvent == nil }
|
||||
|
||||
/// Sources that failed to answer, named instead of silently leaving their
|
||||
/// calendars out of the picker.
|
||||
@ViewBuilder
|
||||
private var sourceErrorRows: some View {
|
||||
let failures = store.writableCalendarErrors.sorted { $0.key < $1.key }
|
||||
ForEach(failures, id: \.key) { failure in
|
||||
Label("\(failure.key): \(failure.value)", systemImage: "exclamationmark.triangle")
|
||||
.foregroundStyle(.orange)
|
||||
.font(.caption)
|
||||
}
|
||||
}
|
||||
|
||||
private var selectedCal: WritableCalendar? {
|
||||
store.writableCalendars.first { $0.id == selectedCalendarId }
|
||||
}
|
||||
@@ -80,7 +92,9 @@ struct EventEditorSheet: View {
|
||||
Text(L10n.t("event.no_writable", appLang))
|
||||
.foregroundStyle(.secondary)
|
||||
.font(.callout)
|
||||
} else {
|
||||
}
|
||||
sourceErrorRows
|
||||
if !store.writableCalendars.isEmpty {
|
||||
Picker(L10n.t("event.calendar_picker", appLang), selection: $selectedCalendarId) {
|
||||
ForEach(store.writableCalendars) { cal in
|
||||
HStack {
|
||||
@@ -122,7 +136,7 @@ struct EventEditorSheet: View {
|
||||
}
|
||||
.disabled(remindersDisabled)
|
||||
|
||||
Section(L10n.t("event.attachments", appLang)) {
|
||||
Section {
|
||||
ForEach(existingAttachments.filter { !removedAttachmentIds.contains($0.id) }) { att in
|
||||
HStack {
|
||||
Image(systemName: att.symbolName).foregroundStyle(.secondary)
|
||||
@@ -156,6 +170,8 @@ struct EventEditorSheet: View {
|
||||
Label(L10n.t("event.attachment_add", appLang), systemImage: "paperclip")
|
||||
}
|
||||
.disabled(attachmentSlotsUsed >= 10)
|
||||
} header: {
|
||||
Text(L10n.t("event.attachments", appLang))
|
||||
} footer: {
|
||||
Text(L10n.t("event.attachment_hint", appLang))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user