Initial commit: Jarvis iOS app
SwiftUI client for a self-hosted RSS news-correlation platform: signal feed, story detail, article reader, feed manager, and LAN⇄Tailscale connectivity. Project generated from project.yml via XcodeGen. Includes CI build matrix (macOS 14/15 × Debug/Release), issue templates, backlog, and API/backend handoff docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
43
Jarvis/Views/Shared/CachedBadge.swift
Normal file
43
Jarvis/Views/Shared/CachedBadge.swift
Normal file
@@ -0,0 +1,43 @@
|
||||
// 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(Color.black)
|
||||
}
|
||||
Reference in New Issue
Block a user