keyboard shortcut to cycle servers

This commit is contained in:
Ian Gulliver
2026-10-18 21:40:27 -07:00
parent 7b65ff1bb9
commit a367e4bb73
4 changed files with 37 additions and 3 deletions
+12
View File
@@ -110,11 +110,23 @@ struct ByreCommands: Commands {
goButton("Project", "p")
goButton("Lead", "l")
goButton("Merge", "s")
serverButton("Previous Server", "[", -1)
serverButton("Next Server", "]", 1)
Divider()
goButton("Keyboard Shortcuts", "/")
}
}
private func serverButton(_ label: String, _ key: Character, _ step: Int) -> some View {
Button(label) {
if let origin = Servers.shared.step(from: focus?.origin, by: step) {
openWindow(id: "main", value: origin)
}
}
.keyboardShortcut(KeyEquivalent(key))
.disabled(Servers.shared.origins.isEmpty)
}
private func goButton(_ label: String, _ key: String) -> some View {
Button(label) {
if let store = focus?.store, let overlays = focus?.overlays {