feat(macos): surface session activity in menu bar

This commit is contained in:
Peter Steinberger
2025-12-09 01:28:16 +01:00
parent 73cc34467a
commit 6b10f4241d
10 changed files with 505 additions and 38 deletions

View File

@@ -5,6 +5,7 @@ import UniformTypeIdentifiers
struct DebugSettings: View {
@AppStorage(modelCatalogPathKey) private var modelCatalogPath: String = ModelCatalogLoader.defaultPath
@AppStorage(modelCatalogReloadKey) private var modelCatalogReloadBump: Int = 0
@AppStorage(iconOverrideKey) private var iconOverrideRaw: String = IconOverrideSelection.system.rawValue
@State private var modelsCount: Int?
@State private var modelsLoading = false
@State private var modelsError: String?
@@ -26,6 +27,15 @@ struct DebugSettings: View {
Text(self.healthStore.summaryLine)
}
}
LabeledContent("Icon override") {
Picker("Icon override", selection: self.bindingOverride) {
ForEach(IconOverrideSelection.allCases) { option in
Text(option.label).tag(option.rawValue)
}
}
.labelsHidden()
.frame(maxWidth: 280)
}
LabeledContent("CLI helper") {
let loc = CLIInstaller.installedLocation()
Text(loc ?? "missing")
@@ -403,6 +413,20 @@ struct DebugSettings: View {
}
}
private var bindingOverride: Binding<String> {
Binding {
self.iconOverrideRaw
} set: { newValue in
self.iconOverrideRaw = newValue
if let selection = IconOverrideSelection(rawValue: newValue) {
Task { @MainActor in
AppStateStore.shared.iconOverride = selection
WorkActivityStore.shared.resolveIconState(override: selection)
}
}
}
}
private func configURL() -> URL {
FileManager.default.homeDirectoryForCurrentUser
.appendingPathComponent(".clawdis")