Add interactive iOS widget with subscription-based views
- Add direct API completion from widget via quick-complete endpoint - Share auth token and API URL with widget via App Group UserDefaults - Add dirty flag mechanism to refresh tasks when app returns from background - Widget checkbox colors indicate priority (red=urgent, orange=high, yellow=medium, green=low) - Show simple "X tasks waiting" view for free tier users when limitations enabled - Show interactive task completion widget for premium users or when limitations disabled - Sync subscription status with widget extension for view selection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
import WidgetKit
|
||||
import SwiftUI
|
||||
import AppIntents
|
||||
|
||||
// MARK: - Date Formatting Helper
|
||||
/// Parses date strings in either yyyy-MM-dd or ISO8601 (RFC3339) format
|
||||
@@ -58,7 +59,7 @@ private func formatWidgetDate(_ dateString: String) -> String {
|
||||
/// CacheManager reads tasks from the App Group shared container
|
||||
/// Data is written by the main app via WidgetDataManager
|
||||
class CacheManager {
|
||||
struct CustomTask: Codable {
|
||||
struct CustomTask: Codable, Identifiable {
|
||||
let id: Int
|
||||
let title: String
|
||||
let description: String?
|
||||
@@ -75,6 +76,16 @@ class CacheManager {
|
||||
case residenceName = "residence_name"
|
||||
case isOverdue = "is_overdue"
|
||||
}
|
||||
|
||||
/// Whether this task is pending completion (tapped on widget, waiting for sync)
|
||||
var isPendingCompletion: Bool {
|
||||
WidgetActionManager.shared.isTaskPendingCompletion(taskId: id)
|
||||
}
|
||||
|
||||
/// Whether this task should be shown (not pending completion)
|
||||
var shouldShow: Bool {
|
||||
!isPendingCompletion
|
||||
}
|
||||
}
|
||||
|
||||
private static let appGroupIdentifier = "group.com.tt.casera.CaseraDev"
|
||||
@@ -116,9 +127,11 @@ class CacheManager {
|
||||
let allTasks = getData()
|
||||
|
||||
// Filter for pending/in-progress tasks, sorted by due date
|
||||
// Also exclude tasks that are pending completion via widget
|
||||
let upcoming = allTasks.filter { task in
|
||||
let status = task.status?.lowercased() ?? ""
|
||||
return status == "pending" || status == "in_progress" || status == "in progress"
|
||||
let isActive = status == "pending" || status == "in_progress" || status == "in progress"
|
||||
return isActive && task.shouldShow
|
||||
}
|
||||
|
||||
// Sort by due date (earliest first), with overdue at top
|
||||
@@ -142,31 +155,36 @@ struct Provider: AppIntentTimelineProvider {
|
||||
SimpleEntry(
|
||||
date: Date(),
|
||||
configuration: ConfigurationAppIntent(),
|
||||
upcomingTasks: []
|
||||
upcomingTasks: [],
|
||||
isInteractive: true
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
func snapshot(for configuration: ConfigurationAppIntent, in context: Context) async -> SimpleEntry {
|
||||
let tasks = CacheManager.getUpcomingTasks()
|
||||
let isInteractive = WidgetActionManager.shared.shouldShowInteractiveWidget()
|
||||
return SimpleEntry(
|
||||
date: Date(),
|
||||
configuration: configuration,
|
||||
upcomingTasks: tasks
|
||||
upcomingTasks: tasks,
|
||||
isInteractive: isInteractive
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
func timeline(for configuration: ConfigurationAppIntent, in context: Context) async -> Timeline<SimpleEntry> {
|
||||
let tasks = CacheManager.getUpcomingTasks()
|
||||
|
||||
// Update every hour
|
||||
let isInteractive = WidgetActionManager.shared.shouldShowInteractiveWidget()
|
||||
|
||||
// Update every 30 minutes (more frequent for interactive widgets)
|
||||
let currentDate = Date()
|
||||
let nextUpdate = Calendar.current.date(byAdding: .hour, value: 1, to: currentDate)!
|
||||
let nextUpdate = Calendar.current.date(byAdding: .minute, value: 30, to: currentDate)!
|
||||
let entry = SimpleEntry(
|
||||
date: currentDate,
|
||||
configuration: configuration,
|
||||
upcomingTasks: tasks
|
||||
upcomingTasks: tasks,
|
||||
isInteractive: isInteractive
|
||||
)
|
||||
|
||||
|
||||
return Timeline(entries: [entry], policy: .after(nextUpdate))
|
||||
}
|
||||
}
|
||||
@@ -175,11 +193,12 @@ struct SimpleEntry: TimelineEntry {
|
||||
let date: Date
|
||||
let configuration: ConfigurationAppIntent
|
||||
let upcomingTasks: [CacheManager.CustomTask]
|
||||
|
||||
let isInteractive: Bool
|
||||
|
||||
var taskCount: Int {
|
||||
upcomingTasks.count
|
||||
}
|
||||
|
||||
|
||||
var nextTask: CacheManager.CustomTask? {
|
||||
upcomingTasks.first
|
||||
}
|
||||
@@ -190,23 +209,58 @@ struct CaseraEntryView : View {
|
||||
@Environment(\.widgetFamily) var family
|
||||
|
||||
var body: some View {
|
||||
switch family {
|
||||
case .systemSmall:
|
||||
SmallWidgetView(entry: entry)
|
||||
case .systemMedium:
|
||||
MediumWidgetView(entry: entry)
|
||||
case .systemLarge:
|
||||
LargeWidgetView(entry: entry)
|
||||
default:
|
||||
SmallWidgetView(entry: entry)
|
||||
if entry.isInteractive {
|
||||
// Premium/no-limitations: Show interactive widget with task completion
|
||||
switch family {
|
||||
case .systemSmall:
|
||||
SmallWidgetView(entry: entry)
|
||||
case .systemMedium:
|
||||
MediumWidgetView(entry: entry)
|
||||
case .systemLarge:
|
||||
LargeWidgetView(entry: entry)
|
||||
default:
|
||||
SmallWidgetView(entry: entry)
|
||||
}
|
||||
} else {
|
||||
// Free tier with limitations: Show simple task count view
|
||||
FreeWidgetView(entry: entry)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Free Tier Widget View (Non-Interactive)
|
||||
struct FreeWidgetView: View {
|
||||
let entry: SimpleEntry
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 12) {
|
||||
Spacer()
|
||||
|
||||
// Task count display
|
||||
Text("\(entry.taskCount)")
|
||||
.font(.system(size: 56, weight: .bold))
|
||||
.foregroundStyle(.blue)
|
||||
|
||||
Text(entry.taskCount == 1 ? "task waiting on you" : "tasks waiting on you")
|
||||
.font(.system(size: 14, weight: .medium))
|
||||
.foregroundStyle(.secondary)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
Spacer()
|
||||
|
||||
// Subtle upgrade hint
|
||||
Text("Upgrade for interactive widgets")
|
||||
.font(.system(size: 10))
|
||||
.foregroundStyle(.tertiary)
|
||||
}
|
||||
.padding(16)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Small Widget View
|
||||
struct SmallWidgetView: View {
|
||||
let entry: SimpleEntry
|
||||
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
// Task Count
|
||||
@@ -214,35 +268,47 @@ struct SmallWidgetView: View {
|
||||
Text("\(entry.taskCount)")
|
||||
.font(.system(size: 36, weight: .bold))
|
||||
.foregroundStyle(.blue)
|
||||
|
||||
|
||||
if entry.taskCount > 0 {
|
||||
Text(entry.taskCount == 1 ? "upcoming task" : "upcoming tasks")
|
||||
.font(.system(size: 12, weight: .medium))
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
|
||||
// Next Task
|
||||
|
||||
// Next Task with Complete Button
|
||||
if let nextTask = entry.nextTask {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
VStack(alignment: .leading, spacing: 6) {
|
||||
Text("NEXT UP")
|
||||
.font(.system(size: 9, weight: .semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.tracking(0.5)
|
||||
|
||||
|
||||
Text(nextTask.title)
|
||||
.font(.system(size: 12, weight: .semibold))
|
||||
.lineLimit(2)
|
||||
.lineLimit(1)
|
||||
.foregroundStyle(.primary)
|
||||
|
||||
if let dueDate = nextTask.dueDate {
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "calendar")
|
||||
.font(.system(size: 9))
|
||||
Text(formatWidgetDate(dueDate))
|
||||
.font(.system(size: 10, weight: .medium))
|
||||
|
||||
HStack(spacing: 8) {
|
||||
if let dueDate = nextTask.dueDate {
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "calendar")
|
||||
.font(.system(size: 9))
|
||||
Text(formatWidgetDate(dueDate))
|
||||
.font(.system(size: 10, weight: .medium))
|
||||
}
|
||||
.foregroundStyle(nextTask.isOverdue ? .red : .orange)
|
||||
}
|
||||
.foregroundStyle(.orange)
|
||||
|
||||
Spacer()
|
||||
|
||||
// Complete button
|
||||
Button(intent: CompleteTaskIntent(taskId: nextTask.id, taskTitle: nextTask.title)) {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.font(.system(size: 20))
|
||||
.foregroundStyle(.green)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
}
|
||||
.padding(.top, 8)
|
||||
@@ -258,9 +324,9 @@ struct SmallWidgetView: View {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.font(.system(size: 16))
|
||||
.foregroundStyle(.green)
|
||||
// Text("All caught up!")
|
||||
// .font(.system(size: 11, weight: .medium))
|
||||
// .foregroundStyle(.secondary)
|
||||
Text("All caught up!")
|
||||
.font(.system(size: 11, weight: .medium))
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 8)
|
||||
@@ -277,53 +343,51 @@ struct SmallWidgetView: View {
|
||||
// MARK: - Medium Widget View
|
||||
struct MediumWidgetView: View {
|
||||
let entry: SimpleEntry
|
||||
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 16) {
|
||||
// Left side - Task count
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Spacer()
|
||||
|
||||
|
||||
Text("\(entry.taskCount)")
|
||||
.font(.system(size: 42, weight: .bold))
|
||||
.foregroundStyle(.blue)
|
||||
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
Text("upcoming:")
|
||||
Text("upcoming")
|
||||
.font(.system(size: 11, weight: .medium))
|
||||
.foregroundStyle(.secondary)
|
||||
.lineLimit(2)
|
||||
|
||||
|
||||
Text(entry.taskCount == 1 ? "task" : "tasks")
|
||||
.font(.system(size: 11, weight: .medium))
|
||||
.foregroundStyle(.secondary)
|
||||
.lineLimit(2)
|
||||
}
|
||||
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.frame(maxWidth: 75)
|
||||
|
||||
|
||||
Divider()
|
||||
|
||||
// Right side - Next tasks
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
if let nextTask = entry.nextTask {
|
||||
|
||||
// Right side - Next tasks with interactive buttons
|
||||
VStack(alignment: .leading, spacing: 6) {
|
||||
if entry.nextTask != nil {
|
||||
Text("NEXT UP")
|
||||
.font(.system(size: 9, weight: .semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.tracking(0.5)
|
||||
}
|
||||
|
||||
if entry.nextTask != nil {
|
||||
|
||||
ForEach(Array(entry.upcomingTasks.prefix(3).enumerated()), id: \.element.id) { index, task in
|
||||
TaskRowView(task: task, index: index)
|
||||
InteractiveTaskRowView(task: task)
|
||||
}
|
||||
|
||||
|
||||
Spacer()
|
||||
} else {
|
||||
Spacer()
|
||||
|
||||
|
||||
VStack(spacing: 8) {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.font(.system(size: 24))
|
||||
@@ -333,7 +397,7 @@ struct MediumWidgetView: View {
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
@@ -343,23 +407,26 @@ struct MediumWidgetView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Task Row
|
||||
struct TaskRowView: View {
|
||||
// MARK: - Interactive Task Row (for Medium widget)
|
||||
struct InteractiveTaskRowView: View {
|
||||
let task: CacheManager.CustomTask
|
||||
let index: Int
|
||||
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 8) {
|
||||
Circle()
|
||||
.fill(priorityColor)
|
||||
.frame(width: 6, height: 6)
|
||||
|
||||
// Checkbox to complete task (color indicates priority)
|
||||
Button(intent: CompleteTaskIntent(taskId: task.id, taskTitle: task.title)) {
|
||||
Image(systemName: "circle")
|
||||
.font(.system(size: 18))
|
||||
.foregroundStyle(priorityColor)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(task.title)
|
||||
.font(.system(size: 11, weight: .semibold))
|
||||
// .lineLimit(1)
|
||||
.lineLimit(1)
|
||||
.foregroundStyle(.primary)
|
||||
|
||||
|
||||
if let dueDate = task.dueDate {
|
||||
HStack(spacing: 3) {
|
||||
Image(systemName: "calendar")
|
||||
@@ -367,32 +434,21 @@ struct TaskRowView: View {
|
||||
Text(formatWidgetDate(dueDate))
|
||||
.font(.system(size: 9, weight: .medium))
|
||||
}
|
||||
.foregroundStyle(.secondary)
|
||||
.foregroundStyle(task.isOverdue ? .red : .secondary)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
if let priority = task.priority {
|
||||
Text(priority.prefix(1).uppercased())
|
||||
.font(.system(size: 9, weight: .bold))
|
||||
.foregroundStyle(.white)
|
||||
.frame(width: 16, height: 16)
|
||||
.background(
|
||||
Circle()
|
||||
.fill(priorityColor)
|
||||
)
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 4)
|
||||
.padding(.vertical, 3)
|
||||
}
|
||||
|
||||
private var priorityColor: Color {
|
||||
switch task.priority?.lowercased() {
|
||||
case "urgent": return .red
|
||||
case "high": return .orange
|
||||
case "medium": return .blue
|
||||
default: return .gray
|
||||
case "medium": return .yellow
|
||||
default: return .green
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -410,7 +466,7 @@ struct LargeWidgetView: View {
|
||||
// Header
|
||||
HStack(spacing: 6) {
|
||||
Spacer()
|
||||
|
||||
|
||||
Text("\(entry.taskCount)")
|
||||
.font(.system(size: 22, weight: .bold))
|
||||
.foregroundStyle(.blue)
|
||||
@@ -435,9 +491,9 @@ struct LargeWidgetView: View {
|
||||
|
||||
Spacer()
|
||||
} else {
|
||||
// Show tasks
|
||||
// Show tasks with interactive buttons
|
||||
ForEach(Array(entry.upcomingTasks.prefix(maxTasksToShow).enumerated()), id: \.element.id) { index, task in
|
||||
LargeTaskRowView(task: task, isOverdue: task.isOverdue)
|
||||
LargeInteractiveTaskRowView(task: task)
|
||||
}
|
||||
|
||||
if entry.upcomingTasks.count > 6 {
|
||||
@@ -453,17 +509,19 @@ struct LargeWidgetView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Large Task Row
|
||||
struct LargeTaskRowView: View {
|
||||
// MARK: - Large Interactive Task Row
|
||||
struct LargeInteractiveTaskRowView: View {
|
||||
let task: CacheManager.CustomTask
|
||||
let isOverdue: Bool
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 8) {
|
||||
// Priority indicator
|
||||
RoundedRectangle(cornerRadius: 2)
|
||||
.fill(priorityColor)
|
||||
.frame(width: 3, height: 32)
|
||||
// Checkbox to complete task (color indicates priority)
|
||||
Button(intent: CompleteTaskIntent(taskId: task.id, taskTitle: task.title)) {
|
||||
Image(systemName: "circle")
|
||||
.font(.system(size: 20))
|
||||
.foregroundStyle(priorityColor)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(task.title)
|
||||
@@ -472,7 +530,7 @@ struct LargeTaskRowView: View {
|
||||
.foregroundStyle(.primary)
|
||||
|
||||
HStack(spacing: 10) {
|
||||
if let residenceName = task.residenceName {
|
||||
if let residenceName = task.residenceName, !residenceName.isEmpty {
|
||||
HStack(spacing: 2) {
|
||||
Image("icon")
|
||||
.resizable()
|
||||
@@ -489,23 +547,14 @@ struct LargeTaskRowView: View {
|
||||
Image(systemName: "calendar")
|
||||
.font(.system(size: 7))
|
||||
Text(formatWidgetDate(dueDate))
|
||||
.font(.system(size: 9, weight: isOverdue ? .semibold : .regular))
|
||||
.font(.system(size: 9, weight: task.isOverdue ? .semibold : .regular))
|
||||
}
|
||||
.foregroundStyle(isOverdue ? .red : .secondary)
|
||||
.foregroundStyle(task.isOverdue ? .red : .secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
// Priority badge
|
||||
if let priority = task.priority {
|
||||
Text(priority.prefix(1).uppercased())
|
||||
.font(.system(size: 8, weight: .bold))
|
||||
.foregroundStyle(.white)
|
||||
.frame(width: 16, height: 16)
|
||||
.background(Circle().fill(priorityColor))
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 4)
|
||||
.padding(.horizontal, 6)
|
||||
@@ -519,8 +568,8 @@ struct LargeTaskRowView: View {
|
||||
switch task.priority?.lowercased() {
|
||||
case "urgent": return .red
|
||||
case "high": return .orange
|
||||
case "medium": return .blue
|
||||
default: return .gray
|
||||
case "medium": return .yellow
|
||||
default: return .green
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -533,6 +582,9 @@ struct Casera: Widget {
|
||||
CaseraEntryView(entry: entry)
|
||||
.containerBackground(.fill.tertiary, for: .widget)
|
||||
}
|
||||
.configurationDisplayName("Casera Tasks")
|
||||
.description("View and complete your upcoming tasks.")
|
||||
.supportedFamilies([.systemSmall, .systemMedium, .systemLarge])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,13 +618,57 @@ struct Casera: Widget {
|
||||
residenceName: "Home",
|
||||
isOverdue: false
|
||||
)
|
||||
]
|
||||
],
|
||||
isInteractive: true
|
||||
)
|
||||
|
||||
// Free tier preview
|
||||
SimpleEntry(
|
||||
date: .now,
|
||||
configuration: ConfigurationAppIntent(),
|
||||
upcomingTasks: [
|
||||
CacheManager.CustomTask(
|
||||
id: 1,
|
||||
title: "Fix leaky faucet",
|
||||
description: nil,
|
||||
priority: "high",
|
||||
status: "pending",
|
||||
dueDate: "2024-12-15",
|
||||
category: "plumbing",
|
||||
residenceName: "Home",
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 2,
|
||||
title: "Paint living room",
|
||||
description: nil,
|
||||
priority: "medium",
|
||||
status: "pending",
|
||||
dueDate: "2024-12-20",
|
||||
category: "painting",
|
||||
residenceName: "Home",
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 3,
|
||||
title: "Clean gutters",
|
||||
description: nil,
|
||||
priority: "low",
|
||||
status: "pending",
|
||||
dueDate: "2024-12-25",
|
||||
category: "maintenance",
|
||||
residenceName: "Home",
|
||||
isOverdue: false
|
||||
)
|
||||
],
|
||||
isInteractive: false
|
||||
)
|
||||
|
||||
SimpleEntry(
|
||||
date: .now,
|
||||
configuration: ConfigurationAppIntent(),
|
||||
upcomingTasks: []
|
||||
upcomingTasks: [],
|
||||
isInteractive: true
|
||||
)
|
||||
}
|
||||
|
||||
@@ -599,7 +695,7 @@ struct Casera: Widget {
|
||||
title: "Paint living room",
|
||||
description: nil,
|
||||
priority: "medium",
|
||||
status: "pending",
|
||||
status: "in_progress",
|
||||
dueDate: "2024-12-20",
|
||||
category: "painting",
|
||||
residenceName: "Cabin",
|
||||
@@ -616,13 +712,79 @@ struct Casera: Widget {
|
||||
residenceName: "Home",
|
||||
isOverdue: false
|
||||
)
|
||||
]
|
||||
],
|
||||
isInteractive: true
|
||||
)
|
||||
|
||||
// Free tier preview
|
||||
SimpleEntry(
|
||||
date: .now,
|
||||
configuration: ConfigurationAppIntent(),
|
||||
upcomingTasks: [
|
||||
CacheManager.CustomTask(
|
||||
id: 1,
|
||||
title: "Fix leaky faucet",
|
||||
description: nil,
|
||||
priority: "high",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 2,
|
||||
title: "Paint living room",
|
||||
description: nil,
|
||||
priority: "medium",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 3,
|
||||
title: "Clean gutters",
|
||||
description: nil,
|
||||
priority: "low",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 4,
|
||||
title: "Replace HVAC filter",
|
||||
description: nil,
|
||||
priority: "medium",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 5,
|
||||
title: "Check smoke detectors",
|
||||
description: nil,
|
||||
priority: "high",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
)
|
||||
],
|
||||
isInteractive: false
|
||||
)
|
||||
|
||||
SimpleEntry(
|
||||
date: .now,
|
||||
configuration: ConfigurationAppIntent(),
|
||||
upcomingTasks: []
|
||||
upcomingTasks: [],
|
||||
isInteractive: true
|
||||
)
|
||||
}
|
||||
|
||||
@@ -649,7 +811,7 @@ struct Casera: Widget {
|
||||
title: "Paint living room walls",
|
||||
description: nil,
|
||||
priority: "medium",
|
||||
status: "pending",
|
||||
status: "in_progress",
|
||||
dueDate: "2024-12-20",
|
||||
category: "painting",
|
||||
residenceName: "Cabin",
|
||||
@@ -721,12 +883,100 @@ struct Casera: Widget {
|
||||
residenceName: "Beach House",
|
||||
isOverdue: false
|
||||
)
|
||||
]
|
||||
],
|
||||
isInteractive: true
|
||||
)
|
||||
|
||||
// Free tier preview
|
||||
SimpleEntry(
|
||||
date: .now,
|
||||
configuration: ConfigurationAppIntent(),
|
||||
upcomingTasks: [
|
||||
CacheManager.CustomTask(
|
||||
id: 1,
|
||||
title: "Task 1",
|
||||
description: nil,
|
||||
priority: "high",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 2,
|
||||
title: "Task 2",
|
||||
description: nil,
|
||||
priority: "medium",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 3,
|
||||
title: "Task 3",
|
||||
description: nil,
|
||||
priority: "low",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 4,
|
||||
title: "Task 4",
|
||||
description: nil,
|
||||
priority: "medium",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 5,
|
||||
title: "Task 5",
|
||||
description: nil,
|
||||
priority: "high",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 6,
|
||||
title: "Task 6",
|
||||
description: nil,
|
||||
priority: "low",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
),
|
||||
CacheManager.CustomTask(
|
||||
id: 7,
|
||||
title: "Task 7",
|
||||
description: nil,
|
||||
priority: "medium",
|
||||
status: "pending",
|
||||
dueDate: nil,
|
||||
category: nil,
|
||||
residenceName: nil,
|
||||
isOverdue: false
|
||||
)
|
||||
],
|
||||
isInteractive: false
|
||||
)
|
||||
|
||||
SimpleEntry(
|
||||
date: .now,
|
||||
configuration: ConfigurationAppIntent(),
|
||||
upcomingTasks: []
|
||||
upcomingTasks: [],
|
||||
isInteractive: true
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user