mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-11 03:13:12 +00:00
- Menu-bar icon from the CCS logo: color mark + monochrome template that macOS auto-tints; footer toggle, persisted in UserDefaults - Dropdown analytics section: today/7d/30d/all-time spend, 7-day sparkline, top-model bars (BarAnalytics model + client + view) - Polished rows: branded header, colored health dots, provider/tier chips - package_app.sh bundles the icon assets into the .app - assert harness covers analytics decode + compact money/count formatting
22 lines
672 B
Swift
22 lines
672 B
Swift
import SwiftUI
|
|
|
|
/// CCS Bar entry point. A menu-bar-only app (no dock icon) whose title shows
|
|
/// the leading account's quota and today's total cost, with a dropdown for
|
|
/// per-account detail and control.
|
|
@main
|
|
struct CCSBarApp: App {
|
|
@StateObject private var viewModel = BarViewModel()
|
|
|
|
var body: some Scene {
|
|
MenuBarExtra {
|
|
BarMenuView(viewModel: viewModel)
|
|
} label: {
|
|
// The CCS mark + compact glance. The image re-renders when the style
|
|
// preference changes because `iconStyle` is observed.
|
|
Image(nsImage: MenuBarIcon.statusImage(viewModel.iconStyle))
|
|
Text(viewModel.statusTitle)
|
|
}
|
|
.menuBarExtraStyle(.window)
|
|
}
|
|
}
|