fix(conversation-assistant): settings button now opens settings window

- 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 <noreply@anthropic.com>
This commit is contained in:
Quinn Ftw 2025-12-29 19:36:12 -08:00
parent 28dbcc5651
commit a958a800f5
2 changed files with 18 additions and 3 deletions

View file

@ -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()
}
}

View file

@ -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?) {