summaryrefslogtreecommitdiff
path: root/HutchWidgetExtension/NeedsAttentionWidget.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-12 00:55:42 -0500
committerChristian Cleberg <[email protected]>2026-04-12 00:55:42 -0500
commit9050405b4f33b2b9b70458fcf3e43b80c940eef7 (patch)
tree983c3a07a560258059cfe421beb3ffcf3c18baf4 /HutchWidgetExtension/NeedsAttentionWidget.swift
parent5f6d545eb3455a9e4da5a3cb4460811e3a48d939 (diff)
downloadhutch-9050405b4f33b2b9b70458fcf3e43b80c940eef7.tar.gz
hutch-9050405b4f33b2b9b70458fcf3e43b80c940eef7.tar.bz2
hutch-9050405b4f33b2b9b70458fcf3e43b80c940eef7.zip
add shortcuts widgets and power-user workflowsv2.15.0
Diffstat (limited to 'HutchWidgetExtension/NeedsAttentionWidget.swift')
-rw-r--r--HutchWidgetExtension/NeedsAttentionWidget.swift79
1 files changed, 46 insertions, 33 deletions
diff --git a/HutchWidgetExtension/NeedsAttentionWidget.swift b/HutchWidgetExtension/NeedsAttentionWidget.swift
index e212af6..574e9eb 100644
--- a/HutchWidgetExtension/NeedsAttentionWidget.swift
+++ b/HutchWidgetExtension/NeedsAttentionWidget.swift
@@ -71,7 +71,7 @@ private struct NeedsAttentionWidgetView: View {
fallbackState
}
}
- .widgetURL(URL(string: "hutch://home"))
+ .widgetURL(family == .systemSmall ? URL(string: "hutch://home") : nil)
.containerBackground(for: .widget) {
Color(.systemBackground)
}
@@ -101,52 +101,64 @@ private struct NeedsAttentionWidgetView: View {
private func mediumView(snapshot: NeedsAttentionSnapshot) -> some View {
VStack(alignment: .leading, spacing: 0) {
HStack(alignment: .top, spacing: 12) {
- metricColumn(
+ Link(destination: URL(string: "hutch://home")!) {
+ metricColumn(
+ count: snapshot.unreadInboxThreads,
+ label: "Unread",
+ systemImage: "tray",
+ tint: unreadTint(for: snapshot.unreadInboxThreads)
+ )
+ }
+ Link(destination: URL(string: "hutch://trackers")!) {
+ metricColumn(
+ count: snapshot.assignedOpenTickets,
+ label: "Assigned",
+ systemImage: "ticket"
+ )
+ }
+ Link(destination: URL(string: "hutch://builds")!) {
+ metricColumn(
+ count: snapshot.failedBuilds,
+ label: "Failed",
+ systemImage: "hammer",
+ tint: failedTint(for: snapshot.failedBuilds)
+ )
+ }
+ }
+ Spacer(minLength: 0)
+ }
+ .padding(.horizontal, 16)
+ .padding(.top, 18)
+ .padding(.bottom, 16)
+ }
+
+ private func largeView(snapshot: NeedsAttentionSnapshot) -> some View {
+ VStack(alignment: .leading, spacing: 18) {
+ Link(destination: URL(string: "hutch://home")!) {
+ metricRow(
count: snapshot.unreadInboxThreads,
- label: "Unread",
+ label: "Unread threads",
systemImage: "tray",
tint: unreadTint(for: snapshot.unreadInboxThreads)
)
- metricColumn(
+ }
+ Link(destination: URL(string: "hutch://trackers")!) {
+ metricRow(
count: snapshot.assignedOpenTickets,
- label: "Assigned",
+ label: "Assigned tickets",
systemImage: "ticket"
)
- metricColumn(
+ }
+ Link(destination: URL(string: "hutch://builds")!) {
+ metricRow(
count: snapshot.failedBuilds,
- label: "Failed",
+ label: "Failed builds",
systemImage: "hammer",
tint: failedTint(for: snapshot.failedBuilds)
)
}
Spacer(minLength: 0)
}
- .padding(.horizontal, 16)
- .padding(.top, 18)
- .padding(.bottom, 16)
- }
-
- private func largeView(snapshot: NeedsAttentionSnapshot) -> some View {
- VStack(alignment: .leading, spacing: 18) {
- metricRow(
- count: snapshot.unreadInboxThreads,
- label: "Unread threads",
- systemImage: "tray",
- tint: unreadTint(for: snapshot.unreadInboxThreads)
- )
- metricRow(
- count: snapshot.assignedOpenTickets,
- label: "Assigned tickets",
- systemImage: "ticket"
- )
- metricRow(
- count: snapshot.failedBuilds,
- label: "Failed builds",
- systemImage: "hammer",
- tint: failedTint(for: snapshot.failedBuilds)
- )
- Spacer(minLength: 0)
- }
.padding(20)
}
@@ -303,5 +315,6 @@ struct HutchWidgets: WidgetBundle {
var body: some Widget {
NeedsAttentionWidget()
ContributionGraphWidget()
+ SystemStatusWidget()
}
}