From 121c9bd6f357b4bf0fec462a9bec096dbd0f5bf6 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 05:42:06 +0000 Subject: [PATCH] style: run swift lint/format --- apps/macos/Sources/Clawdbot/AppState.swift | 1 - apps/macos/Sources/Clawdbot/ConfigSettings.swift | 8 ++++++++ .../Sources/Clawdbot/GatewayLaunchAgentManager.swift | 7 ++++--- apps/macos/Sources/Clawdbot/MenuSessionsInjector.swift | 10 ++++++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/apps/macos/Sources/Clawdbot/AppState.swift b/apps/macos/Sources/Clawdbot/AppState.swift index 81d66ddc3..1321ee0ab 100644 --- a/apps/macos/Sources/Clawdbot/AppState.swift +++ b/apps/macos/Sources/Clawdbot/AppState.swift @@ -612,7 +612,6 @@ enum AppStateStore { static var canvasEnabled: Bool { UserDefaults.standard.object(forKey: canvasEnabledKey) as? Bool ?? true } - } @MainActor diff --git a/apps/macos/Sources/Clawdbot/ConfigSettings.swift b/apps/macos/Sources/Clawdbot/ConfigSettings.swift index abf7b4d0b..dac397822 100644 --- a/apps/macos/Sources/Clawdbot/ConfigSettings.swift +++ b/apps/macos/Sources/Clawdbot/ConfigSettings.swift @@ -70,7 +70,9 @@ struct ConfigSettings: View { self.allowAutosave = true } } +} +extension ConfigSettings { private var content: some View { VStack(alignment: .leading, spacing: 14) { self.header @@ -461,7 +463,9 @@ struct ConfigSettings: View { } .padding(.top, 2) } +} +extension ConfigSettings { private func loadConfig() async { let parsed = await ConfigStore.load() let agents = parsed["agents"] as? [String: Any] @@ -639,7 +643,9 @@ struct ConfigSettings: View { return error.localizedDescription } } +} +extension ConfigSettings { private var browserColor: Color { let raw = self.browserColorHex.trimmingCharacters(in: .whitespacesAndNewlines) let hex = raw.hasPrefix("#") ? String(raw.dropFirst()) : raw @@ -736,7 +742,9 @@ struct ConfigSettings: View { if host == "::1" { return true } return false } +} +extension ConfigSettings { private func loadModels() async { guard !self.modelsLoading else { return } self.modelsLoading = true diff --git a/apps/macos/Sources/Clawdbot/GatewayLaunchAgentManager.swift b/apps/macos/Sources/Clawdbot/GatewayLaunchAgentManager.swift index 18b2471fc..e49b3d3f1 100644 --- a/apps/macos/Sources/Clawdbot/GatewayLaunchAgentManager.swift +++ b/apps/macos/Sources/Clawdbot/GatewayLaunchAgentManager.swift @@ -12,10 +12,11 @@ enum GatewayLaunchAgentManager { var errorDescription: String? { switch self { case let .message(message): - return message + message } } } + private static var plistURL: URL { FileManager.default.homeDirectoryForCurrentUser .appendingPathComponent("Library/LaunchAgents/\(gatewayLaunchdLabel).plist") @@ -28,8 +29,8 @@ enum GatewayLaunchAgentManager { private static func gatewayProgramArguments( port: Int, - bind: String, - ) -> Result<[String], GatewayProgramArgumentsError> { + bind: String) -> Result<[String], GatewayProgramArgumentsError> + { let projectRoot = CommandResolver.projectRoot() #if DEBUG if let localBin = CommandResolver.projectClawdbotExecutable(projectRoot: projectRoot) { diff --git a/apps/macos/Sources/Clawdbot/MenuSessionsInjector.swift b/apps/macos/Sources/Clawdbot/MenuSessionsInjector.swift index 732d0114b..d7385014b 100644 --- a/apps/macos/Sources/Clawdbot/MenuSessionsInjector.swift +++ b/apps/macos/Sources/Clawdbot/MenuSessionsInjector.swift @@ -99,7 +99,9 @@ final class MenuSessionsInjector: NSObject, NSMenuDelegate { } return NSRect.zero } +} +extension MenuSessionsInjector { // MARK: - Injection private func inject(into menu: NSMenu) { @@ -508,7 +510,9 @@ final class MenuSessionsInjector: NSObject, NSMenuDelegate { item.view = self.makeHostedView(rootView: view, width: width, highlighted: false) return item } +} +extension MenuSessionsInjector { // MARK: - Cache private func refreshCache(force: Bool) async { @@ -579,7 +583,9 @@ final class MenuSessionsInjector: NSObject, NSMenuDelegate { } return "Sessions unavailable" } +} +extension MenuSessionsInjector { // MARK: - Submenus private func buildSubmenu(for row: SessionRow, storePath: String) -> NSMenu { @@ -911,7 +917,9 @@ final class MenuSessionsInjector: NSObject, NSMenuDelegate { NSPasteboard.general.clearContents() NSPasteboard.general.setString(value, forType: .string) } +} +extension MenuSessionsInjector { // MARK: - Width + placement private func findInsertIndex(in menu: NSMenu) -> Int? { @@ -987,7 +995,9 @@ final class MenuSessionsInjector: NSObject, NSMenuDelegate { return lhsName < rhsName } } +} +extension MenuSessionsInjector { // MARK: - Views private func makeHostedView(rootView: AnyView, width: CGFloat, highlighted: Bool) -> NSView {