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 --- HutchTests/BuildListViewModelTests.swift | 6 ++++++ HutchTests/DeepLinkTests.swift | 8 ++++++++ HutchTests/HutchIntentsTests.swift | 9 +++++++++ 3 files changed, 23 insertions(+) (limited to 'HutchTests') diff --git a/HutchTests/BuildListViewModelTests.swift b/HutchTests/BuildListViewModelTests.swift index aa2e46b..8ee5b81 100644 --- a/HutchTests/BuildListViewModelTests.swift +++ b/HutchTests/BuildListViewModelTests.swift @@ -59,9 +59,15 @@ struct BuildListViewModelTests { filter: .active, lookbackDays: BuildListViewModel.defaultLookbackDays ) + let failed = BuildListViewModel.filterJobs( + jobs, + filter: .failed, + lookbackDays: BuildListViewModel.defaultLookbackDays + ) #expect(attention.map(\.id) == [2, 3]) #expect(active.map(\.id) == [3]) + #expect(failed.map(\.id) == [2]) } @Test diff --git a/HutchTests/DeepLinkTests.swift b/HutchTests/DeepLinkTests.swift index 500c4cd..d62cfef 100644 --- a/HutchTests/DeepLinkTests.swift +++ b/HutchTests/DeepLinkTests.swift @@ -88,6 +88,14 @@ struct DeepLinkTests { #expect(link == .lookup) } + @Test + func parsesRouteBackedNavigationLinks() { + #expect(DeepLink(url: HutchRoute.workQueue(scope: .assigned).url) == .workQueue(scope: .assigned)) + #expect(DeepLink(url: HutchRoute.failedBuilds.url) == .failedBuilds) + #expect(DeepLink(url: HutchRoute.search(query: "patch queue").url) == .search(query: "patch queue")) + #expect(DeepLink(url: HutchRoute.projectDashboard(id: "project-1", title: "Hutch").url) == .projectDashboard(id: "project-1", title: "Hutch")) + } + @Test func parsesUserProfileLink() { let link = DeepLink(url: HutchDeepLinkURL.userProfile) diff --git a/HutchTests/HutchIntentsTests.swift b/HutchTests/HutchIntentsTests.swift index 3cb7ad6..ddbe973 100644 --- a/HutchTests/HutchIntentsTests.swift +++ b/HutchTests/HutchIntentsTests.swift @@ -5,6 +5,15 @@ import Testing @MainActor struct HutchIntentsTests { + @Test + func navigationIntentsMapToCentralRoutes() { + #expect(OpenWorkQueueIntent().route == .workQueue(scope: .all)) + #expect(OpenRecentActivityIntent().route == .recentActivity) + #expect(OpenSystemStatusIntent().route == .systemStatus) + #expect(OpenFailedBuildsIntent().route == .failedBuilds) + #expect(OpenAssignedTicketsIntent().route == .workQueue(scope: .assigned)) + } + @Test func checkSystemStatusReturnsOperationalWhenNoDisruption() async throws { let defaultsName = "HutchIntentsTests-status-\(UUID().uuidString)" -- cgit v1.2.3