Skip to content

Commit dd2f1c6

Browse files
authored
feat(coordinator): add result pagination to the Query menu for keyboard access (#1490) (#1514)
1 parent 7e509b8 commit dd2f1c6

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Previous Page, Next Page, First Page, and Last Page are now in the Query menu, so the result pager is discoverable and keyboard-reachable from the menu bar (Previous and Next keep their Cmd+[ and Cmd+] shortcuts). (#1490)
1213
- Keyboard control of the sidebar: focus the filter field (Cmd+Option+F), and switch between the Tables and Favorites sidebars (Ctrl+1 and Ctrl+2). From the filter field, Tab or the Down arrow moves into the list. All three are rebindable in Settings, Keyboard. (#1490)
1314
- Mark a table as a favorite by clicking the star button at the end of its sidebar row. Favorites are scoped to the connection, database, and schema, pinned to the top of their section, appear in a dedicated Tables group in the Favorites tab, and sync through iCloud when the Table Favorites toggle is on.
1415
- A plus button in the bottom bar of the Tables sidebar opens a menu to create a new table or view, without right-clicking. It's disabled while safe mode blocks writes.

TablePro/TableProApp.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,32 @@ struct AppMenuCommands: Commands {
427427

428428
Divider()
429429

430+
Button(String(localized: "Previous Page")) {
431+
actions?.goToPreviousPage()
432+
}
433+
.optionalKeyboardShortcut(shortcut(for: .previousPage))
434+
.disabled(!(actions?.isConnected ?? false))
435+
436+
Button(String(localized: "Next Page")) {
437+
actions?.goToNextPage()
438+
}
439+
.optionalKeyboardShortcut(shortcut(for: .nextPage))
440+
.disabled(!(actions?.isConnected ?? false))
441+
442+
Button(String(localized: "First Page")) {
443+
actions?.goToFirstPage()
444+
}
445+
.optionalKeyboardShortcut(shortcut(for: .firstPage))
446+
.disabled(!(actions?.isConnected ?? false))
447+
448+
Button(String(localized: "Last Page")) {
449+
actions?.goToLastPage()
450+
}
451+
.optionalKeyboardShortcut(shortcut(for: .lastPage))
452+
.disabled(!(actions?.isConnected ?? false))
453+
454+
Divider()
455+
430456
Button(String(localized: "Save as Favorite")) {
431457
actions?.saveAsFavorite()
432458
}

TablePro/Views/Main/MainContentCommandActions.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,22 @@ final class MainContentCommandActions {
783783
coordinator?.inspectorProxy?.toggleInspector()
784784
}
785785

786+
func goToPreviousPage() {
787+
coordinator?.goToPreviousPage()
788+
}
789+
790+
func goToNextPage() {
791+
coordinator?.goToNextPage()
792+
}
793+
794+
func goToFirstPage() {
795+
coordinator?.goToFirstPage()
796+
}
797+
798+
func goToLastPage() {
799+
coordinator?.goToLastPage()
800+
}
801+
786802
func focusSidebarSearch() {
787803
coordinator?.splitViewController?.focusSidebarSearch()
788804
}

0 commit comments

Comments
 (0)