From b4707713fca40af37e8955f30dc4d2b80e92afa3 Mon Sep 17 00:00:00 2001 From: ZhuchkaTriplesix Date: Sun, 15 Nov 2026 11:36:19 +0300 Subject: [PATCH] feat(ui): New Connection dialog with SQLite connect (#1955) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the New Connection stub with a driver-switcher dialog: working SQLite name/path/Browse → connect, and PostgreSQL/MySQL field stubs until adapters land. --- apps/tauri/src/App.vue | 22 +- apps/tauri/src/stores/connections.ts | 9 +- apps/tauri/src/ui/NewConnectionDialog.vue | 494 ++++++++++++++++++++++ 3 files changed, 518 insertions(+), 7 deletions(-) create mode 100644 apps/tauri/src/ui/NewConnectionDialog.vue diff --git a/apps/tauri/src/App.vue b/apps/tauri/src/App.vue index 0af557ed..ad32944b 100644 --- a/apps/tauri/src/App.vue +++ b/apps/tauri/src/App.vue @@ -25,6 +25,9 @@ import QuickSwitcher from "./ui/QuickSwitcher.vue"; import WelcomeTourDialog from "./ui/WelcomeTourDialog.vue"; import AboutDialog from "./ui/AboutDialog.vue"; import NewFolderDialog from "./ui/NewFolderDialog.vue"; +import NewConnectionDialog, { + type SqliteConnectPayload, +} from "./ui/NewConnectionDialog.vue"; const shell = useShellStore(); const status = useShellStatusStore(); @@ -40,6 +43,7 @@ const switcherOpen = ref(false); const tourOpen = ref(false); const aboutOpen = ref(false); const newFolderOpen = ref(false); +const newConnectionOpen = ref(false); provideQueryaMotion(); @@ -66,10 +70,15 @@ async function onOpenSqlite() { } function onNewConnection() { - status.setQueryMetrics({ - message: "Connection form UI next — use Demo or Open SQLite for now", - busy: false, - }); + newConnectionOpen.value = true; +} + +async function onConnectSqliteFromDialog(payload: SqliteConnectPayload) { + try { + await connections.connectSqlite(payload.path, { name: payload.name }); + } catch { + // status already set in store + } } function onNewFolder() { @@ -247,6 +256,11 @@ onUnmounted(() => { @close="newFolderOpen = false" @create="onCreateFolder" /> + diff --git a/apps/tauri/src/stores/connections.ts b/apps/tauri/src/stores/connections.ts index f467d5f4..f2257c8e 100644 --- a/apps/tauri/src/stores/connections.ts +++ b/apps/tauri/src/stores/connections.ts @@ -67,7 +67,10 @@ export const useConnectionsStore = defineStore("connections", () => { return conn; } - async function connectSqlite(path: string, folderId?: string | null) { + async function connectSqlite( + path: string, + opts?: { folderId?: string | null; name?: string }, + ) { const status = useShellStatusStore(); const nav = useShellNavStore(); status.setQueryMetrics({ @@ -79,9 +82,9 @@ export const useConnectionsStore = defineStore("connections", () => { const conn: LiveConnection = { id, driver: "sqlite", - name: fileName(path), + name: opts?.name?.trim() || fileName(path), path, - folderId: folderId ?? null, + folderId: opts?.folderId ?? null, }; upsert(conn); nav.setExpanded(id, true); diff --git a/apps/tauri/src/ui/NewConnectionDialog.vue b/apps/tauri/src/ui/NewConnectionDialog.vue new file mode 100644 index 00000000..7980ca75 --- /dev/null +++ b/apps/tauri/src/ui/NewConnectionDialog.vue @@ -0,0 +1,494 @@ + + + + +