diff options
| author | Christian Cleberg <[email protected]> | 2026-04-12 22:42:33 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-12 22:42:33 -0500 |
| commit | 576bb6c2432a15f5138771c06019b55fd2244e15 (patch) | |
| tree | 167b4704658c11ea6b9e7170390098e13c89b94b /Hutch/Views/Tickets/TrackerManagementView.swift | |
| parent | 54d037548261c1546555a89a6a803b542a769880 (diff) | |
| download | hutch-576bb6c2432a15f5138771c06019b55fd2244e15.tar.gz hutch-576bb6c2432a15f5138771c06019b55fd2244e15.tar.bz2 hutch-576bb6c2432a15f5138771c06019b55fd2244e15.zip | |
feat: add ticket label management and bulk actions
Implements: https://todo.sr.ht/~ccleberg/hutch/45
Implements: https://todo.sr.ht/~ccleberg/hutch/46
Diffstat (limited to 'Hutch/Views/Tickets/TrackerManagementView.swift')
| -rw-r--r-- | Hutch/Views/Tickets/TrackerManagementView.swift | 52 |
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 |
