// // ContextGaugeView.swift // Poche // // Author: Simon-Pierre Boucher // Contact: contact@spboucher.ai // import SwiftUI /// Discreet context gauge (CLAUDE.md ยง5): a thin line, never a token count. struct ContextGaugeView: View { let ratio: Double var body: some View { GeometryReader { proxy in ZStack(alignment: .leading) { Capsule() .fill(Color.primary.opacity(0.06)) Capsule() .fill(fillStyle) .frame(width: max(4, proxy.size.width * min(ratio, 1))) } } .frame(height: 3) .opacity(ratio < 0.05 ? 0 : 0.85) .animation(.easeInOut(duration: 0.3), value: ratio) .accessibilityHidden(true) } private var fillStyle: AnyShapeStyle { switch ratio { case ..<0.6: AnyShapeStyle(Theme.accentGradient) case ..<0.85: AnyShapeStyle(Color.orange) default: AnyShapeStyle(Color.red) } } }