krz/hutch

an ios client for sourcehut

clone: git clone https://gitbay.org/krz/hutch.git

32c0e55b0713a15094c1640e7af70e0ed19d78d6

verified · cmc

author: Christian Cleberg <hello@cleberg.net> · 2026-04-20T17:31:57Z

fix: change failed builds card on home tab to navigate to builds tab instead of implementing its own view

Fixes: https://todo.sr.ht/~ccleberg/hutch/66
 Hutch.xcodeproj/project.pbxproj | 16 ++++++++--------
 Hutch/Views/Home/HomeView.swift |  5 +++--
 HutchTests/AppStateTests.swift  | 11 +++++++++++
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/Hutch.xcodeproj/project.pbxproj b/Hutch.xcodeproj/project.pbxproj
index c615313..13c8b7b 100644
--- a/Hutch.xcodeproj/project.pbxproj
+++ b/Hutch.xcodeproj/project.pbxproj
@@ -517,7 +517,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 79;
+				CURRENT_PROJECT_VERSION = 80;
 				DEVELOPMENT_TEAM = ZCNAX3VL9D;
 				ENABLE_PREVIEWS = YES;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -534,7 +534,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.1.11;
+				MARKETING_VERSION = 3.1.12;
 				PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				STRING_CATALOG_GENERATE_SYMBOLS = YES;
@@ -554,7 +554,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 79;
+				CURRENT_PROJECT_VERSION = 80;
 				DEVELOPMENT_TEAM = ZCNAX3VL9D;
 				ENABLE_PREVIEWS = YES;
 				GENERATE_INFOPLIST_FILE = YES;
@@ -571,7 +571,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 3.1.11;
+				MARKETING_VERSION = 3.1.12;
 				PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				STRING_CATALOG_GENERATE_SYMBOLS = YES;
@@ -634,7 +634,7 @@
 				APPLICATION_EXTENSION_API_ONLY = YES;
 				CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 79;
+				CURRENT_PROJECT_VERSION = 80;
 				DEVELOPMENT_TEAM = ZCNAX3VL9D;
 				GENERATE_INFOPLIST_FILE = NO;
 				INFOPLIST_FILE = HutchWidgetExtension/Info.plist;
@@ -644,7 +644,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 3.1.11;
+				MARKETING_VERSION = 3.1.12;
 				PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
@@ -663,7 +663,7 @@
 				APPLICATION_EXTENSION_API_ONLY = YES;
 				CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 79;
+				CURRENT_PROJECT_VERSION = 80;
 				DEVELOPMENT_TEAM = ZCNAX3VL9D;
 				GENERATE_INFOPLIST_FILE = NO;
 				INFOPLIST_FILE = HutchWidgetExtension/Info.plist;
@@ -673,7 +673,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 3.1.11;
+				MARKETING_VERSION = 3.1.12;
 				PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
diff --git a/Hutch/Views/Home/HomeView.swift b/Hutch/Views/Home/HomeView.swift
index fa7de86..242eeac 100644
--- a/Hutch/Views/Home/HomeView.swift
+++ b/Hutch/Views/Home/HomeView.swift
@@ -135,8 +135,8 @@ struct HomeView: View {
 
     private func buildsSection(_ viewModel: HomeViewModel) -> some View {
         Section("Builds") {
-            NavigationLink {
-                BuildListView()
+            Button {
+                appState.navigateToBuildsList()
             } label: {
                 HomeSummaryRow(
                     title: buildsTitle(viewModel),
@@ -146,6 +146,7 @@ struct HomeView: View {
                     emphasis: .monitoring
                 )
             }
+            .buttonStyle(.plain)
             .themedRow()
         }
     }
diff --git a/HutchTests/AppStateTests.swift b/HutchTests/AppStateTests.swift
index a5661ef..45812ed 100644
--- a/HutchTests/AppStateTests.swift
+++ b/HutchTests/AppStateTests.swift
@@ -34,6 +34,17 @@ struct AppStateTests {
         #expect(appState.pendingTabNavigation == .systemStatus)
     }
 
+    @Test
+    @MainActor
+    func navigateToBuildsListSelectsBuildsTabAndQueuesBuildsNavigation() {
+        let appState = AppState()
+
+        appState.navigateToBuildsList()
+
+        #expect(appState.selectedTab == .builds)
+        #expect(appState.pendingTabNavigation == .builds)
+    }
+
     @Test
     @MainActor
     func navigationHelpersQueueExpectedTargets() {