Skip to content

armgit / dbx

Public Imported from GitHub
0

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。

fix(editor): collapse shared results pane for unexecuted queries

Melody Ruch63363c2834ad
diff --git a/apps/desktop/src/components/layout/ContentArea.vue b/apps/desktop/src/components/layout/ContentArea.vue
index 574d169093..70d583317e 100644
--- a/apps/desktop/src/components/layout/ContentArea.vue
+++ b/apps/desktop/src/components/layout/ContentArea.vue
@@ -1342,7 +1342,14 @@ defineExpose({
</Pane>
<Pane v-if="(resultsPaneOpen || resultOnly) && !editorOnly" class="min-h-0" :size="resultOnly ? 100 : resultsPaneSize" :min-size="resultOnly ? 100 : 20">
<div class="h-full flex flex-col">
- <div v-if="hasQueryOutput" class="flex h-10 shrink-0 items-center gap-1 border-b bg-muted/20 px-2">
+ <!--
+ The shared result surface (resultOnly) is always mounted regardless of
+ whether the active tab has run a query yet, and this toolbar is the only
+ place that renders the "hide results" chevron (see handleHideResultsPane).
+ Gating it on hasQueryOutput alone left users with an always-open, empty
+ shared pane and no way to collapse it (#8233).
+ -->
+ <div v-if="hasQueryOutput || resultOnly" class="flex h-10 shrink-0 items-center gap-1 border-b bg-muted/20 px-2">
<Button
v-if="activeTab.mode === 'query' && activeTab.result"
variant="ghost"
diff --git a/apps/desktop/src/components/layout/__tests__/ContentArea.sharedResultCollapse.spec.ts b/apps/desktop/src/components/layout/__tests__/ContentArea.sharedResultCollapse.spec.ts
new file mode 100644
index 0000000000..07e75162a0
--- /dev/null
+++ b/apps/desktop/src/components/layout/__tests__/ContentArea.sharedResultCollapse.spec.ts
@@ -0,0 +1,21 @@
+import { readFileSync } from "node:fs";
+import { describe, expect, it } from "vitest";
+
+const contentAreaSource = readFileSync(new URL("../ContentArea.vue", import.meta.url), "utf8");
+
+describe("ContentArea shared result pane collapse (#8233)", () => {
+ it("renders the results toolbar (and its hide-results chevron) even with no query output when resultOnly", () => {
+ // The shared result surface (QueryResultSurface -> ContentArea result-only)
+ // is mounted unconditionally by SqlEditorWorkspace regardless of whether the
+ // active tab has run a query. handleHideResultsPane's chevron lives inside
+ // this toolbar and is the only UI to collapse that shared pane, so gating
+ // the toolbar on hasQueryOutput alone left it permanently open with no way
+ // to close it until a query executed.
+ expect(contentAreaSource).not.toMatch(/v-if="hasQueryOutput"\s+class="flex h-10 shrink-0 items-center gap-1 border-b bg-muted\/20 px-2"/);
+ expect(contentAreaSource).toContain(`v-if="hasQueryOutput || resultOnly" class="flex h-10 shrink-0 items-center gap-1 border-b bg-muted/20 px-2"`);
+ });
+
+ it("keeps handleHideResultsPane bubbling a toggle event for the shared (resultOnly) surface", () => {
+ expect(contentAreaSource).toContain('if (props.resultOnly) {\n emit("toggleResultsPane");');
+ });
+});