fix(conversation-assistant): use SwiftUI openSettings environment
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 <noreply@anthropic.com>
This commit is contained in:
parent
703a6637f6
commit
bcd7f9f002
1 changed files with 8 additions and 1 deletions
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue