refactor(datagrid): merge the row count into the page-size control and regroup the bottom bar#1721
refactor(datagrid): merge the row count into the page-size control and regroup the bottom bar#1721datlechin wants to merge 2 commits into
Conversation
…d regroup the bottom bar
There was a problem hiding this comment.
💡 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) |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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) { |
There was a problem hiding this comment.
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 👍 / 👎.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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 bare1.000(locale grouping for one thousand) with no unit.Changes
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..grouping(.never)(1000, never1.000). The total keeps locale grouping, which is correct for a measured quantity.·separator that would have appeared once the range left the status text on a table tab carrying a status message.Layout
Tests
PaginationStateDisplayTests:rangeTextincluding the previously-untested approximate-count~path, and a guarantee that page-size labels never carry a grouping separator (locale-independent).StatusBarSnapshotTestsfor thestatusTextrefactor (range now deferred to the pagination control).Notes
StatusBarSnapshotorPaginationState.--strictclean on changed files.data-grid.mdx) and CHANGELOG updated.