Surface the existing pin (keep-from-cull) and per-file delete actions as visible inline buttons on each offline cache row instead of context-menu-only: a star toggles protection from auto-cull (and restore-if-missing), a trash culls that file early. Aligns wording/icons to the star metaphor. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
50 lines
No EOL
1.5 KiB
Swift
50 lines
No EOL
1.5 KiB
Swift
import SwiftUI
|
|
import TVAnarchyCore
|
|
|
|
/// Compact stream link health — ping + bandwidth vs required buffer.
|
|
struct StreamabilityIndicator: View {
|
|
let sample: StreamabilitySample
|
|
var compact = false
|
|
|
|
var body: some View {
|
|
if compact {
|
|
compactPill
|
|
} else {
|
|
expandedRow
|
|
}
|
|
}
|
|
|
|
private var compactPill: some View {
|
|
HStack(spacing: 4) {
|
|
Circle().fill(color).frame(width: 7, height: 7)
|
|
Text(sample.level.label).font(.caption2).lineLimit(1)
|
|
}
|
|
.padding(.horizontal, 8).padding(.vertical, 4)
|
|
.background(.quaternary, in: Capsule())
|
|
.help(sample.detail)
|
|
}
|
|
|
|
private var expandedRow: some View {
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
HStack(spacing: 6) {
|
|
Circle().fill(color).frame(width: 8, height: 8)
|
|
Text("Stream link: \(sample.level.label)").font(.callout)
|
|
if sample.level == .checking {
|
|
ProgressView().controlSize(.small)
|
|
}
|
|
}
|
|
Text(sample.detail).font(.caption).foregroundStyle(.secondary)
|
|
}
|
|
.help("Occasional ping and bandwidth test to the storage server while Stream mode is on")
|
|
}
|
|
|
|
private var color: Color {
|
|
switch sample.level {
|
|
case .good: .green
|
|
case .marginal: .yellow
|
|
case .poor, .unreachable: .orange
|
|
case .checking: .gray
|
|
case .unknown: .secondary
|
|
}
|
|
}
|
|
} |