Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(grid): make total row count action text-only

zipg846081d58859
diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue
index 14abfac66f..66838b679b 100644
--- a/apps/desktop/src/components/grid/DataGrid.vue
+++ b/apps/desktop/src/components/grid/DataGrid.vue
@@ -47,7 +47,6 @@ import {
ListTree,
Maximize2,
RefreshCw,
- RefreshCcw,
TableProperties,
Network,
UserRound,
@@ -15865,23 +15864,17 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
count: result.rows.length,
})
}}
- <i18n-t v-if="showRerunTotalCountAction && !(totalRowCountBusy && !manualTotalRowCountLoading)" keypath="grid.totalRowCountWithAction" tag="span" class="text-muted-foreground/70">
- <template #button>
- <button
- type="button"
- class="mr-1 inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm align-middle text-muted-foreground/70 hover:bg-gray-200 hover:text-foreground disabled:pointer-events-none disabled:opacity-50 dark:hover:bg-gray-800"
- :disabled="manualTotalRowCountLoading"
- :aria-busy="manualTotalRowCountLoading ? 'true' : undefined"
- :title="manualTotalRowCountLoading ? t('grid.totalRowCountLoading') : t('grid.calculateTotalRows')"
- :aria-label="manualTotalRowCountLoading ? t('grid.totalRowCountLoading') : t('grid.calculateTotalRows')"
- @click="calculateTotalRowCount"
- >
- <Loader2 v-if="manualTotalRowCountLoading" aria-hidden="true" class="h-3 w-3 animate-spin" />
- <RefreshCcw v-else aria-hidden="true" class="h-3 w-3" />
- </button>
- </template>
- <template #count>{{ displayedTotalRowCount }}</template>
- </i18n-t>
+ <button
+ v-if="showRerunTotalCountAction && !(totalRowCountBusy && !manualTotalRowCountLoading)"
+ type="button"
+ class="text-muted-foreground/70 underline underline-offset-2 hover:text-foreground disabled:pointer-events-none disabled:opacity-50"
+ :disabled="manualTotalRowCountLoading"
+ :aria-busy="manualTotalRowCountLoading ? 'true' : undefined"
+ :title="manualTotalRowCountLoading ? t('grid.totalRowCountLoading') : t('grid.calculateTotalRows')"
+ @click="calculateTotalRowCount"
+ >
+ {{ t(totalRowCountLabelKey, { count: displayedTotalRowCount }) }}
+ </button>
<span v-else-if="typeof displayedTotalRowCount === 'number' && displayedTotalRowCount >= 0" class="text-muted-foreground/70">{{ t(totalRowCountLabelKey, { count: displayedTotalRowCount }) }}</span>
<span v-if="totalRowCountBusy && !(showRerunTotalCountAction && manualTotalRowCountLoading)" class="text-muted-foreground/70">
{{ t("grid.totalRowCountLoading") }}
diff --git a/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts b/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts
index bb4ef83f82..3966dd804a 100644
--- a/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts
+++ b/apps/desktop/src/components/grid/__tests__/DataGridTotalRowCount.spec.ts
@@ -48,7 +48,7 @@ describe("DataGrid rerun total row count action", () => {
expect(showDataGridRerunTotalCountAction({ canCalculateTotalRowCount: true, displayedTotalRowCount: NaN, totalRowCountIsExact: true })).toBe(false);
});
- it("places the rerun icon before the numeric total and keeps the other actions ordered", () => {
+ it("places the text action 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)) {");
@@ -60,9 +60,11 @@ describe("DataGrid rerun total row count action", () => {
expect(inlineLink).toBeGreaterThan(busyBranch);
});
- it("renders a spaced rerun icon labelled for the total-count action and disabled while counting", () => {
- expect(statusRenderSource).toContain('keypath: "grid.totalRowCountWithAction"');
- expect(rerunBranch).toContain('<button type="button" class="mr-1 inline-flex h-3.5 w-3.5');
+ it("renders an underlined total-count action and disables it while counting", () => {
+ expect(statusRenderSource).not.toContain('keypath: "grid.totalRowCountWithAction"');
+ expect(rerunBranch).toContain('<button type="button" class="text-muted-foreground/70 underline underline-offset-2');
+ expect(rerunBranch).toContain("$setup.totalRowCountLabelKey");
+ expect(rerunBranch).toContain("$setup.displayedTotalRowCount");
expect(rerunBranch).toContain("disabled:pointer-events-none");
expect(rerunBranch).toContain("disabled:opacity-50");
// title/aria-label toggle between idle and busy copy
@@ -72,12 +74,9 @@ describe("DataGrid rerun total row count action", () => {
expect(rerunBranch).toContain("aria-busy");
});
- it("swaps the rerun icon for a spinner only while the manual count is in flight and hides decorative icons", () => {
- expect(rerunBranch).toContain("if ($setup.manualTotalRowCountLoading) {");
- expect(rerunBranch).toContain("Loader2");
- expect(rerunBranch).toContain("RefreshCcw");
- expect(rerunBranch).toContain("h-3 w-3 animate-spin");
- expect(rerunBranch).toContain("h-3 w-3");
- expect(rerunBranch).toContain("aria-hidden");
+ it("does not render a decorative refresh icon", () => {
+ expect(rerunBranch).not.toContain("Loader2");
+ expect(rerunBranch).not.toContain("RefreshCcw");
+ expect(rerunBranch).not.toContain("Rows3");
});
});
diff --git a/apps/desktop/src/i18n/locales/az.ts b/apps/desktop/src/i18n/locales/az.ts
index 6134b9ffa4..c9900c7715 100644
--- a/apps/desktop/src/i18n/locales/az.ts
+++ b/apps/desktop/src/i18n/locales/az.ts
@@ -1804,7 +1804,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "Yüklənmiş {loaded} sətir kopyalandı (cəmi {total} sətir; nəticə tam yüklənməyib)",
copyPartialRowsHint: "Yüklənmiş {loaded} sətir kopyalandı (nəticə tam yüklənməyib)",
totalRowCount: "(cəmi {count})",
- totalRowCountWithAction: "({button}cəmi {count})",
totalRowCountAtLeast: "(cəmi ən azı {count})",
totalRowCountEstimated: "(~{count})",
totalRowCountLoading: "(sayılır...)",
diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts
index c31f2bd06c..d6561c4a61 100644
--- a/apps/desktop/src/i18n/locales/en.ts
+++ b/apps/desktop/src/i18n/locales/en.ts
@@ -2438,7 +2438,6 @@ export default {
copyPartialRowsHintWithTotal: "Copied the {loaded} loaded rows ({total} rows in total — the result set is not fully loaded)",
copyPartialRowsHint: "Copied the {loaded} loaded rows (the result set is not fully loaded)",
totalRowCount: "({count} total)",
- totalRowCountWithAction: "({button}{count} total)",
totalRowCountAtLeast: "(at least {count} total)",
totalRowCountEstimated: "(~{count})",
totalRowCountLoading: "(counting...)",
diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts
index 59ea404864..cfabf8c1fb 100644
--- a/apps/desktop/src/i18n/locales/es.ts
+++ b/apps/desktop/src/i18n/locales/es.ts
@@ -2245,7 +2245,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "Se copiaron las {loaded} filas cargadas ({total} filas en total; el resultado no está completamente cargado)",
copyPartialRowsHint: "Se copiaron las {loaded} filas cargadas (el resultado no está completamente cargado)",
totalRowCount: "({count} en total)",
- totalRowCountWithAction: "({button}{count} en total)",
totalRowCountAtLeast: "(al menos {count} en total)",
totalRowCountEstimated: "(aprox. {count})",
totalRowCountLoading: "(contando...)",
diff --git a/apps/desktop/src/i18n/locales/id.ts b/apps/desktop/src/i18n/locales/id.ts
index 1d461e0853..bac57c1b8a 100644
--- a/apps/desktop/src/i18n/locales/id.ts
+++ b/apps/desktop/src/i18n/locales/id.ts
@@ -2068,7 +2068,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "Mengcopy {loaded} baris yang dimuat (total {total} baris; hasil belum dimuat seluruhnya)",
copyPartialRowsHint: "Mengcopy {loaded} baris yang dimuat (hasil belum dimuat seluruhnya)",
totalRowCount: "({count} total)",
- totalRowCountWithAction: "({button}{count} total)",
totalRowCountAtLeast: "(minimal {count} total)",
totalRowCountEstimated: "(~{count})",
totalRowCountLoading: "(menghitung...)",
diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.ts
index 401f861708..fd090eda79 100644
--- a/apps/desktop/src/i18n/locales/it.ts
+++ b/apps/desktop/src/i18n/locales/it.ts
@@ -2144,7 +2144,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "Copiate le {loaded} righe caricate ({total} righe in totale: il risultato non è completamente caricato)",
copyPartialRowsHint: "Copiate le {loaded} righe caricate (il risultato non è completamente caricato)",
totalRowCount: "({count} in totale)",
- totalRowCountWithAction: "({button}{count} in totale)",
totalRowCountAtLeast: "(almeno {count} in totale)",
totalRowCountEstimated: "(circa {count})",
totalRowCountLoading: "(conteggio...)",
diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.ts
index 755e849015..b11ef42a63 100644
--- a/apps/desktop/src/i18n/locales/ja.ts
+++ b/apps/desktop/src/i18n/locales/ja.ts
@@ -2165,7 +2165,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "読み込み済みの {loaded} 行をコピーしました(結果セットは全 {total} 行、未読み込みのデータがあります)",
copyPartialRowsHint: "読み込み済みの {loaded} 行をコピーしました(結果セットはまだ全件読み込まれていません)",
totalRowCount: "(全{count}件)",
- totalRowCountWithAction: "({button}全{count}件)",
totalRowCountAtLeast: "(少なくとも{count}件)",
totalRowCountEstimated: "(約 {count}件)",
totalRowCountLoading: "(カウント中...)",
diff --git a/apps/desktop/src/i18n/locales/ko.ts b/apps/desktop/src/i18n/locales/ko.ts
index 52afd773f8..29c3745cdd 100644
--- a/apps/desktop/src/i18n/locales/ko.ts
+++ b/apps/desktop/src/i18n/locales/ko.ts
@@ -2140,7 +2140,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "로드된 {loaded}행을 복사했습니다(총 {total}행 중, 아직 전체를 로드하지 않음)",
copyPartialRowsHint: "로드된 {loaded}행을 복사했습니다(결과 집합이 아직 전체 로드되지 않았습니다)",
totalRowCount: "(전체 {count})",
- totalRowCountWithAction: "({button}전체 {count})",
totalRowCountAtLeast: "(최소 {count})",
totalRowCountEstimated: "(약 {count})",
totalRowCountLoading: "(집계 중...)",
diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.ts
index 403999128a..6b80491a48 100644
--- a/apps/desktop/src/i18n/locales/pt-BR.ts
+++ b/apps/desktop/src/i18n/locales/pt-BR.ts
@@ -2146,7 +2146,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "Copiadas as {loaded} linhas carregadas ({total} linhas no total; o resultado não está totalmente carregado)",
copyPartialRowsHint: "Copiadas as {loaded} linhas carregadas (o resultado não está totalmente carregado)",
totalRowCount: "({count} no total)",
- totalRowCountWithAction: "({button}{count} no total)",
totalRowCountAtLeast: "(pelo menos {count} no total)",
totalRowCountEstimated: "(aprox. {count})",
totalRowCountLoading: "(contando...)",
diff --git a/apps/desktop/src/i18n/locales/ru.ts b/apps/desktop/src/i18n/locales/ru.ts
index 4700f04744..4e3544b368 100644
--- a/apps/desktop/src/i18n/locales/ru.ts
+++ b/apps/desktop/src/i18n/locales/ru.ts
@@ -2200,7 +2200,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "Скопированы загруженные строки: {loaded} (всего {total} — результат загружен не полностью)",
copyPartialRowsHint: "Скопированы загруженные строки: {loaded} (результат загружен не полностью)",
totalRowCount: "(всего {count})",
- totalRowCountWithAction: "({button}всего {count})",
totalRowCountAtLeast: "(не менее {count} всего)",
totalRowCountEstimated: "(~{count})",
totalRowCountLoading: "(подсчёт...)",
diff --git a/apps/desktop/src/i18n/locales/tr.ts b/apps/desktop/src/i18n/locales/tr.ts
index d2eac9748a..1aa7118371 100644
--- a/apps/desktop/src/i18n/locales/tr.ts
+++ b/apps/desktop/src/i18n/locales/tr.ts
@@ -1803,7 +1803,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "Yüklenen {loaded} satır kopyalandı (toplam {total} satır; sonuç kümesi tamamen yüklenmedi)",
copyPartialRowsHint: "Yüklenen {loaded} satır kopyalandı (sonuç kümesi tamamen yüklenmedi)",
totalRowCount: "(toplam {count})",
- totalRowCountWithAction: "({button}toplam {count})",
totalRowCountAtLeast: "(en az {count} toplam)",
totalRowCountEstimated: "(~{count})",
totalRowCountLoading: "(sayılıyor...)",
diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts
index 63fcf94a93..dbf15daa46 100644
--- a/apps/desktop/src/i18n/locales/zh-CN.ts
+++ b/apps/desktop/src/i18n/locales/zh-CN.ts
@@ -2373,7 +2373,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "已复制已加载的 {loaded} 行(结果集共 {total} 行,尚未加载全部数据)",
copyPartialRowsHint: "已复制已加载的 {loaded} 行(结果集尚未加载全部数据)",
totalRowCount: "(总计 {count} 行)",
- totalRowCountWithAction: "({button}总计 {count} 行)",
totalRowCountAtLeast: "(至少 {count} 行)",
totalRowCountEstimated: "(约 {count} 行)",
totalRowCountLoading: "(统计中...)",
diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts
index 2aa10f4a8c..174fe53e01 100644
--- a/apps/desktop/src/i18n/locales/zh-TW.ts
+++ b/apps/desktop/src/i18n/locales/zh-TW.ts
@@ -2115,7 +2115,6 @@ export default withEnglishFallback({
copyPartialRowsHintWithTotal: "已複製已載入的 {loaded} 列(結果集共 {total} 列,尚未載入全部資料)",
copyPartialRowsHint: "已複製已載入的 {loaded} 列(結果集尚未載入全部資料)",
totalRowCount: "(總計 {count} 筆)",
- totalRowCountWithAction: "({button}總計 {count} 筆)",
totalRowCountAtLeast: "(至少 {count} 筆)",
totalRowCountEstimated: "(約 {count} 筆)",
totalRowCountLoading: "(統計中...)",