From 18e34bf33a9bace0903ab6a7c2909e26a8f62ffc Mon Sep 17 00:00:00 2001
From: Mo-Moore <33098900+Mo-Moore@users.noreply.github.com>
Date: Mon, 14 Sep 2026 12:37:39 +0800
Subject: [PATCH] feat(schema-diff): named config selector and mapping UX
---
.../components/diff/SchemaDiffConfigStep.vue | 33 ++++-
.../src/components/diff/SchemaDiffDialog.vue | 120 ++++++++++++++++--
.../src/components/diff/TableMultiSelect.vue | 5 +-
apps/desktop/src/i18n/locales/az.ts | 12 ++
apps/desktop/src/i18n/locales/en.ts | 12 ++
apps/desktop/src/i18n/locales/es.ts | 12 ++
apps/desktop/src/i18n/locales/it.ts | 12 ++
apps/desktop/src/i18n/locales/ja.ts | 12 ++
apps/desktop/src/i18n/locales/ko.ts | 11 ++
apps/desktop/src/i18n/locales/pt-BR.ts | 12 ++
apps/desktop/src/i18n/locales/tr.ts | 12 ++
apps/desktop/src/i18n/locales/zh-CN.ts | 12 ++
apps/desktop/src/i18n/locales/zh-TW.ts | 12 ++
.../schema/schemaDiffTableMapping.spec.ts | 16 +++
.../src/lib/schema/schemaDiffTableMapping.ts | 4 +-
15 files changed, 282 insertions(+), 15 deletions(-)
diff --git a/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue b/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue
index e027de45fd..df1565c0ef 100644
--- a/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue
+++ b/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue
@@ -28,7 +28,7 @@ import DatabaseIcon from "@/components/icons/DatabaseIcon.vue";
import * as api from "@/lib/backend/api";
import { isSchemaAware } from "@/lib/database/databaseCapabilities";
import { fetchNamespaceOptionsForConnection } from "@/composables/useDatabaseOptions";
-import { ArrowLeftRight, GitCompareArrows, Save, FolderOpen, Settings, X } from "@lucide/vue";
+import { ArrowLeftRight, GitCompareArrows, Save, FolderOpen, Settings, Trash2, X } from "@lucide/vue";
import type { SchemaDiffConfig, SchemaDiffCompareOptions, FieldMappingEntry, SchemaDiffTableMapping, SchemaDiffRoutineMapping } from "@/types/schemaDiff";
import type { DatabaseType } from "@/types/database";
@@ -166,6 +166,16 @@ function handleUpdateSelectedTables(value: string[]) {
reconcileTableMappings(value);
}
+function handleRemoveSelectedTable(sourceTable: string) {
+ handleUpdateSelectedTables(localSelectedTables.value.filter((table) => table !== sourceTable));
+}
+
+function matchStatusClass(kind: SchemaDiffTableMatch["kind"]): string {
+ if (kind === "unmatched") return "text-destructive";
+ if (kind === "manual") return "text-amber-600 dark:text-amber-400";
+ return "text-muted-foreground";
+}
+
function clearUnavailableTableSelection() {
sourceTableList.value = [];
targetTableList.value = [];
@@ -307,6 +317,10 @@ function handleUpdateSelectedRoutines(value: string[]) {
reconcileRoutineMappings(value);
}
+function handleRemoveSelectedRoutine(sourceRoutine: string) {
+ handleUpdateSelectedRoutines(localSelectedRoutines.value.filter((routine) => routine !== sourceRoutine));
+}
+
function clearUnavailableRoutineSelection() {
sourceRoutineList.value = [];
targetRoutineList.value = [];
@@ -861,6 +875,7 @@ async function fetchDbVersion(connectionId: string, database: string, schema: st
(),
{
title: "",
+ searchPlaceholder: "",
searchable: true,
emptyText: "",
disabled: false,
@@ -64,7 +67,7 @@ function toggleSelectAll() {
-
+