diff --git a/TablePro/Views/Connection/WelcomeWindowView.swift b/TablePro/Views/Connection/WelcomeWindowView.swift index a295c41b..c3793e18 100644 --- a/TablePro/Views/Connection/WelcomeWindowView.swift +++ b/TablePro/Views/Connection/WelcomeWindowView.swift @@ -115,6 +115,7 @@ struct WelcomeWindowView: View { .frame(minWidth: 650, minHeight: 400) .onAppear { loadConnections() + focus = .search } .confirmationDialog( connectionsToDelete.count == 1 @@ -241,6 +242,7 @@ struct WelcomeWindowView: View { // Footer hints HStack(spacing: 16) { SyncStatusIndicator() + KeyboardHint(keys: "↵", label: "Connect") KeyboardHint(keys: "⌘N", label: "New") KeyboardHint(keys: "⌘,", label: "Settings") } @@ -302,6 +304,13 @@ struct WelcomeWindowView: View { connectSelectedConnections() return .handled } + .onKeyPress(.escape) { + if !searchText.isEmpty { + searchText = "" + } + focus = .connectionList + return .handled + } .onKeyPress(characters: .init(charactersIn: "\u{7F}\u{08}"), phases: .down) { keyPress in guard keyPress.modifiers.contains(.command) else { return .ignored } let toDelete = selectedConnections @@ -418,6 +427,17 @@ struct WelcomeWindowView: View { showDeleteConfirmation = true return .handled } + .onKeyPress(characters: .init(charactersIn: "a"), phases: .down) { keyPress in + guard keyPress.modifiers.contains(.command) else { return .ignored } + selectedConnectionIds = Set(flatVisibleConnections.map(\.id)) + return .handled + } + .onKeyPress(.escape) { + if !selectedConnectionIds.isEmpty { + selectedConnectionIds = [] + } + return .handled + } .onKeyPress(characters: .init(charactersIn: "jn"), phases: [.down, .repeat]) { keyPress in guard keyPress.modifiers.contains(.control) else { return .ignored } moveToNextConnection() @@ -663,9 +683,8 @@ struct WelcomeWindowView: View { } label: { HStack { if !group.color.isDefault { - Circle() - .fill(group.color.color) - .frame(width: 8, height: 8) + Image(systemName: "circle.fill") + .foregroundStyle(group.color.color) } Text(group.name) if currentGroupId == group.id {