First public release v2.3.1
This commit is contained in:
@@ -66,24 +66,47 @@ struct oAIApp: App {
|
||||
.defaultSize(width: 1024, height: 800)
|
||||
.windowResizability(.contentMinSize)
|
||||
.commands {
|
||||
// ── Apple menu ────────────────────────────────────────────────
|
||||
CommandGroup(replacing: .appInfo) {
|
||||
Button("About oAI") {
|
||||
showAbout = true
|
||||
}
|
||||
Button("About oAI") { showAbout = true }
|
||||
}
|
||||
|
||||
CommandGroup(replacing: .appSettings) {
|
||||
Button("Settings...") {
|
||||
chatViewModel.showSettings = true
|
||||
}
|
||||
.keyboardShortcut(",", modifiers: .command)
|
||||
Button("Settings…") { chatViewModel.showSettings = true }
|
||||
.keyboardShortcut(",", modifiers: .command)
|
||||
}
|
||||
|
||||
CommandGroup(replacing: .help) {
|
||||
Button("oAI Help") {
|
||||
openHelp()
|
||||
// ── File menu ─────────────────────────────────────────────────
|
||||
// Replacing .newItem removes the auto-added "New Window" entry
|
||||
CommandGroup(replacing: .newItem) {
|
||||
Button("New Chat") { chatViewModel.newConversation() }
|
||||
.keyboardShortcut("n", modifiers: .command)
|
||||
}
|
||||
|
||||
CommandGroup(after: .newItem) {
|
||||
Button("Open Chat…") { chatViewModel.showConversations = true }
|
||||
.keyboardShortcut("o", modifiers: .command)
|
||||
}
|
||||
|
||||
CommandGroup(replacing: .saveItem) {
|
||||
Button("Save Chat") { chatViewModel.saveFromMenu() }
|
||||
.keyboardShortcut("s", modifiers: [.command, .shift])
|
||||
.disabled(chatViewModel.messages.filter { $0.role != .system }.isEmpty)
|
||||
}
|
||||
|
||||
CommandGroup(after: .importExport) {
|
||||
Button("Export as Markdown…") {
|
||||
let name = chatViewModel.currentConversationName ?? "conversation"
|
||||
let safe = name.components(separatedBy: .whitespacesAndNewlines).joined(separator: "-")
|
||||
chatViewModel.exportConversation(format: "md", filename: "\(safe).md")
|
||||
}
|
||||
.keyboardShortcut("?", modifiers: .command)
|
||||
.disabled(chatViewModel.messages.filter { $0.role != .system }.isEmpty)
|
||||
}
|
||||
|
||||
// ── Help menu ─────────────────────────────────────────────────
|
||||
CommandGroup(replacing: .help) {
|
||||
Button("oAI Help") { openHelp() }
|
||||
.keyboardShortcut("?", modifiers: .command)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user