Health: CLI probe and mac UI surfacing

This commit is contained in:
Peter Steinberger
2025-12-07 04:38:20 +00:00
parent ddf8aef4f7
commit cb5c932447
9 changed files with 252 additions and 16 deletions

View File

@@ -54,12 +54,14 @@ struct ClawdisApp: App {
private struct MenuContent: View {
@ObservedObject var state: AppState
@ObservedObject private var relayManager = RelayProcessManager.shared
@ObservedObject private var healthStore = HealthStore.shared
@Environment(\.openSettings) private var openSettings
var body: some View {
VStack(alignment: .leading, spacing: 8) {
Toggle(isOn: self.activeBinding) { Text("Clawdis Active") }
self.relayStatusRow
self.healthStatusRow
Toggle(isOn: self.voiceWakeBinding) { Text("Voice Wake") }
.disabled(!voiceWakeSupported)
.opacity(voiceWakeSupported ? 1 : 0.5)
@@ -68,6 +70,7 @@ private struct MenuContent: View {
Button("Settings…") { self.open(tab: .general) }
.keyboardShortcut(",", modifiers: [.command])
Button("About Clawdis") { self.open(tab: .about) }
Button("Run Health Check") { Task { await self.healthStore.refresh(onDemand: true) } }
Divider()
Button("Quit") { NSApplication.shared.terminate(nil) }
}
@@ -93,6 +96,19 @@ private struct MenuContent: View {
.padding(.vertical, 4)
}
private var healthStatusRow: some View {
let state = self.healthStore.state
return HStack(spacing: 8) {
Circle()
.fill(state.tint)
.frame(width: 8, height: 8)
Text(self.healthStore.summaryLine)
.font(.caption.weight(.semibold))
.foregroundStyle(.primary)
}
.padding(.vertical, 2)
}
private func statusColor(_ status: RelayProcessManager.Status) -> Color {
switch status {
case .running: .green