macOS client overlays, menus and notifications

This commit is contained in:
Ian Gulliver
2026-10-17 08:24:22 -07:00
parent b43cffab6d
commit 38d56139c3
17 changed files with 1297 additions and 101 deletions
+26
View File
@@ -8,6 +8,14 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
var connection: Connection?
private var quitting = false
func applicationDidFinishLaunching(_ notification: Notification) {
Notifier.shared.install()
}
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
false
}
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
guard let store = connection?.store, !quitting else {
return .terminateNow
@@ -57,6 +65,24 @@ struct ByreApp: App {
}
}
PasteboardCommands()
CommandMenu("Go") {
goButton("Switch Task", "k")
goButton("Project", "p")
goButton("Lead", "l")
goButton("Merge", "s")
Divider()
goButton("Keyboard Shortcuts", "/")
}
}
}
private func goButton(_ label: String, _ key: String) -> some View {
Button(label) {
if let store = connection.store {
runGo(key, store, overlays)
}
}
.keyboardShortcut(KeyEquivalent(Character(key)))
.disabled(connection.store == nil || overlays.isOpen)
}
}