From 0a1aa8a0b6cef0d948c04250fa72e11a7da45b0d Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Tue, 19 May 2026 18:29:40 +0800 Subject: [PATCH] feat(export): add table search filter to database export dialog Allow users to quickly find tables by name in the export dialog, useful when databases have many tables. Select/clear buttons now operate within the filtered scope. --- .../export/DatabaseExportDialog.vue | 22 +++++++++++++++---- apps/desktop/src/i18n/locales/en.ts | 1 + apps/desktop/src/i18n/locales/zh-CN.ts | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/components/export/DatabaseExportDialog.vue b/apps/desktop/src/components/export/DatabaseExportDialog.vue index 5642bcceb..975871e15 100644 --- a/apps/desktop/src/components/export/DatabaseExportDialog.vue +++ b/apps/desktop/src/components/export/DatabaseExportDialog.vue @@ -14,7 +14,8 @@ import { generateDatabaseExportId } from "@/lib/databaseExport"; import { buildSelectedTablesPayload } from "@/lib/databaseExportSelection"; import { isTauriRuntime } from "@/lib/tauriRuntime"; import { useToast } from "@/composables/useToast"; -import { Download, Square, CheckSquare, X } from "lucide-vue-next"; +import { Input } from "@/components/ui/input"; +import { Download, Square, CheckSquare, Search, X } from "lucide-vue-next"; const { t } = useI18n(); const { toast } = useToast(); @@ -38,6 +39,12 @@ const loadingMeta = ref(false); const tables = ref([]); const selectedTables = ref([]); const loadingTables = ref(false); +const tableFilter = ref(""); +const filteredTables = computed(() => { + const q = tableFilter.value.trim().toLowerCase(); + if (!q) return tables.value; + return tables.value.filter((name) => name.toLowerCase().includes(q)); +}); const tableError = ref(null); // Options @@ -147,11 +154,14 @@ function toggleTable(table: string) { } function selectAllTables() { - selectedTables.value = [...tables.value]; + const selected = new Set(selectedTables.value); + for (const name of filteredTables.value) selected.add(name); + selectedTables.value = tables.value.filter((name) => selected.has(name)); } function clearSelectedTables() { - selectedTables.value = []; + const removing = new Set(filteredTables.value); + selectedTables.value = selectedTables.value.filter((name) => !removing.has(name)); } async function startExport() { @@ -386,6 +396,10 @@ watch( {{ t("databaseExport.tableLoadError", { error: tableError }) }}
+
+ + +