Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions TablePro/Views/Connection/WelcomeWindowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ struct WelcomeWindowView: View {
.frame(minWidth: 650, minHeight: 400)
.onAppear {
loadConnections()
focus = .search
}
.confirmationDialog(
connectionsToDelete.count == 1
Expand Down Expand Up @@ -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")
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down
Loading