From a958a800f50c97b26cb7fc55f2f932c9597e1aec Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Mon, 29 Dec 2025 19:36:12 -0800 Subject: [PATCH] fix(conversation-assistant): settings button now opens settings window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Close popover before opening settings to prevent UI interference - Activate app explicitly (required for menu bar apps to show windows) - Use version-appropriate selector (showSettingsWindow: for macOS 14+, showPreferencesWindow: for macOS 13) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../macos/Sources/ConversationAssistantApp.swift | 6 +++++- .../macos/Sources/Views/MenuBarViewModel.swift | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/features/conversation-assistant/macos/Sources/ConversationAssistantApp.swift b/features/conversation-assistant/macos/Sources/ConversationAssistantApp.swift index 06fc87980..972b355b9 100644 --- a/features/conversation-assistant/macos/Sources/ConversationAssistantApp.swift +++ b/features/conversation-assistant/macos/Sources/ConversationAssistantApp.swift @@ -1,5 +1,5 @@ -import SwiftUI import AppKit +import SwiftUI @main struct ConversationAssistantApp: App { @@ -95,4 +95,8 @@ class AppDelegate: NSObject, NSApplicationDelegate { } } } + + func closePopover() { + popover?.close() + } } diff --git a/features/conversation-assistant/macos/Sources/Views/MenuBarViewModel.swift b/features/conversation-assistant/macos/Sources/Views/MenuBarViewModel.swift index 12c467cd3..3d76b516e 100644 --- a/features/conversation-assistant/macos/Sources/Views/MenuBarViewModel.swift +++ b/features/conversation-assistant/macos/Sources/Views/MenuBarViewModel.swift @@ -1,5 +1,5 @@ -import SwiftUI import Combine +import SwiftUI @MainActor class MenuBarViewModel: ObservableObject { @@ -133,7 +133,18 @@ class MenuBarViewModel: ObservableObject { } func openSettings() { - NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil) + // Close the popover first + if let appDelegate = NSApp.delegate as? AppDelegate { + appDelegate.closePopover() + } + // Activate the app (required for menu bar apps to show settings) + NSApp.activate(ignoringOtherApps: true) + // Open settings window - use the modern selector + if #available(macOS 14, *) { + NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil) + } else if #available(macOS 13, *) { + NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil) + } } private func updateLastSyncText(_ date: Date?) {