SPB Git

spb/poche Public

Agent personnel 100 % on-device — SwiftUI + Apple Foundation Models + EventKit + SwiftData. Aucune API, aucun serveur.

Swift 100%
1013 B · 39 lines swift
Raw Blame History
1//2//  ContextGaugeView.swift3//  Poche4//5//  Author:  Simon-Pierre Boucher6//  Contact: contact@spboucher.ai7//89import SwiftUI1011/// Discreet context gauge (CLAUDE.md §5): a thin line, never a token count.12struct ContextGaugeView: View {13    let ratio: Double1415    var body: some View {16        GeometryReader { proxy in17            ZStack(alignment: .leading) {18                Capsule()19                    .fill(Color.primary.opacity(0.06))20                Capsule()21                    .fill(fillStyle)22                    .frame(width: max(4, proxy.size.width * min(ratio, 1)))23            }24        }25        .frame(height: 3)26        .opacity(ratio < 0.05 ? 0 : 0.85)27        .animation(.easeInOut(duration: 0.3), value: ratio)28        .accessibilityHidden(true)29    }3031    private var fillStyle: AnyShapeStyle {32        switch ratio {33        case ..<0.6: AnyShapeStyle(Theme.accentGradient)34        case ..<0.85: AnyShapeStyle(Color.orange)35        default: AnyShapeStyle(Color.red)36        }37    }38}39