From 9050405b4f33b2b9b70458fcf3e43b80c940eef7 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sun, 12 Apr 2026 00:55:42 -0500 Subject: add shortcuts widgets and power-user workflows --- Hutch/Views/Home/HomeViewModel.swift | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Hutch/Views/Home') diff --git a/Hutch/Views/Home/HomeViewModel.swift b/Hutch/Views/Home/HomeViewModel.swift index 8762393..ec2b324 100644 --- a/Hutch/Views/Home/HomeViewModel.swift +++ b/Hutch/Views/Home/HomeViewModel.swift @@ -388,6 +388,7 @@ final class HomeViewModel { } isLoadingSystemStatus = false persistNeedsAttentionSnapshot() + persistSystemStatusWidgetSnapshot() } var hasDashboardContent: Bool { @@ -928,6 +929,27 @@ final class HomeViewModel { ) } + private func persistSystemStatusWidgetSnapshot() { + guard let snapshot = systemStatusSnapshot else { + return + } + let widgetSnapshot = SystemStatusWidgetSnapshot( + services: snapshot.services.map { service in + SystemStatusWidgetSnapshot.ServiceEntry( + id: service.id, + name: service.name, + status: service.status.displayName, + requiresAttention: service.status.requiresAttention + ) + }, + hasDisruption: snapshot.hasDisruption, + overallStatusText: snapshot.overallStatusText, + bannerSummary: snapshot.bannerSummary, + updatedAt: .now + ) + SystemStatusWidgetSnapshotStore.save(widgetSnapshot) + } + nonisolated static func buildItems(from jobs: [HomeJobPayload]) -> [HomeBuildItem] { jobs.map { job in let repository = primaryRepositoryReference(in: job.manifest) -- cgit v1.2.3