Add unified task menu, Live Activity, and calendar event actions
Task context menu (new shared TaskMenuItems) consistent across Today, Matrix, and Calendar: Pin · Date · Move · Priority · Tags · Add to Live Activity · Delete. Adds TaskViewModel.setPriority. Live Activity (ActivityKit): - TaskActivityAttributes shared between app and widget targets - LiveActivityManager (start/update/end/toggle, iOS 16.1+) - TaskLiveActivity widget: lock-screen banner + Dynamic Island - NSSupportsLiveActivities via project.yml; project regenerated Calendar events (non-subscription, writable only): - Edit via system EKEventEditViewController (EventEditView wrapper) - Delete via new CalendarStore.deleteEvent Also sweeps in prior in-progress edits already present in the working tree (AuthManager, NotificationManager, TaskItem, task views) and the updated ISSUES.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ struct TaskItem: Identifiable, Codable, Equatable {
|
||||
var isAllDay: Bool = false
|
||||
var priority: Priority = .none
|
||||
var reminderDate: Date? = nil
|
||||
var constantReminder: Bool = false
|
||||
}
|
||||
|
||||
enum Priority: String, Codable, CaseIterable, Identifiable {
|
||||
@@ -236,6 +237,12 @@ class TaskViewModel: ObservableObject {
|
||||
tasks[idx].category = category
|
||||
save()
|
||||
}
|
||||
|
||||
func setPriority(_ task: TaskItem, priority: Priority) {
|
||||
guard let idx = tasks.firstIndex(where: { $0.id == task.id }) else { return }
|
||||
tasks[idx].priority = priority
|
||||
save()
|
||||
}
|
||||
func moveToQuadrant(taskID: UUID, quadrant: Quadrant) {
|
||||
guard let idx = tasks.firstIndex(where: { $0.id == taskID }) else { return }
|
||||
tasks[idx].quadrant = quadrant
|
||||
@@ -247,28 +254,32 @@ class TaskViewModel: ObservableObject {
|
||||
taskColor: TaskColor = .orange, isRecurring: Bool = false,
|
||||
recurrenceLabel: String? = nil,
|
||||
endDate: Date? = nil, isAllDay: Bool = false,
|
||||
priority: Priority = .none, reminderDate: Date? = nil) {
|
||||
priority: Priority = .none, reminderDate: Date? = nil,
|
||||
constantReminder: Bool = false) {
|
||||
tasks.append(TaskItem(title: title, dueDate: dueDate, hasTime: hasTime,
|
||||
quadrant: quadrant, category: category,
|
||||
taskColor: taskColor, isRecurring: isRecurring,
|
||||
recurrenceLabel: recurrenceLabel,
|
||||
endDate: endDate, isAllDay: isAllDay,
|
||||
priority: priority, reminderDate: reminderDate))
|
||||
priority: priority, reminderDate: reminderDate,
|
||||
constantReminder: constantReminder))
|
||||
save()
|
||||
}
|
||||
|
||||
func updateTask(_ task: TaskItem, title: String, dueDate: Date?, hasTime: Bool,
|
||||
isRecurring: Bool, recurrenceLabel: String?,
|
||||
endDate: Date?, isAllDay: Bool, reminderDate: Date?) {
|
||||
endDate: Date?, isAllDay: Bool, reminderDate: Date?,
|
||||
constantReminder: Bool = false) {
|
||||
guard let idx = tasks.firstIndex(where: { $0.id == task.id }) else { return }
|
||||
tasks[idx].title = title
|
||||
tasks[idx].dueDate = dueDate
|
||||
tasks[idx].hasTime = hasTime
|
||||
tasks[idx].isRecurring = isRecurring
|
||||
tasks[idx].recurrenceLabel = recurrenceLabel
|
||||
tasks[idx].endDate = endDate
|
||||
tasks[idx].isAllDay = isAllDay
|
||||
tasks[idx].reminderDate = reminderDate
|
||||
tasks[idx].title = title
|
||||
tasks[idx].dueDate = dueDate
|
||||
tasks[idx].hasTime = hasTime
|
||||
tasks[idx].isRecurring = isRecurring
|
||||
tasks[idx].recurrenceLabel = recurrenceLabel
|
||||
tasks[idx].endDate = endDate
|
||||
tasks[idx].isAllDay = isAllDay
|
||||
tasks[idx].reminderDate = reminderDate
|
||||
tasks[idx].constantReminder = constantReminder
|
||||
save()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user