Matrix/menus: Pick Date everywhere, time-based reminders, notification snooze (KC-21)

- Date menu now offers "Pick Date" (and Edit) in the Matrix grid cards and the
  Calendar reschedule/move menu, matching the tasks view — both open the shared
  TaskEditSheet via a new editingTask sheet.
- Reworked the reminder picker (TaskDatePickerSheet, shared by all entry points)
  from day/week offsets to sensible time-based ones relative to the event time:
  None, On time, 5 min, 30 min, 1 hour, 1 day, plus a Minutes/Hours/Days custom
  wheel. Existing absolute reminderDates migrate to the nearest minute offset.
- Notifications gain Snooze actions (15/30/60/120 min) that reschedule the task
  reminder; postpone now clears the Matrix urgency override.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
kutesir
2026-06-15 18:14:10 +03:00
parent 4b16e8587d
commit ac147c55b0
7 changed files with 286 additions and 119 deletions

View File

@@ -562,6 +562,24 @@ class TaskViewModel: ObservableObject {
guard let idx = tasks.firstIndex(where: { $0.id == task.id }) else { return }
let base = tasks[idx].dueDate ?? Date()
tasks[idx].dueDate = Calendar.current.date(byAdding: .day, value: days, to: base)
tasks[idx].urgencyOverride = nil
tasks[idx].quadrant = displayQuadrant(tasks[idx])
save()
}
func postpone(_ task: TaskItem, minutes: Int) {
guard let idx = tasks.firstIndex(where: { $0.id == task.id }) else { return }
let target = Date().addingTimeInterval(TimeInterval(minutes * 60))
if tasks[idx].reminderDate != nil {
tasks[idx].reminderDate = target
} else if tasks[idx].dueDate != nil {
tasks[idx].dueDate = target
tasks[idx].hasTime = true
tasks[idx].urgencyOverride = nil
tasks[idx].quadrant = displayQuadrant(tasks[idx])
} else {
tasks[idx].reminderDate = target
}
save()
}