diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vue index b0ef033e49..24e360db6e 100644 --- a/apps/desktop/src/App.vue +++ b/apps/desktop/src/App.vue @@ -1059,6 +1059,10 @@ function activateOpenSpecialPageFallback() { } if (driverStoreTabOpen.value) { activateMainContentSurface("driverStore"); + return; + } + if (pluginCenterTabOpen.value) { + activateMainContentSurface("pluginCenter"); } } @@ -1072,6 +1076,14 @@ function closeSettingsPage() { activateMainContentSurface("pluginCenter"); return; } + if (driverStoreTabOpen.value) { + activateMainContentSurface("driverStore"); + return; + } + if (pluginCenterTabOpen.value) { + activateMainContentSurface("pluginCenter"); + return; + } activateMainContentSurface("query"); } @@ -1093,7 +1105,17 @@ function openDriverStorePage(target?: "agent" | "jdbc" | "storage" | "runtime" | function closeDriverStorePage() { driverStoreTabOpen.value = false; - activateMainContentSurface("query"); + // Keep another open special page visible when closing the active one. The + // previous implementation always switched to the query surface, which + // cleared pluginCenterActive and made an already-open Plugin Center tab + // disappear together with Driver Manager. + if (pluginCenterTabOpen.value) { + activateMainContentSurface("pluginCenter"); + } else if (settingsPageTabOpen.value) { + activateMainContentSurface("settings"); + } else { + activateMainContentSurface("query"); + } driverStoreActiveTab.value = "agent"; driverStoreFocus.value = null; } @@ -1107,7 +1129,13 @@ function openPluginCenterPage(focus?: PluginCenterFocus | null) { function closePluginCenterPage() { pluginCenterTabOpen.value = false; pluginCenterFocus.value = null; - activateMainContentSurface("query"); + if (driverStoreTabOpen.value) { + activateMainContentSurface("driverStore"); + } else if (settingsPageTabOpen.value) { + activateMainContentSurface("settings"); + } else { + activateMainContentSurface("query"); + } } function openPluginConnectionDialog(pluginId: string, providerId: string) { @@ -3712,7 +3740,7 @@ onUnmounted(() => { @start-resize="startTabBarResize" @toggle-collapse="toggleTabBarCollapsed" :active-tab="activeTab ?? undefined" - :show-tab-navigation="queryStore.tabs.length > 0 || settingsPageTabOpen || driverStoreTabOpen" + :show-tab-navigation="queryStore.tabs.length > 0 || settingsPageTabOpen || driverStoreTabOpen || pluginCenterTabOpen" :active-connection="activeConnection" :tab-bar-width="tabBarWidth" :tab-bar-collapsed="tabBarCollapsed" diff --git a/apps/desktop/src/components/layout/EditorGroupTabBar.vue b/apps/desktop/src/components/layout/EditorGroupTabBar.vue index f529e77a5a..792ce61902 100644 --- a/apps/desktop/src/components/layout/EditorGroupTabBar.vue +++ b/apps/desktop/src/components/layout/EditorGroupTabBar.vue @@ -138,7 +138,15 @@ const suppressNextTabClick = ref(false); const isClassicLayout = computed(() => settingsStore.editorSettings.appLayout === "classic"); // Special pages append to the focused group's strip only: one instance at a // time, in the pane the user is working in (v0.6.2 kept them in the single strip). -const showSpecialPageTabs = computed(() => !!props.specialPageTabs && (props.specialPageTabs.settingsOpen || props.specialPageTabs.driverStoreOpen || props.specialPageTabs.pluginCenterOpen) && queryStore.focusedGroupId === props.groupId); +const showSpecialPageTabs = computed(() => { + if (!props.specialPageTabs || !(props.specialPageTabs.settingsOpen || props.specialPageTabs.driverStoreOpen || props.specialPageTabs.pluginCenterOpen)) return false; + // With no regular query tabs there is no focus event to establish the + // focused group. Render the special-page tab in the sole (main) group so + // opening Plugin Center or Driver Manager by itself still creates a tab. + const isFocusedGroup = queryStore.focusedGroupId === props.groupId; + const isEmptyWorkspaceMainGroup = queryStore.tabs.length === 0 && props.groupId === queryStore.groups[0]?.id; + return isFocusedGroup || isEmptyWorkspaceMainGroup; +}); const specialPageActive = computed(() => !!(props.specialPageTabs?.settingsActive || props.specialPageTabs?.driverStoreActive || props.specialPageTabs?.pluginCenterActive)); function isTabActive(tab: QueryTab): boolean { diff --git a/apps/desktop/src/components/layout/__tests__/appContentSurfaces.contract.spec.ts b/apps/desktop/src/components/layout/__tests__/appContentSurfaces.contract.spec.ts index bd1c5a5d29..6b102c24d0 100644 --- a/apps/desktop/src/components/layout/__tests__/appContentSurfaces.contract.spec.ts +++ b/apps/desktop/src/components/layout/__tests__/appContentSurfaces.contract.spec.ts @@ -22,15 +22,17 @@ describe("App main content surface structure", () => { }); it("keeps navigation independent from the workspace welcome content", () => { - expect(appSource).toContain(':show-tab-navigation="queryStore.tabs.length > 0 || settingsPageTabOpen || driverStoreTabOpen"'); + expect(appSource).toContain(':show-tab-navigation="queryStore.tabs.length > 0 || settingsPageTabOpen || driverStoreTabOpen || pluginCenterTabOpen"'); expect(appSource).toContain(':active-tab="activeTab ?? undefined"'); expect(appSource).toMatch(/