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:
parent
90592ffab1
commit
e7b042d330
1 changed files with 20 additions and 6 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue