From 86bcd9452d3107f68aca085e03e69b02667c0dbb Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sun, 12 Apr 2026 22:06:16 -0500 Subject: feat: polish read-only project views and home integration Refs: https://todo.sr.ht/~ccleberg/hutch/36 Refs: https://todo.sr.ht/~ccleberg/hutch/37 Refs: https://todo.sr.ht/~ccleberg/hutch/38 --- Hutch/Views/Home/HomeViewModel.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Hutch/Views/Home/HomeViewModel.swift') diff --git a/Hutch/Views/Home/HomeViewModel.swift b/Hutch/Views/Home/HomeViewModel.swift index e9f0f50..682c94d 100644 --- a/Hutch/Views/Home/HomeViewModel.swift +++ b/Hutch/Views/Home/HomeViewModel.swift @@ -185,6 +185,7 @@ final class HomeViewModel { private(set) var isLoadingProjects = false private(set) var isLoadingAssignedTickets = false private(set) var isLoadingRecentBuilds = false + private(set) var projectsError: String? private(set) var assignedTicketsError: String? private(set) var recentBuildsError: String? @@ -332,6 +333,7 @@ final class HomeViewModel { isLoadingAssignedTickets = true isLoadingRecentBuilds = true isLoadingSystemStatus = true + projectsError = nil assignedTicketsError = nil recentBuildsError = nil isShowingStaleSystemStatus = false @@ -347,8 +349,9 @@ final class HomeViewModel { switch projectsResult { case .success(let projects): self.projects = projects - case .failure: - self.projects = [] + self.projectsError = nil + case .failure(let error): + self.projectsError = error.userFacingMessage } isLoadingProjects = false @@ -407,6 +410,10 @@ final class HomeViewModel { return pinnedIDs.compactMap { projectsByID[$0] } } + var hasPinnedProjects: Bool { + !ProjectPinStore.loadPinnedProjectIDs(for: currentUserKey).isEmpty + } + var failedBuildCount: Int { recentBuilds.filter { switch $0.job.status { -- cgit v1.2.3