Files
jarvis/Jarvis/Views/Shared/CachedBadge.swift
Robin Kutesa 595f21fb6c
Some checks failed
CI / Build · macos-14 · Debug (push) Has been cancelled
CI / Build · macos-15 · Debug (push) Has been cancelled
CI / Build · macos-14 · Release (push) Has been cancelled
CI / Build · macos-15 · Release (push) Has been cancelled
feat: East Africa + Southern Africa pills with regional sub-sections
- East Africa pill: merges Uganda + east-africa tags; Uganda pinned first via sub-sections
- Southern Africa pill: covers SA, Namibia, Botswana, Zimbabwe, Zambia, Mozambique; SA/Namibia/Botswana prioritized
- StoryStore.setPill now resets lastSyncedAt to bypass 30s rate-limit on filter switch
- sectionSupplement background fetch populates sparse regional sections in All digest
- SignalFeedView digestContent: flat hero+scroll path for pills without subSections (was showing max 5)
- Theme: removed standalone Uganda pill, wired new sub-section layouts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 02:33:33 +03:00

44 lines
1.2 KiB
Swift

// CachedBadge.swift
// Jarvis offline-cache indicators (a bare dot, and a labelled green badge).
import SwiftUI
/// Tiny green dot used in the signal feed rows when a story is cached offline.
struct CachedDot: View {
var size: CGFloat = 7
var body: some View {
Circle()
.fill(Palette.cachedGreen)
.frame(width: size, height: size)
.overlay(Circle().stroke(Color(hex: "3E7E3E"), lineWidth: 0.5))
}
}
/// Labelled green badge "Cached", or "All N articles cached · available offline".
struct CachedBadge: View {
let text: String
var body: some View {
HStack(spacing: 6) {
CachedDot(size: 6)
Text(text)
.font(.system(size: 12, weight: .bold))
.foregroundStyle(Color(hex: "6FBF6F"))
}
.padding(.horizontal, 9)
.padding(.vertical, 5)
.background(Palette.cachedGreen.opacity(0.18))
.clipShape(Capsule())
}
}
#Preview {
VStack(spacing: 16) {
CachedDot()
CachedBadge(text: "Cached")
CachedBadge(text: "All 7 articles cached · available offline")
}
.padding()
.background(Palette.background)
}