diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 30dab0f17b..7e0b4323fb 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -14109,26 +14109,30 @@ function openGridSnapshot() { count: result.rows.length, }) }} - {{ t(totalRowCountLabelKey, { count: displayedTotalRowCount }) }} + + + + + {{ t(totalRowCountLabelKey, { count: displayedTotalRowCount }) }} {{ t("grid.totalRowCountLoading") }} - (truncated) {{ t("grid.rowsAffected", { count: result.affected_rows }) }} diff --git a/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts b/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts index 7eb4fdf627..bb4ef83f82 100644 --- a/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts +++ b/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts @@ -12,7 +12,7 @@ const statusRenderSource = (() => { })(); const rerunBranch = (() => { - const start = statusRenderSource.indexOf("} else if ($setup.showRerunTotalCountAction) {"); + const start = statusRenderSource.indexOf("$setup.showRerunTotalCountAction && !($setup.totalRowCountBusy && !$setup.manualTotalRowCountLoading)"); return start === -1 ? "" : statusRenderSource.slice(start, statusRenderSource.indexOf("", start)); })(); @@ -48,19 +48,21 @@ describe("DataGrid rerun total row count action", () => { expect(showDataGridRerunTotalCountAction({ canCalculateTotalRowCount: true, displayedTotalRowCount: NaN, totalRowCountIsExact: true })).toBe(false); }); - it("keeps the numeric total outside the action chain and orders busy, inline link, then rerun icon", () => { + it("places the rerun icon before the numeric total and keeps the other actions ordered", () => { const numericTotal = statusRenderSource.indexOf('typeof $setup.displayedTotalRowCount === "number" && $setup.displayedTotalRowCount >= 0'); + const rerunAction = statusRenderSource.indexOf("$setup.showRerunTotalCountAction && !($setup.totalRowCountBusy && !$setup.manualTotalRowCountLoading)"); const busyBranch = statusRenderSource.indexOf("if ($setup.totalRowCountBusy && !($setup.showRerunTotalCountAction && $setup.manualTotalRowCountLoading)) {"); const inlineLink = statusRenderSource.indexOf("} else if ($setup.showExactTotalCountAction) {"); - const rerunAction = statusRenderSource.indexOf("} else if ($setup.showRerunTotalCountAction) {"); expect(numericTotal).toBeGreaterThan(-1); + expect(rerunAction).toBeGreaterThan(-1); + expect(rerunAction).toBeLessThan(numericTotal); expect(busyBranch).toBeGreaterThan(numericTotal); expect(inlineLink).toBeGreaterThan(busyBranch); - expect(rerunAction).toBeGreaterThan(inlineLink); }); it("renders a spaced rerun icon labelled for the total-count action and disabled while counting", () => { - expect(rerunBranch).toContain('