summaryrefslogtreecommitdiff
path: root/Hutch/Views/Tickets/TrackerManagementView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Hutch/Views/Tickets/TrackerManagementView.swift')
-rw-r--r--Hutch/Views/Tickets/TrackerManagementView.swift52
1 files changed, 49 insertions, 3 deletions
diff --git a/Hutch/Views/Tickets/TrackerManagementView.swift b/Hutch/Views/Tickets/TrackerManagementView.swift
index 1542d54..cf923b6 100644
--- a/Hutch/Views/Tickets/TrackerManagementView.swift
+++ b/Hutch/Views/Tickets/TrackerManagementView.swift
@@ -1069,6 +1069,12 @@ struct TrackerLabelManagementSheet: View {
var body: some View {
NavigationStack {
List {
+ Section {
+ Text("Labels are managed here and reused throughout the tracker.")
+ .font(.footnote)
+ .foregroundStyle(.secondary)
+ }
+
if viewModel.isLoadingLabels {
HStack {
Spacer()
@@ -1083,10 +1089,12 @@ struct TrackerLabelManagementSheet: View {
)
} else {
ForEach(viewModel.labels) { label in
- HStack {
- LabelPill(label: label)
- Spacer()
+ Button {
+ editingLabel = label
+ } label: {
+ TrackerLabelManagementRow(label: label)
}
+ .buttonStyle(.plain)
.swipeActions(edge: .trailing, allowsFullSwipe: false) {
Button {
editingLabel = label
@@ -1178,6 +1186,44 @@ struct TrackerLabelManagementSheet: View {
}
}
+private struct TrackerLabelManagementRow: View {
+ let label: TicketLabel
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: 8) {
+ HStack(alignment: .top, spacing: 12) {
+ LabelPill(label: label)
+ Spacer()
+ Image(systemName: "chevron.right")
+ .font(.caption.weight(.semibold))
+ .foregroundStyle(.tertiary)
+ }
+
+ HStack(spacing: 12) {
+ colorSwatch(hex: label.backgroundColor, title: "Background")
+ colorSwatch(hex: label.foregroundColor, title: "Text")
+ }
+ }
+ .padding(.vertical, 4)
+ }
+
+ private func colorSwatch(hex: String, title: String) -> some View {
+ HStack(spacing: 6) {
+ Circle()
+ .fill(Color(hex: hex) ?? .clear)
+ .frame(width: 10, height: 10)
+ .overlay {
+ Circle()
+ .stroke(Color.secondary.opacity(0.2), lineWidth: 1)
+ }
+
+ Text("\(title): \(hex.uppercased())")
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ }
+ }
+}
+
private struct TrackerLabelEditorSheet: View {
let title: String
let submitTitle: String