From e7b042d33041931b1a2fe43d466f5243a6e4d787 Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Mon, 29 Dec 2025 22:40:40 -0800 Subject: [PATCH] fix(conversation-assistant): version-check for SettingsLink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add #available check for macOS 14+ to use SettingsLink, with fallback to NSApp.sendAction for macOS 13. This fixes the build on older targets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../macos/Sources/Views/MenuBarView.swift | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/features/conversation-assistant/macos/Sources/Views/MenuBarView.swift b/features/conversation-assistant/macos/Sources/Views/MenuBarView.swift index 7cde10cb7..057fa4340 100644 --- a/features/conversation-assistant/macos/Sources/Views/MenuBarView.swift +++ b/features/conversation-assistant/macos/Sources/Views/MenuBarView.swift @@ -29,13 +29,27 @@ struct MenuBarView: View { // Footer HStack { - // SettingsLink automatically opens the Settings scene (macOS 13+) - // The popover closes automatically due to .transient behavior - SettingsLink { - Image(systemName: "gear") - .accessibilityLabel("Settings") + // Open Settings - use SettingsLink on macOS 14+, fallback to NSApp.sendAction + if #available(macOS 14, *) { + SettingsLink { + Image(systemName: "gear") + .accessibilityLabel("Settings") + } + .buttonStyle(.borderless) + } else { + Button { + // Close popover first + if let appDelegate = NSApp.delegate as? AppDelegate { + appDelegate.closePopover() + } + NSApp.activate(ignoringOtherApps: true) + NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil) + } label: { + Image(systemName: "gear") + .accessibilityLabel("Settings") + } + .buttonStyle(.borderless) } - .buttonStyle(.borderless) Spacer()