From 3729d269d0f9f7ac61cc404417581584c499360e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 14 Dec 2025 03:32:56 +0000 Subject: [PATCH] feat(macos): move camera setting to General --- .../Sources/Clawdis/ControlRequestHandler.swift | 2 +- apps/macos/Sources/Clawdis/DebugSettings.swift | 16 ---------------- apps/macos/Sources/Clawdis/GeneralSettings.swift | 6 ++++++ .../macos/Sources/Clawdis/SettingsRootView.swift | 2 +- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/apps/macos/Sources/Clawdis/ControlRequestHandler.swift b/apps/macos/Sources/Clawdis/ControlRequestHandler.swift index e17dddafa..42b4e4b3d 100644 --- a/apps/macos/Sources/Clawdis/ControlRequestHandler.swift +++ b/apps/macos/Sources/Clawdis/ControlRequestHandler.swift @@ -186,7 +186,7 @@ enum ControlRequestHandler { } private static func cameraEnabled() -> Bool { - UserDefaults.standard.object(forKey: cameraEnabledKey) as? Bool ?? false + UserDefaults.standard.object(forKey: cameraEnabledKey) as? Bool ?? true } private static func handleCanvasShow( diff --git a/apps/macos/Sources/Clawdis/DebugSettings.swift b/apps/macos/Sources/Clawdis/DebugSettings.swift index abd5d0e44..6b79e24b7 100644 --- a/apps/macos/Sources/Clawdis/DebugSettings.swift +++ b/apps/macos/Sources/Clawdis/DebugSettings.swift @@ -9,7 +9,6 @@ struct DebugSettings: View { @AppStorage(modelCatalogReloadKey) private var modelCatalogReloadBump: Int = 0 @AppStorage(iconOverrideKey) private var iconOverrideRaw: String = IconOverrideSelection.system.rawValue @AppStorage(canvasEnabledKey) private var canvasEnabled: Bool = true - @AppStorage(cameraEnabledKey) private var cameraEnabled: Bool = false @AppStorage(deepLinkAgentEnabledKey) private var deepLinkAgentEnabled: Bool = false @State private var modelsCount: Int? @State private var modelsLoading = false @@ -49,7 +48,6 @@ struct DebugSettings: View { self.pathsSection self.quickActionsSection self.canvasSection - self.cameraSection self.experimentsSection Spacer(minLength: 0) @@ -573,20 +571,6 @@ struct DebugSettings: View { } } - private var cameraSection: some View { - GroupBox("Camera") { - VStack(alignment: .leading, spacing: 10) { - Toggle("Allow Camera (agent)", isOn: self.$cameraEnabled) - .toggleStyle(.checkbox) - .help("When off, camera requests return “Camera disabled by user”.") - - Text("Allows Clawdis to capture a photo or short video via the built-in camera.") - .font(.caption) - .foregroundStyle(.secondary) - } - } - } - private var experimentsSection: some View { GroupBox("Experiments") { Grid(alignment: .leadingFirstTextBaseline, horizontalSpacing: 14, verticalSpacing: 10) { diff --git a/apps/macos/Sources/Clawdis/GeneralSettings.swift b/apps/macos/Sources/Clawdis/GeneralSettings.swift index 8e9cf1382..9dda12dfa 100644 --- a/apps/macos/Sources/Clawdis/GeneralSettings.swift +++ b/apps/macos/Sources/Clawdis/GeneralSettings.swift @@ -3,6 +3,7 @@ import SwiftUI struct GeneralSettings: View { @ObservedObject var state: AppState + @AppStorage(cameraEnabledKey) private var cameraEnabled: Bool = true @ObservedObject private var healthStore = HealthStore.shared @ObservedObject private var gatewayManager = GatewayProcessManager.shared // swiftlint:disable:next inclusive_language @@ -58,6 +59,11 @@ struct GeneralSettings: View { subtitle: "Allow the agent to show and control the Canvas panel.", binding: self.$state.canvasEnabled) + SettingsToggleRow( + title: "Allow Camera", + subtitle: "Allow the agent to capture a photo or short video via the built-in camera.", + binding: self.$cameraEnabled) + SettingsToggleRow( title: "Enable Peekaboo Bridge", subtitle: "Allow signed tools (e.g. `peekaboo`) to drive UI automation via PeekabooBridge.", diff --git a/apps/macos/Sources/Clawdis/SettingsRootView.swift b/apps/macos/Sources/Clawdis/SettingsRootView.swift index f20699012..34b86f6b6 100644 --- a/apps/macos/Sources/Clawdis/SettingsRootView.swift +++ b/apps/macos/Sources/Clawdis/SettingsRootView.swift @@ -126,7 +126,7 @@ struct SettingsRootView: View { enum SettingsTab: CaseIterable { case general, tools, sessions, cron, config, instances, voiceWake, permissions, debug, about static let windowWidth: CGFloat = 658 // +10% (tabs fit better) - static let windowHeight: CGFloat = 718 // +15% + static let windowHeight: CGFloat = 790 // +10% var title: String { switch self { case .general: "General"