feat(macos): move camera setting to General
This commit is contained in:
@@ -186,7 +186,7 @@ enum ControlRequestHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static func cameraEnabled() -> Bool {
|
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(
|
private static func handleCanvasShow(
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ struct DebugSettings: View {
|
|||||||
@AppStorage(modelCatalogReloadKey) private var modelCatalogReloadBump: Int = 0
|
@AppStorage(modelCatalogReloadKey) private var modelCatalogReloadBump: Int = 0
|
||||||
@AppStorage(iconOverrideKey) private var iconOverrideRaw: String = IconOverrideSelection.system.rawValue
|
@AppStorage(iconOverrideKey) private var iconOverrideRaw: String = IconOverrideSelection.system.rawValue
|
||||||
@AppStorage(canvasEnabledKey) private var canvasEnabled: Bool = true
|
@AppStorage(canvasEnabledKey) private var canvasEnabled: Bool = true
|
||||||
@AppStorage(cameraEnabledKey) private var cameraEnabled: Bool = false
|
|
||||||
@AppStorage(deepLinkAgentEnabledKey) private var deepLinkAgentEnabled: Bool = false
|
@AppStorage(deepLinkAgentEnabledKey) private var deepLinkAgentEnabled: Bool = false
|
||||||
@State private var modelsCount: Int?
|
@State private var modelsCount: Int?
|
||||||
@State private var modelsLoading = false
|
@State private var modelsLoading = false
|
||||||
@@ -49,7 +48,6 @@ struct DebugSettings: View {
|
|||||||
self.pathsSection
|
self.pathsSection
|
||||||
self.quickActionsSection
|
self.quickActionsSection
|
||||||
self.canvasSection
|
self.canvasSection
|
||||||
self.cameraSection
|
|
||||||
self.experimentsSection
|
self.experimentsSection
|
||||||
|
|
||||||
Spacer(minLength: 0)
|
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 {
|
private var experimentsSection: some View {
|
||||||
GroupBox("Experiments") {
|
GroupBox("Experiments") {
|
||||||
Grid(alignment: .leadingFirstTextBaseline, horizontalSpacing: 14, verticalSpacing: 10) {
|
Grid(alignment: .leadingFirstTextBaseline, horizontalSpacing: 14, verticalSpacing: 10) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import SwiftUI
|
|||||||
|
|
||||||
struct GeneralSettings: View {
|
struct GeneralSettings: View {
|
||||||
@ObservedObject var state: AppState
|
@ObservedObject var state: AppState
|
||||||
|
@AppStorage(cameraEnabledKey) private var cameraEnabled: Bool = true
|
||||||
@ObservedObject private var healthStore = HealthStore.shared
|
@ObservedObject private var healthStore = HealthStore.shared
|
||||||
@ObservedObject private var gatewayManager = GatewayProcessManager.shared
|
@ObservedObject private var gatewayManager = GatewayProcessManager.shared
|
||||||
// swiftlint:disable:next inclusive_language
|
// swiftlint:disable:next inclusive_language
|
||||||
@@ -58,6 +59,11 @@ struct GeneralSettings: View {
|
|||||||
subtitle: "Allow the agent to show and control the Canvas panel.",
|
subtitle: "Allow the agent to show and control the Canvas panel.",
|
||||||
binding: self.$state.canvasEnabled)
|
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(
|
SettingsToggleRow(
|
||||||
title: "Enable Peekaboo Bridge",
|
title: "Enable Peekaboo Bridge",
|
||||||
subtitle: "Allow signed tools (e.g. `peekaboo`) to drive UI automation via PeekabooBridge.",
|
subtitle: "Allow signed tools (e.g. `peekaboo`) to drive UI automation via PeekabooBridge.",
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ struct SettingsRootView: View {
|
|||||||
enum SettingsTab: CaseIterable {
|
enum SettingsTab: CaseIterable {
|
||||||
case general, tools, sessions, cron, config, instances, voiceWake, permissions, debug, about
|
case general, tools, sessions, cron, config, instances, voiceWake, permissions, debug, about
|
||||||
static let windowWidth: CGFloat = 658 // +10% (tabs fit better)
|
static let windowWidth: CGFloat = 658 // +10% (tabs fit better)
|
||||||
static let windowHeight: CGFloat = 718 // +15%
|
static let windowHeight: CGFloat = 790 // +10%
|
||||||
var title: String {
|
var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
case .general: "General"
|
case .general: "General"
|
||||||
|
|||||||
Reference in New Issue
Block a user