Skip to content

refactor(datagrid): merge the row count into the page-size control and regroup the bottom bar#1721

Closed
datlechin wants to merge 2 commits into
mainfrom
worktree-statusbar-redesign
Closed

refactor(datagrid): merge the row count into the page-size control and regroup the bottom bar#1721
datlechin wants to merge 2 commits into
mainfrom
worktree-statusbar-redesign

Conversation

@datlechin

Copy link
Copy Markdown
Member

What

Redesign the data view bottom bar so the row count, page size, and pagination read as one group, and fix the ambiguous page-size label.

Before, the bar split into three zones with two Spacers, stranding the row count in dead center, and the page-size menu showed a bare 1.000 (locale grouping for one thousand) with no unit.

Changes

  • Merged the row count into the page-size control. Clicking the range (1-1,000 of ~111,559) opens the rows-per-page menu, so the count sits next to the controls that change it. This is the DataGrip pattern; it also matches how TablePlus, Postico 2, and Sequel Ace anchor the count to the pager.
  • Fixed the ambiguous page-size value. Menu items render with .grouping(.never) (1000, never 1.000). The total keeps locale grouping, which is correct for a measured quantity.
  • Regrouped the trailing controls by function with a divider between grid actions (Add / Columns / Filters) and data navigation, shown only when both groups are present.
  • Kept the Data / Structure / JSON switcher bottom-left (the confirmed native DB-client convention).
  • Fixed a latent dangling · separator that would have appeared once the range left the status text on a table tab carrying a status message.

Layout

[ Data | Structure | JSON ] ──── [Add] [Columns] [Filters] │ [ 1-1,000 of ~111,559 ⌄ ]  ‹‹ ‹ 1/112 › ››

Tests

  • New PaginationStateDisplayTests: rangeText including the previously-untested approximate-count ~ path, and a guarantee that page-size labels never carry a grouping separator (locale-independent).
  • Updated StatusBarSnapshotTests for the statusText refactor (range now deferred to the pagination control).

Notes

  • View-layer only; no model changes to StatusBarSnapshot or PaginationState.
  • SwiftLint --strict clean on changed files.
  • Docs (data-grid.mdx) and CHANGELOG updated.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8aa7a9f85f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
if currentPage > 1 || loadedRowCount >= pageSize {
let end = currentOffset + loadedRowCount
return String(format: String(localized: "%d-%d of ? rows"), rangeStart, end)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard empty unknown-total pages before formatting ranges

When an unknown-total table advances from a full page to a later page that returns no rows, currentPage > 1 is still true but loadedRowCount is 0, so this formats an inverted label such as 51-50 of ? rows in the page-size menu. That path is reachable because unknown totals allow Next whenever the previous page was full, and the old status text was hidden when snapshot.hasRows was false; clamp/suppress the range until rows are loaded or show an empty-page state instead.

Useful? React with 👍 / 👎.

@datlechin datlechin closed this Jun 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27ac81ab75

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
@ViewBuilder
private func dataNavigationGroup(status: String?) -> some View {
if showsDataNavigation(status) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Suppress row status for no-result statements

When a query statement has no result columns, MainEditorContentView.resultsSection still renders statusBar(tab:) under ResultSuccessView; with the new unguarded data-navigation path, statusText becomes "No rows" for the empty TableRows, so INSERT/UPDATE/DDL successes now show a misleading No rows footer beside the rows-affected/status result. Please keep this status cluster gated to real result grids, e.g. require snapshot.hasColumns/snapshot.hasRows as appropriate before rendering the row status.

Useful? React with 👍 / 👎.

@mintlify

mintlify Bot commented Jun 18, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
TablePro 🟢 Ready View Preview Jun 18, 2026, 5:50 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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.

1 participant