From 98ea7831c35eb1344486c659e226caf19e84c5d7 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Sat, 30 May 2026 14:15:58 +0700 Subject: [PATCH] feat(coordinator): add result pagination to the Query menu for keyboard access (#1490) --- CHANGELOG.md | 1 + TablePro/TableProApp.swift | 26 +++++++++++++++++++ .../Main/MainContentCommandActions.swift | 16 ++++++++++++ 3 files changed, 43 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8105d916..183a6e66c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- 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) - 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) - 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. - 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. diff --git a/TablePro/TableProApp.swift b/TablePro/TableProApp.swift index 4c983ea45..e81dd41af 100644 --- a/TablePro/TableProApp.swift +++ b/TablePro/TableProApp.swift @@ -427,6 +427,32 @@ struct AppMenuCommands: Commands { Divider() + Button(String(localized: "Previous Page")) { + actions?.goToPreviousPage() + } + .optionalKeyboardShortcut(shortcut(for: .previousPage)) + .disabled(!(actions?.isConnected ?? false)) + + Button(String(localized: "Next Page")) { + actions?.goToNextPage() + } + .optionalKeyboardShortcut(shortcut(for: .nextPage)) + .disabled(!(actions?.isConnected ?? false)) + + Button(String(localized: "First Page")) { + actions?.goToFirstPage() + } + .optionalKeyboardShortcut(shortcut(for: .firstPage)) + .disabled(!(actions?.isConnected ?? false)) + + Button(String(localized: "Last Page")) { + actions?.goToLastPage() + } + .optionalKeyboardShortcut(shortcut(for: .lastPage)) + .disabled(!(actions?.isConnected ?? false)) + + Divider() + Button(String(localized: "Save as Favorite")) { actions?.saveAsFavorite() } diff --git a/TablePro/Views/Main/MainContentCommandActions.swift b/TablePro/Views/Main/MainContentCommandActions.swift index e2b6f4224..b2008d97c 100644 --- a/TablePro/Views/Main/MainContentCommandActions.swift +++ b/TablePro/Views/Main/MainContentCommandActions.swift @@ -783,6 +783,22 @@ final class MainContentCommandActions { coordinator?.inspectorProxy?.toggleInspector() } + func goToPreviousPage() { + coordinator?.goToPreviousPage() + } + + func goToNextPage() { + coordinator?.goToNextPage() + } + + func goToFirstPage() { + coordinator?.goToFirstPage() + } + + func goToLastPage() { + coordinator?.goToLastPage() + } + func focusSidebarSearch() { coordinator?.splitViewController?.focusSidebarSearch() }