From c0abc26fe822426004e2dc805a60c63f0687a440 Mon Sep 17 00:00:00 2001 From: Diego Fabricio Date: Thu, 27 Aug 2026 22:12:41 -0500 Subject: [PATCH] fix(grid): allow rerunning exact total row count from status --- apps/desktop/src/components/grid/DataGrid.vue | 25 +++++++- .../components/grid/DataGridPagination.vue | 2 +- .../grid/__tests__/DataGridSurfaces.spec.ts | 35 ++++++++++++ .../__tests__/DataGridTotalRowCount.spec.ts | 57 ++++++++++++++++++- .../__tests__/ContentArea.outputView.spec.ts | 19 +++++++ .../src/lib/dataGrid/dataGridPagination.ts | 5 ++ packages/app-tests/dataGridPagination.test.ts | 26 +++++++++ 7 files changed, 165 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 06ee9d2a10..4add0d6613 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -38,6 +38,7 @@ import { PanelBottom, PanelRight, RefreshCw, + RefreshCcw, TableProperties, UserRound, Database, @@ -203,7 +204,7 @@ import { isToggleTransposeShortcut, } from "@/lib/editor/keyboardShortcuts"; import { dataGridHeaderContentWidth, scrollbarGutterWidth } from "@/lib/dataGrid/dataGridScrollGutter"; -import { canFetchNextDataGridSegment, canGoNextDataGridPage, dataGridTotalRowCountLabelKey, dataGridTruncationHintKey, hasCompleteLocalDataGridResult, resolveDataGridPaginationTotal, type DataGridInexactTotalRowCountMode } from "@/lib/dataGrid/dataGridPagination"; +import { canFetchNextDataGridSegment, canGoNextDataGridPage, dataGridTotalRowCountLabelKey, dataGridTruncationHintKey, hasCompleteLocalDataGridResult, resolveDataGridPaginationTotal, showDataGridRerunTotalCountAction, type DataGridInexactTotalRowCountMode } from "@/lib/dataGrid/dataGridPagination"; import { dataGridCountQueryOptions } from "@/lib/dataGrid/dataGridQueryOptions"; import { createResultScopedPendingRequests, @@ -3560,6 +3561,13 @@ watch( ); const canCalculateTotalRowCount = computed(() => !!props.countTotalRows || (!!props.connectionId && (!!props.tableMeta || !!props.countSql))); const showExactTotalCountAction = computed(() => canCalculateTotalRowCount.value && (totalRowCountIsExact.value === false || typeof displayedTotalRowCount.value !== "number")); +const showRerunTotalCountAction = computed(() => + showDataGridRerunTotalCountAction({ + canCalculateTotalRowCount: canCalculateTotalRowCount.value, + displayedTotalRowCount: displayedTotalRowCount.value, + totalRowCountIsExact: totalRowCountIsExact.value, + }), +); watch( [ () => @@ -13963,12 +13971,25 @@ function openGridSnapshot() { }) }} {{ t(totalRowCountLabelKey, { count: displayedTotalRowCount }) }} - + {{ t("grid.totalRowCountLoading") }} + (truncated) {{ t("grid.rowsAffected", { count: result.affected_rows }) }} diff --git a/apps/desktop/src/components/grid/DataGridPagination.vue b/apps/desktop/src/components/grid/DataGridPagination.vue index 1c4651e5e0..f26beb770c 100644 --- a/apps/desktop/src/components/grid/DataGridPagination.vue +++ b/apps/desktop/src/components/grid/DataGridPagination.vue @@ -93,7 +93,7 @@ function handlePageInputKeydown(event: KeyboardEvent) { {{ t("grid.rows", { count: selectionSummary.rowCount }) }} - +