Skip to content

feat(datagrid): page-size menu, first/last buttons, and jump-to-page in the pagination bar#1408

Merged
datlechin merged 1 commit into
mainfrom
feat/1364-pagination-ui
May 24, 2026
Merged

feat(datagrid): page-size menu, first/last buttons, and jump-to-page in the pagination bar#1408
datlechin merged 1 commit into
mainfrom
feat/1364-pagination-ui

Conversation

@datlechin
Copy link
Copy Markdown
Member

Closes #1364.

Replaces the minimal pagination control (Prev / "N of M" / Next plus a gear popover for limit and offset) with a richer bar for table tabs.

What's new

  • Rows-per-page menu: presets 5, 10, 20, 100, 500, 1,000, plus All rows (with a confirmation) and a Custom size.
  • First / Previous / Next / Last page buttons.
  • Click the page indicator to jump to a specific page.
  • The bar now appears for filtered tables whose total row count is unknown, so you can page through them instead of seeing only the first page. Next stays available while a full page keeps loading; Last and jump-to-page need a known total.
  • First Page and Last Page keyboard actions, unbound by default, assignable in Settings > Keyboard.

Design notes

  • The pagination model and coordinator were already complete, so this is mostly a view rebuild plus a small coordinator addition (goToPage, unknown-total Next, Show All). The table-browse data-loading path is unchanged.
  • Native macOS controls: a borderless pop-up Menu for page size, four borderless SF Symbol buttons for navigation, and a popover with a text field for jump-to-page. macOS has no page-number or page-dots control (per the HIG), so there is no web-style pager.
  • Unknown-total tables use the loaded-row-count signal to decide whether a next page exists, instead of a pageSize + 1 probe, which keeps the data-loading path untouched. Trade-off: a table whose size is an exact multiple of the page size with an unknown total can show one empty page on Next (rare, self-correcting).
  • Default page size stays 1,000.

Tests

  • New PaginationState tests: isLastPageKnown, canGoToNextPage with known and unknown totals, goToNextPage(loadedRowCount:), goToPage guard with an unknown total.
  • New PaginationCoordinatorTests: goToPage routing, and Next/Last behavior on an unknown total.

Notes

  • New user-facing strings use String(localized:); the String Catalog picks them up on the next Xcode build, so Localizable.xcstrings should be committed after building.
  • Not built locally yet; relying on CI / your Xcode build for the compile.

@datlechin datlechin merged commit 6d095b4 into main May 24, 2026
2 checks passed
@datlechin datlechin deleted the feat/1364-pagination-ui branch May 24, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve pagination UI for query results (page navigation, page size selector)

1 participant