From 51b2eb0e6296734960f37cebd40fee34a1f261f9 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 14 May 2026 13:18:55 -0500 Subject: feat: add App Intents for Hutch navigation - add read-only App Intents for core Hutch workflows - route intents through the existing Hutch navigation/deep-link model - expose Work Queue, Recent Activity, System Status, pinned resources, projects, failed builds, assigned tickets, saved searches, and search where supported - keep App Intents non-mutating for the initial implementation - preserve existing widget, Safari extension, and hutch:// routing behavior References: https://todo.sr.ht/~ccleberg/hutch/71 --- Hutch/Views/Builds/BuildListView.swift | 9 +++++++++ Hutch/Views/Builds/BuildListViewModel.swift | 8 ++++++++ 2 files changed, 17 insertions(+) (limited to 'Hutch/Views/Builds') diff --git a/Hutch/Views/Builds/BuildListView.swift b/Hutch/Views/Builds/BuildListView.swift index 20414d6..cc31e67 100644 --- a/Hutch/Views/Builds/BuildListView.swift +++ b/Hutch/Views/Builds/BuildListView.swift @@ -124,6 +124,10 @@ struct BuildListView: View { let vm = BuildListViewModel(client: appState.client, defaults: appState.accountDefaults) vm.repoFilter = savedRepoFilter vm.lookbackDays = lookbackDays + if let pendingFilter = appState.pendingBuildListFilter { + vm.filter = pendingFilter + appState.pendingBuildListFilter = nil + } viewModel = vm await vm.loadJobs() } @@ -134,6 +138,11 @@ struct BuildListView: View { .onChange(of: lookbackDays) { _, newValue in viewModel?.lookbackDays = newValue } + .onChange(of: appState.pendingBuildListFilter) { _, newValue in + guard let newValue else { return } + viewModel?.filter = newValue + appState.pendingBuildListFilter = nil + } .onDisappear { viewModel?.stopAutoRefresh() } diff --git a/Hutch/Views/Builds/BuildListViewModel.swift b/Hutch/Views/Builds/BuildListViewModel.swift index 42500a8..eb01d9e 100644 --- a/Hutch/Views/Builds/BuildListViewModel.swift +++ b/Hutch/Views/Builds/BuildListViewModel.swift @@ -21,6 +21,7 @@ private struct SubmittedJob: Decodable, Sendable { enum BuildListFilter: String, CaseIterable, Sendable { case attention = "Attention" + case failed = "Failed" case active = "Active" case all = "All" } @@ -413,6 +414,13 @@ final class BuildListViewModel { case .success, .cancelled: return false } + case .failed: + switch job.status { + case .failed, .timeout: + return true + case .success, .cancelled, .running, .queued, .pending: + return false + } case .active: switch job.status { case .running, .queued, .pending: -- cgit v1.2.3