25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
fix(layout): adapt query history panel width and isolate special pages
lxk9553f7076353133
diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vueindex 1b404ed6f9..e9eeffb3ea 100644--- a/apps/desktop/src/App.vue+++ b/apps/desktop/src/App.vue@@ -402,6 +402,7 @@ const immediateSyncing = ref(false);const showDriverStore = computed(() => driverStoreTabOpen.value && driverStoreActive.value);const showPluginCenter = computed(() => pluginCenterTabOpen.value && pluginCenterActive.value);const showSettingsPage = computed(() => Boolean(settingsPageTabOpen.value && settingsStore.settingsPageActive));+const isSpecialPageActive = computed(() => !isDetachedWindowContext && (driverStoreActive.value || pluginCenterActive.value || settingsStore.settingsPageActive));const showQuickOpen = ref(false);const quickOpenForceContent = ref(false);const showTabSwitcher = ref(false);@@ -1016,7 +1017,7 @@ const specialPageTabs = computed(() => ({driverStoreActive: driverStoreActive.value,driverUpdateCount: showDriverStoreUpdateBadge.value,}));-provide(GROUP_TAB_BAR_PORTAL, createGroupTabBarPortal(computed(() => !isDetachedWindowContext && (driverStoreActive.value || pluginCenterActive.value || settingsStore.settingsPageActive))));+provide(GROUP_TAB_BAR_PORTAL, createGroupTabBarPortal(isSpecialPageActive));provide(EDITOR_TOOLBAR_ACTIONS, {canNewQuery: canCreateNewQuery,newQuery: (groupId: string) => {@@ -1756,6 +1757,9 @@ function applyRightSidebarPanelState(next: RightSidebarPanelState) {}function setRightSidebarPanelOpen(panelId: RightSidebarPanelId, open: boolean) {+ if (open && isSpecialPageActive.value) {+ activateQuerySurface();+ }if ((panelId === "history" && !open) || (panelId !== "history" && open)) isHistoryPanelMaximized.value = false;if (panelId === "ai" && !open) {isAiPanelMaximized.value = false;@@ -3644,6 +3648,8 @@ function activateQueryTab(tabId: string): boolean {if (!queryStore.activateTab(tabId)) return false;activateQuerySurface();pluginCenterActive.value = false;+ isHistoryPanelMaximized.value = false;+ isAiPanelMaximized.value = false;return true;}@@ -4478,7 +4484,7 @@ onUnmounted(() => {<divdata-editor-content- v-show="(!isAiPanelMaximized && !isHistoryPanelMaximized) || isZenMode"+ v-show="isSpecialPageActive || (!isAiPanelMaximized && !isHistoryPanelMaximized) || isZenMode":class="isDetachedWindowContext ? 'flex-1 min-w-0 overflow-hidden bg-background' : isClassicLayout ? 'flex-1 min-w-0 overflow-hidden' : 'flex-1 min-w-0 overflow-hidden rounded-md border border-border/80 bg-background'"><div class="h-full flex min-h-0 min-w-0 flex-col">@@ -4758,7 +4764,7 @@ onUnmounted(() => {<divv-if="!isDetachedWindowContext && showAiPanel"- v-show="!isHistoryPanelMaximized && !isZenMode"+ v-show="!isSpecialPageActive && !isHistoryPanelMaximized && !isZenMode":class="[isClassicLayout ? 'h-full relative z-30 isolate bg-background' : 'h-full relative z-30 isolate rounded-md border border-border/80 bg-background', isAiPanelMaximized ? 'min-w-0 flex-1' : 'min-w-[240px] max-w-full']":style="isAiPanelMaximized ? {} : { width: aiPanelWidth + 'px' }">@@ -4787,9 +4793,9 @@ onUnmounted(() => {<divv-if="!isDetachedWindowContext && showHistory"- v-show="!isAiPanelMaximized && !isZenMode"- :class="[isClassicLayout ? 'h-full relative z-30 isolate bg-background' : 'h-full relative z-30 isolate rounded-md border border-border/80 bg-background', isHistoryPanelMaximized ? 'min-w-0 flex-1' : 'shrink-0 max-w-full']"- :style="isHistoryPanelMaximized ? {} : { width: historyWidth + 'px' }"+ v-show="!isSpecialPageActive && !isAiPanelMaximized && !isZenMode"+ :class="[isClassicLayout ? 'h-full relative z-30 isolate bg-background' : 'h-full relative z-30 isolate rounded-md border border-border/80 bg-background', isHistoryPanelMaximized ? 'min-w-0 flex-1' : 'min-w-[240px] max-w-full']"+ :style="isHistoryPanelMaximized ? {} : { width: historyWidth + 'px', maxWidth: 'calc(100% - 240px)' }"><div v-if="!isHistoryPanelMaximized" class="panel-resize-handle panel-resize-handle--left" @pointerdown="startHistoryResize" /><div class="h-full min-h-0 overflow-hidden rounded-[inherit]" @mousedown="rememberAuxiliarySearchSurface('history')">@@ -4809,7 +4815,7 @@ onUnmounted(() => {<divv-if="!isDetachedWindowContext && showSqlLibraryPanel"- v-show="!isAiPanelMaximized && !isHistoryPanelMaximized && !isZenMode"+ v-show="!isSpecialPageActive && !isAiPanelMaximized && !isHistoryPanelMaximized && !isZenMode":class="isClassicLayout ? 'h-full shrink-0 relative z-30 isolate bg-background' : 'h-full shrink-0 relative z-30 isolate rounded-md border border-border/80 bg-background'":style="{ width: sqlLibraryWidth + 'px' }">@@ -4823,7 +4829,7 @@ onUnmounted(() => {<divv-if="!isDetachedWindowContext && showSqlFilePanel"- v-show="!isAiPanelMaximized && !isHistoryPanelMaximized && !isZenMode"+ v-show="!isSpecialPageActive && !isAiPanelMaximized && !isHistoryPanelMaximized && !isZenMode":class="isClassicLayout ? 'h-full shrink-0 relative z-30 isolate bg-background' : 'h-full shrink-0 relative z-30 isolate rounded-md border border-border/80 bg-background'":style="{ width: sqlFilePanelWidth + 'px' }">diff --git a/apps/desktop/src/components/layout/__tests__/SpecialPageLayoutPanels.spec.ts b/apps/desktop/src/components/layout/__tests__/SpecialPageLayoutPanels.spec.tsnew file mode 100644index 0000000000..832e1ac3b4--- /dev/null+++ b/apps/desktop/src/components/layout/__tests__/SpecialPageLayoutPanels.spec.ts@@ -0,0 +1,79 @@+// @vitest-environment happy-dom+import { computed, ref } from "vue";+import { describe, expect, it } from "vitest";++describe("Special page layout and right sidebar panels visibility", () => {+ it("shows editor content and hides right panels when a special page is active", () => {+ const isDetachedWindowContext = false;+ const driverStoreActive = ref(false);+ const pluginCenterActive = ref(false);+ const settingsPageActive = ref(false);+ const isAiPanelMaximized = ref(false);+ const isHistoryPanelMaximized = ref(true);+ const isZenMode = ref(false);++ const isSpecialPageActive = computed(() => !isDetachedWindowContext && (driverStoreActive.value || pluginCenterActive.value || settingsPageActive.value));++ const showEditorContent = computed(() => isSpecialPageActive.value || (!isAiPanelMaximized.value && !isHistoryPanelMaximized.value) || isZenMode.value);++ const showAiPanelVisible = computed(() => !isSpecialPageActive.value && !isHistoryPanelMaximized.value && !isZenMode.value);++ const showHistoryPanelVisible = computed(() => !isSpecialPageActive.value && !isAiPanelMaximized.value && !isZenMode.value);++ const showSqlLibraryPanelVisible = computed(() => !isSpecialPageActive.value && !isAiPanelMaximized.value && !isHistoryPanelMaximized.value && !isZenMode.value);++ // Initially: query workspace, history is maximized+ expect(isSpecialPageActive.value).toBe(false);+ expect(showEditorContent.value).toBe(false); // editor content hidden because history is maximized+ expect(showHistoryPanelVisible.value).toBe(true);++ // User opens settings page+ settingsPageActive.value = true;+ expect(isSpecialPageActive.value).toBe(true);+ // Settings page in editor content must be visible even if history was maximized+ expect(showEditorContent.value).toBe(true);+ // Right sidebar panels must be hidden on settings page+ expect(showHistoryPanelVisible.value).toBe(false);+ expect(showAiPanelVisible.value).toBe(false);+ expect(showSqlLibraryPanelVisible.value).toBe(false);++ // User closes settings and returns to query editor+ settingsPageActive.value = false;+ expect(isSpecialPageActive.value).toBe(false);+ expect(showEditorContent.value).toBe(false); // back to maximized history+ expect(showHistoryPanelVisible.value).toBe(true);+ });++ it("switches to query surface if a right sidebar panel is toggled from a special page", () => {+ const surface = ref("settings");+ const isSpecialPageActive = computed(() => surface.value === "settings");++ function activateQuerySurface() {+ surface.value = "query";+ }++ function setRightSidebarPanelOpen(open: boolean) {+ if (open && isSpecialPageActive.value) {+ activateQuerySurface();+ }+ }++ setRightSidebarPanelOpen(true);+ expect(surface.value).toBe("query");+ expect(isSpecialPageActive.value).toBe(false);+ });++ it("resets maximized panel state when an ordinary query tab is activated", () => {+ const isHistoryPanelMaximized = ref(true);+ const isAiPanelMaximized = ref(true);++ function activateQueryTab() {+ isHistoryPanelMaximized.value = false;+ isAiPanelMaximized.value = false;+ }++ activateQueryTab();+ expect(isHistoryPanelMaximized.value).toBe(false);+ expect(isAiPanelMaximized.value).toBe(false);+ });+});