macOS: merge status row and fix webchat bundle deps
parent
b837c68df8
commit
c06f49cb3e
|
|
@ -59,8 +59,7 @@ private struct MenuContent: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
Toggle(isOn: self.activeBinding) { Text("Clawdis Active") }
|
Toggle(isOn: self.activeBinding) { Text("Clawdis Active") }
|
||||||
self.relayStatusRow
|
self.statusRow
|
||||||
self.healthStatusRow
|
|
||||||
Toggle(isOn: self.heartbeatsBinding) { Text("Send heartbeats") }
|
Toggle(isOn: self.heartbeatsBinding) { Text("Send heartbeats") }
|
||||||
Toggle(isOn: self.voiceWakeBinding) { Text("Voice Wake") }
|
Toggle(isOn: self.voiceWakeBinding) { Text("Voice Wake") }
|
||||||
.disabled(!voiceWakeSupported)
|
.disabled(!voiceWakeSupported)
|
||||||
|
|
@ -82,13 +81,32 @@ private struct MenuContent: View {
|
||||||
NotificationCenter.default.post(name: .clawdisSelectSettingsTab, object: tab)
|
NotificationCenter.default.post(name: .clawdisSelectSettingsTab, object: tab)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var relayStatusRow: some View {
|
private var statusRow: some View {
|
||||||
let status = self.relayManager.status
|
let relay = self.relayManager.status
|
||||||
|
let health = self.healthStore.state
|
||||||
|
let isRefreshing = self.healthStore.isRefreshing
|
||||||
|
|
||||||
|
let label: String
|
||||||
|
let color: Color
|
||||||
|
|
||||||
|
if isRefreshing {
|
||||||
|
// Prefer health while the probe is running.
|
||||||
|
label = self.healthStore.summaryLine
|
||||||
|
color = health.tint
|
||||||
|
} else if health == .ok {
|
||||||
|
// Healthy implies relay running is the primary signal.
|
||||||
|
label = self.relayLabel(relay)
|
||||||
|
color = self.statusColor(relay)
|
||||||
|
} else {
|
||||||
|
label = self.healthStore.summaryLine
|
||||||
|
color = health.tint
|
||||||
|
}
|
||||||
|
|
||||||
return HStack(spacing: 8) {
|
return HStack(spacing: 8) {
|
||||||
Circle()
|
Circle()
|
||||||
.fill(self.statusColor(status))
|
.fill(color)
|
||||||
.frame(width: 8, height: 8)
|
.frame(width: 8, height: 8)
|
||||||
Text(self.relayLabel(status))
|
Text(label)
|
||||||
.font(.caption.weight(.semibold))
|
.font(.caption.weight(.semibold))
|
||||||
.foregroundStyle(.primary)
|
.foregroundStyle(.primary)
|
||||||
}
|
}
|
||||||
|
|
@ -105,19 +123,6 @@ private struct MenuContent: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
private func statusColor(_ status: RelayProcessManager.Status) -> Color {
|
||||||
switch status {
|
switch status {
|
||||||
case .running: .green
|
case .running: .green
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,15 @@ export default defineConfig({
|
||||||
"@mariozechner/mini-lit/dist/": path.resolve(repoRoot, "node_modules/@mariozechner/mini-lit/dist/"),
|
"@mariozechner/mini-lit/dist/": path.resolve(repoRoot, "node_modules/@mariozechner/mini-lit/dist/"),
|
||||||
lit: path.resolve(repoRoot, "node_modules/lit/index.js"),
|
lit: path.resolve(repoRoot, "node_modules/lit/index.js"),
|
||||||
"lit/": path.resolve(repoRoot, "node_modules/lit/"),
|
"lit/": path.resolve(repoRoot, "node_modules/lit/"),
|
||||||
lucide: fromRoot("vendor/lucide/dist/esm/lucide.js"),
|
lucide: path.resolve(repoRoot, "node_modules/lucide/dist/esm/lucide.js"),
|
||||||
"pdfjs-dist": fromRoot("vendor/pdfjs-dist/build/pdf.mjs"),
|
"pdfjs-dist": fromRoot("vendor/pdfjs-dist/build/pdf.mjs"),
|
||||||
"pdfjs-dist/": fromRoot("vendor/pdfjs-dist/"),
|
"pdfjs-dist/": fromRoot("vendor/pdfjs-dist/"),
|
||||||
"pdfjs-dist/build/pdf.worker.min.mjs": fromRoot("vendor/pdfjs-dist/build/pdf.worker.min.mjs"),
|
"pdfjs-dist/build/pdf.worker.min.mjs": fromRoot("vendor/pdfjs-dist/build/pdf.worker.min.mjs"),
|
||||||
"docx-preview": fromRoot("vendor/docx-preview/dist/docx-preview.mjs"),
|
"docx-preview": path.resolve(repoRoot, "node_modules/docx-preview/dist/docx-preview.js"),
|
||||||
jszip: fromRoot("vendor/jszip/dist/jszip.min.js"),
|
jszip: path.resolve(repoRoot, "node_modules/jszip/dist/jszip.min.js"),
|
||||||
"highlight.js": fromRoot("vendor/highlight.js/es/index.js"),
|
"highlight.js": fromRoot("vendor/highlight.js/es/index.js"),
|
||||||
"@lmstudio/sdk": fromRoot("lmstudio-sdk-stub.js"),
|
"@lmstudio/sdk": fromRoot("lmstudio-sdk-stub.js"),
|
||||||
"ollama/browser": fromRoot("vendor/ollama/dist/browser.mjs"),
|
"ollama/browser": path.resolve(repoRoot, "node_modules/ollama/dist/browser.mjs"),
|
||||||
"@sinclair/typebox": fromRoot("vendor/@sinclair/typebox/build/esm/index.mjs"),
|
"@sinclair/typebox": fromRoot("vendor/@sinclair/typebox/build/esm/index.mjs"),
|
||||||
xlsx: fromRoot("vendor/xlsx/xlsx.mjs"),
|
xlsx: fromRoot("vendor/xlsx/xlsx.mjs"),
|
||||||
"whatwg-fetch": fromRoot("whatwg-fetch-stub.js"),
|
"whatwg-fetch": fromRoot("whatwg-fetch-stub.js"),
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -51,7 +51,11 @@
|
||||||
"@types/node": "^24.10.1",
|
"@types/node": "^24.10.1",
|
||||||
"@types/qrcode-terminal": "^0.12.2",
|
"@types/qrcode-terminal": "^0.12.2",
|
||||||
"@vitest/coverage-v8": "^4.0.13",
|
"@vitest/coverage-v8": "^4.0.13",
|
||||||
|
"docx-preview": "^0.3.7",
|
||||||
|
"jszip": "^3.10.1",
|
||||||
"lit": "^3.3.1",
|
"lit": "^3.3.1",
|
||||||
|
"lucide": "^0.556.0",
|
||||||
|
"ollama": "^0.6.3",
|
||||||
"rolldown": "1.0.0-beta.53",
|
"rolldown": "1.0.0-beta.53",
|
||||||
"tsx": "^4.20.6",
|
"tsx": "^4.20.6",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue