feat: turn Sst into a regular Mac app with settings, menus and menu bar item
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import SwiftUI
|
||||
|
||||
struct AppCommands: Commands {
|
||||
@ObservedObject var model: AppModel
|
||||
@Environment(\.openWindow) private var openWindow
|
||||
|
||||
var body: some Commands {
|
||||
CommandGroup(after: .pasteboard) {
|
||||
Divider()
|
||||
Button(Strings.clearHistory) {
|
||||
openWindow(id: "main")
|
||||
model.confirmingClearHistory = true
|
||||
}
|
||||
}
|
||||
CommandMenu(Strings.recordingMenu) {
|
||||
Button(model.isRecording ? Strings.stopRecording : Strings.startRecording) {
|
||||
model.toggleWindowRecording()
|
||||
}
|
||||
.keyboardShortcut("r", modifiers: [.command, .option])
|
||||
Divider()
|
||||
Button(Strings.transcripts) { show(.transcripts) }
|
||||
.keyboardShortcut("1", modifiers: .command)
|
||||
Button(Strings.dictionary) { show(.dictionary) }
|
||||
.keyboardShortcut("2", modifiers: .command)
|
||||
Button(Strings.search) {
|
||||
show(.transcripts)
|
||||
model.focusSearch()
|
||||
}
|
||||
.keyboardShortcut("f", modifiers: .command)
|
||||
}
|
||||
}
|
||||
|
||||
private func show(_ section: AppModel.Section) {
|
||||
openWindow(id: "main")
|
||||
model.show(section)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user