From f1f99f6f102d2d5cca2d3567e6b0ff6bc8cd2f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E5=B3=B0?= <67090734+tianyifeng-druid@users.noreply.github.com> Date: Tue, 30 Jun 2026 22:53:27 +0800 Subject: [PATCH] feat(ui): add searchable selects to compare and transfer dialogs --- .../src/components/diff/DataCompareDialog.vue | 141 ++++++++----- .../components/diff/SchemaDiffConfigStep.vue | 143 +++++++------ .../transfer/DataTransferDialog.vue | 191 ++++++++++-------- .../ui/searchable-select/SearchableSelect.vue | 18 +- apps/desktop/src/i18n/locales/en.ts | 11 + apps/desktop/src/i18n/locales/es.ts | 11 + apps/desktop/src/i18n/locales/it.ts | 11 + apps/desktop/src/i18n/locales/ja.ts | 11 + apps/desktop/src/i18n/locales/pt-BR.ts | 11 + apps/desktop/src/i18n/locales/zh-CN.ts | 11 + apps/desktop/src/i18n/locales/zh-TW.ts | 11 + 11 files changed, 361 insertions(+), 209 deletions(-) diff --git a/apps/desktop/src/components/diff/DataCompareDialog.vue b/apps/desktop/src/components/diff/DataCompareDialog.vue index 3478bd8ee..64e863230 100644 --- a/apps/desktop/src/components/diff/DataCompareDialog.vue +++ b/apps/desktop/src/components/diff/DataCompareDialog.vue @@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import SearchableSelect from "@/components/ui/searchable-select/SearchableSelect.vue"; import { useConnectionStore } from "@/stores/connectionStore"; import { useToast } from "@/composables/useToast"; import { databaseOptionsForConnection } from "@/composables/useDatabaseOptions"; @@ -889,31 +890,46 @@ watch(
- - + + + + +
- +
{{ t("dataCompare.autoMatchHint") }}
diff --git a/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue b/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue index b67353b63..b1decba12 100644 --- a/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue +++ b/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue @@ -4,6 +4,7 @@ import { useI18n } from "vue-i18n"; import { Label } from "@/components/ui/label"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import SearchableSelect from "@/components/ui/searchable-select/SearchableSelect.vue"; import { useConnectionStore } from "@/stores/connectionStore"; import DatabaseIcon from "@/components/icons/DatabaseIcon.vue"; import * as api from "@/lib/api"; @@ -253,46 +254,57 @@ async function fetchDbVersion(connectionId: string, database: string, schema: st
- - - - - - {{ db }} - - +
- +
@@ -326,46 +338,57 @@ async function fetchDbVersion(connectionId: string, database: string, schema: st
- - - - - - {{ db }} - - +
- +
diff --git a/apps/desktop/src/components/transfer/DataTransferDialog.vue b/apps/desktop/src/components/transfer/DataTransferDialog.vue index bd4ad92b3..45951a15d 100644 --- a/apps/desktop/src/components/transfer/DataTransferDialog.vue +++ b/apps/desktop/src/components/transfer/DataTransferDialog.vue @@ -7,6 +7,7 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import SearchableSelect from "@/components/ui/searchable-select/SearchableSelect.vue"; import { useConnectionStore } from "@/stores/connectionStore"; import DatabaseIcon from "@/components/icons/DatabaseIcon.vue"; import * as api from "@/lib/api"; @@ -15,7 +16,7 @@ import type { DatabaseType } from "@/types/database"; import { isSchemaAware, supportsTransfer } from "@/lib/databaseCapabilities"; import { databaseOptionsForConnection } from "@/composables/useDatabaseOptions"; import { useExportTracker } from "@/composables/useExportTracker"; -import { ArrowRightLeft, Loader2, Square, CheckSquare } from "@lucide/vue"; +import { ArrowRightLeft, ArrowLeftRight, Loader2, Square, CheckSquare } from "@lucide/vue"; const { t } = useI18n(); const { startDataTransferTask } = useExportTracker(); @@ -289,15 +290,11 @@ async function startTransfer() { function getConnectionName(id: string) { return store.connections.find((c) => c.id === id)?.name ?? id; } - -function getConnectionType(id: string): DatabaseType { - return store.connections.find((c) => c.id === id)?.db_type ?? "mysql"; -}