fix(conversation-assistant): version-check for SettingsLink

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 <noreply@anthropic.com>
This commit is contained in:
Quinn Ftw 2025-12-29 22:40:40 -08:00
parent 90592ffab1
commit e7b042d330

View file

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