Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Packages/CrowUI/Sources/CrowUI/LinkChip.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import SwiftUI
import CrowCore

/// Clickable capsule that opens a URL (issue link, PR link, repo link).
struct LinkChip: View {
let label: String
let url: String
let icon: String

var body: some View {
Button {
if let nsURL = URL(string: url) {
NSWorkspace.shared.open(nsURL)
}
} label: {
HStack(spacing: 4) {
Image(systemName: icon)
.font(.caption)
Text(label)
.font(.caption)
.fontWeight(.medium)
}
.foregroundStyle(CorveilTheme.gold)
.padding(.horizontal, 8)
.padding(.vertical, 4)
.background(CorveilTheme.gold.opacity(0.1))
.overlay(
Capsule().strokeBorder(CorveilTheme.goldDark.opacity(0.3), lineWidth: 1)
)
.clipShape(Capsule())
}
.buttonStyle(.plain)
}
}
32 changes: 0 additions & 32 deletions Packages/CrowUI/Sources/CrowUI/SessionDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -356,38 +356,6 @@ struct StatusBadge: View {
}
}

/// Clickable capsule that opens a URL (issue link, PR link, repo link).
struct LinkChip: View {
let label: String
let url: String
let icon: String

var body: some View {
Button {
if let nsURL = URL(string: url) {
NSWorkspace.shared.open(nsURL)
}
} label: {
HStack(spacing: 4) {
Image(systemName: icon)
.font(.caption)
Text(label)
.font(.caption)
.fontWeight(.medium)
}
.foregroundStyle(CorveilTheme.gold)
.padding(.horizontal, 8)
.padding(.vertical, 4)
.background(CorveilTheme.gold.opacity(0.1))
.overlay(
Capsule().strokeBorder(CorveilTheme.goldDark.opacity(0.3), lineWidth: 1)
)
.clipShape(Capsule())
}
.buttonStyle(.plain)
}
}

// MARK: - Readiness-Aware Terminal Wrapper

/// Wraps a TerminalSurfaceView with readiness tracking.
Expand Down
33 changes: 11 additions & 22 deletions Packages/CrowUI/Sources/CrowUI/TicketBoardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,18 @@ struct TicketCard: View {
.font(.caption)
.foregroundStyle(isDone ? CorveilTheme.textMuted : CorveilTheme.textSecondary)

Text("#\(String(issue.number))")
.font(.system(size: 12, weight: .medium))
.monospacedDigit()
.foregroundStyle(isDone ? CorveilTheme.textMuted : CorveilTheme.textPrimary)
LinkChip(
label: "Issue #\(String(issue.number))",
url: issue.url,
icon: "link"
)

if let prNum = issue.prNumber {
ticketPRBadge(number: prNum, url: issue.prURL)
if let prNum = issue.prNumber, let prURL = issue.prURL {
LinkChip(
label: "PR #\(String(prNum))",
url: prURL,
icon: "arrow.triangle.pull"
)
}

Spacer()
Expand Down Expand Up @@ -493,22 +498,6 @@ struct TicketCard: View {
.opacity(isSelectable ? 1.0 : 0.3)
}

private func ticketPRBadge(number: Int, url: String?) -> some View {
HStack(spacing: 3) {
Image(systemName: "arrow.triangle.pull")
.font(.caption2)
Text("PR #\(String(number))")
.font(.caption2)
.fontWeight(.medium)
}
.foregroundStyle(.purple)
.padding(.horizontal, 6)
.padding(.vertical, 2)
.background(.purple.opacity(0.1))
.overlay(Capsule().strokeBorder(Color.purple.opacity(0.3), lineWidth: 0.5))
.clipShape(Capsule())
}

private var labelRow: some View {
HStack(spacing: 4) {
ForEach(issue.labels.prefix(3), id: \.self) { label in
Expand Down
Loading