From bcd7f9f00292669617fcdb47f467e724d4c9bd20 Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Mon, 29 Dec 2025 22:09:12 -0800 Subject: [PATCH] fix(conversation-assistant): use SwiftUI openSettings environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace NSApp.sendAction approach with @Environment(\.openSettings) which is the proper way to open Settings in SwiftUI menu bar apps. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../macos/Sources/Views/MenuBarView.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/features/conversation-assistant/macos/Sources/Views/MenuBarView.swift b/features/conversation-assistant/macos/Sources/Views/MenuBarView.swift index c0fddf0b8..747cc5f4f 100644 --- a/features/conversation-assistant/macos/Sources/Views/MenuBarView.swift +++ b/features/conversation-assistant/macos/Sources/Views/MenuBarView.swift @@ -2,6 +2,7 @@ import SwiftUI struct MenuBarView: View { @StateObject private var viewModel = MenuBarViewModel() + @Environment(\.openSettings) private var openSettings var body: some View { VStack(spacing: 0) { @@ -29,7 +30,13 @@ struct MenuBarView: View { // Footer HStack { - Button(action: viewModel.openSettings) { + Button { + // Close popover first, then open settings + if let appDelegate = NSApp.delegate as? AppDelegate { + appDelegate.closePopover() + } + openSettings() + } label: { Image(systemName: "gear") .accessibilityLabel("Settings") }