From 1ded7e8332a5db1397b29672232aed3940a0a557 Mon Sep 17 00:00:00 2001 From: zipg Date: Thu, 25 Jun 2026 14:52:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BF=9D=E7=95=99=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=A0=87=E7=AD=BE=E9=A1=B5=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: staff --- apps/desktop/src/App.vue | 40 ++++++++++++++----- .../src/components/layout/AppTabBar.vue | 32 +++++++++------ 2 files changed, 50 insertions(+), 22 deletions(-) diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vue index f60bebf5bf..c5b2edd30e 100644 --- a/apps/desktop/src/App.vue +++ b/apps/desktop/src/App.vue @@ -114,7 +114,9 @@ const showSettingsDialog = ref(false); const settingsInitialTab = ref("editor"); const settingsInitialSection = ref(undefined); const showQueryEditorDdlDialog = ref(false); -const showDriverStore = ref(false); +const driverStoreTabOpen = ref(false); +const driverStoreActive = ref(false); +const showDriverStore = computed(() => driverStoreTabOpen.value && driverStoreActive.value); const showQuickOpen = ref(false); const agentDriverUpdateCount = ref(0); const showHistory = ref(false); @@ -347,7 +349,7 @@ watch( ); } if (id) newQueryContextSource.value = "tab"; - if (id && showDriverStore.value) showDriverStore.value = false; + if (id && driverStoreActive.value) driverStoreActive.value = false; selectedSql.value = ""; activeOutputView.value = "result"; if (id) queryStore.reloadEvictedTab(id); @@ -1186,7 +1188,8 @@ function handleKeydown(e: KeyboardEvent) { if (isCloseTabShortcut(e, shortcuts)) { e.preventDefault(); if (showDriverStore.value) { - showDriverStore.value = false; + driverStoreTabOpen.value = false; + driverStoreActive.value = false; } else if (queryStore.activeTabId) { queryStore.closeTab(queryStore.activeTabId); } @@ -1309,7 +1312,8 @@ function handleContextMenu(e: MouseEvent) { } function openDriverStoreFromEvent() { - showDriverStore.value = true; + driverStoreTabOpen.value = true; + driverStoreActive.value = true; } function runUpdateNotificationChecks() { @@ -1436,7 +1440,10 @@ onUnmounted(() => { @toggle-sql-library="toggleSqlLibrary" @open-github="openGitHub" @open-settings="openSettings()" - @open-driver-store="showDriverStore = !showDriverStore" + @open-driver-store=" + driverStoreTabOpen = true; + driverStoreActive = true; + " @check-updates="checkUpdates()" @open-transfer="dialogs.showTransferDialog.value = true" @open-sql-file="dialogs.showSqlFileDialog.value = true" @@ -1454,9 +1461,23 @@ onUnmounted(() => {
- - -
+ + +
{ " @open-driver-store=" setConnectionDialogOpen(false); - showDriverStore = true; + driverStoreTabOpen = true; + driverStoreActive = true; " @open-lineage-target="openLineageTarget" @open-database-search-target="openDatabaseSearchTarget" diff --git a/apps/desktop/src/components/layout/AppTabBar.vue b/apps/desktop/src/components/layout/AppTabBar.vue index 4b4f8c4703..80e6544733 100644 --- a/apps/desktop/src/components/layout/AppTabBar.vue +++ b/apps/desktop/src/components/layout/AppTabBar.vue @@ -19,12 +19,14 @@ import { useToast } from "@/composables/useToast"; import type { QueryTab } from "@/types/database"; const props = defineProps<{ - showDriverStore?: boolean; + driverStoreOpen?: boolean; + driverStoreActive?: boolean; agentDriverUpdateCount?: number; }>(); const emit = defineEmits<{ - "toggle-driver-store": []; + "activate-tab": []; + "activate-driver-store": []; "close-driver-store": []; "save-tab": [tabId: string]; }>(); @@ -172,7 +174,7 @@ watch( ); watch( - () => props.showDriverStore, + () => props.driverStoreActive, (show) => { if (!show) return; nextTick(() => { @@ -189,7 +191,7 @@ watch( function tabColorStyle(tab: QueryTab) { const color = connectionColor(tab.connectionId); - const isActive = tab.id === queryStore.activeTabId && !props.showDriverStore; + const isActive = tab.id === queryStore.activeTabId && !props.driverStoreActive; const isClassic = settingsStore.editorSettings.appLayout === "classic"; if (!color) { if (isClassic) { @@ -294,12 +296,12 @@ function activateTab(tabId: string) { dispatchBeforeTabSwitch(tabId); tabScrollBehavior.value = "auto"; queryStore.activeTabId = tabId; - emit("close-driver-store"); + emit("activate-tab"); }