diff options
| author | Christian Cleberg <[email protected]> | 2026-07-16 16:59:55 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-16 16:59:55 -0500 |
| commit | 7b817a1d2aed0e8b89f36b410f2779f4a6b35407 (patch) | |
| tree | 2a57a9f152a05ae61307ca8be1220c2a1ee2d708 /Hutch/Views/Home/HomeViewModel.swift | |
| parent | cd8742a0b932627401467bef8b7d5c376798382e (diff) | |
| download | hutch-7b817a1d2aed0e8b89f36b410f2779f4a6b35407.tar.gz hutch-7b817a1d2aed0e8b89f36b410f2779f4a6b35407.tar.bz2 hutch-7b817a1d2aed0e8b89f36b410f2779f4a6b35407.zip | |
Move Home system status into a title-bar status badge
Replace the disruption-only banner on the Home tab with a persistent
circular status indicator in the navigation bar, next to the "Home"
title. The badge reflects the existing status logic — green/check when
operational, orange/exclamation on disruption, gray otherwise — and taps
through to System Status. SystemStatusSummaryRow is unchanged and still
used by the More tab.
Resolve the system-status result first in HomeViewModel.loadDashboard so
the badge settles from cache immediately instead of waiting on the
slower projects/jobs/tickets/inbox loads, which had left it spinning for
several seconds.
Bump MARKETING_VERSION to 3.8.2 and record it in ROADMAP.
Diffstat (limited to 'Hutch/Views/Home/HomeViewModel.swift')
| -rw-r--r-- | Hutch/Views/Home/HomeViewModel.swift | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Hutch/Views/Home/HomeViewModel.swift b/Hutch/Views/Home/HomeViewModel.swift index 3789c11..7779bea 100644 --- a/Hutch/Views/Home/HomeViewModel.swift +++ b/Hutch/Views/Home/HomeViewModel.swift @@ -365,6 +365,19 @@ final class HomeViewModel { async let inboxUnreadTask = loadInboxUnreadSnapshot(forceRefresh: forceRefresh) async let systemStatusTask = loadSystemStatusSnapshot(forceRefresh: forceRefresh) + // Resolve system status first so the Home title-bar status badge can + // settle from cache without waiting on the slower list data below. + let systemStatusResult = await systemStatusTask + switch systemStatusResult { + case .success(let result): + systemStatusSnapshot = result.value + isShowingStaleSystemStatus = result.isStale + systemStatusErrorMessage = result.isStale ? result.refreshErrorMessage : nil + case .failure(let error): + systemStatusErrorMessage = error.userFacingMessage + } + isLoadingSystemStatus = false + let projectsResult = await projectsTask switch projectsResult { case .success(let projects): @@ -404,16 +417,6 @@ final class HomeViewModel { unreadInboxThreadCount = inboxUnreadSnapshot?.unreadCount unreadInboxThreads = inboxUnreadSnapshot?.threads ?? [] hasUnreadInboxThreads = (unreadInboxThreadCount ?? 0) > 0 - let systemStatusResult = await systemStatusTask - switch systemStatusResult { - case .success(let result): - systemStatusSnapshot = result.value - isShowingStaleSystemStatus = result.isStale - systemStatusErrorMessage = result.isStale ? result.refreshErrorMessage : nil - case .failure(let error): - systemStatusErrorMessage = error.userFacingMessage - } - isLoadingSystemStatus = false lastRefreshed = Date() persistNeedsAttentionSnapshot() persistSystemStatusWidgetSnapshot() |
