summaryrefslogtreecommitdiff
path: root/Hutch/Views/Work/WorkView.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-05-14 13:18:55 -0500
committerChristian Cleberg <[email protected]>2026-05-14 13:27:41 -0500
commit51b2eb0e6296734960f37cebd40fee34a1f261f9 (patch)
tree65063727d8dcff3540818676d7b53288499475dd /Hutch/Views/Work/WorkView.swift
parent9a853f8777230e0639261b5bc817201ec2d9deca (diff)
downloadhutch-51b2eb0e6296734960f37cebd40fee34a1f261f9.tar.gz
hutch-51b2eb0e6296734960f37cebd40fee34a1f261f9.tar.bz2
hutch-51b2eb0e6296734960f37cebd40fee34a1f261f9.zip
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
Diffstat (limited to 'Hutch/Views/Work/WorkView.swift')
-rw-r--r--Hutch/Views/Work/WorkView.swift28
1 files changed, 18 insertions, 10 deletions
diff --git a/Hutch/Views/Work/WorkView.swift b/Hutch/Views/Work/WorkView.swift
index 8b932dd..6ba1d0c 100644
--- a/Hutch/Views/Work/WorkView.swift
+++ b/Hutch/Views/Work/WorkView.swift
@@ -1,20 +1,28 @@
import SwiftUI
-struct WorkView: View {
- private enum Scope: String, CaseIterable, Identifiable {
- case all = "All"
- case unread = "Unread"
- case assigned = "Assigned"
-
- var id: String { rawValue }
+extension HutchWorkQueueScope: Identifiable {
+ var id: String { rawValue }
+
+ var displayName: String {
+ switch self {
+ case .all: "All"
+ case .unread: "Unread"
+ case .assigned: "Assigned"
+ }
}
+}
+struct WorkView: View {
@AppStorage(AppStorageKeys.swipeActionsEnabled, store: .standard) private var swipeActionsEnabled = true
@Environment(AppState.self) private var appState
@Environment(\.isAMOLEDTheme) private var isAMOLED
@Environment(\.scenePhase) private var scenePhase
@State private var viewModel: HomeViewModel?
- @State private var scope: Scope = .all
+ @State private var scope: HutchWorkQueueScope
+
+ init(initialScope: HutchWorkQueueScope = .all) {
+ _scope = State(initialValue: initialScope)
+ }
var body: some View {
Group {
@@ -106,8 +114,8 @@ struct WorkView: View {
private var scopeSection: some View {
Section {
Picker("Scope", selection: $scope) {
- ForEach(Scope.allCases) { scope in
- Text(scope.rawValue).tag(scope)
+ ForEach(HutchWorkQueueScope.allCases) { scope in
+ Text(scope.displayName).tag(scope)
}
}
.pickerStyle(.segmented)