From d9723afceb69dadd4a2fac5742b5ea1c18eb75be Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Fri, 4 Sep 2026 20:11:47 +0800 Subject: [PATCH] fix(editor): keep editor pane full height in editor-only mode --- apps/desktop/src/components/layout/ContentArea.vue | 5 ++++- .../layout/__tests__/ContentArea.outputView.spec.ts | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/components/layout/ContentArea.vue b/apps/desktop/src/components/layout/ContentArea.vue index d67d13b812..9b7fd30540 100644 --- a/apps/desktop/src/components/layout/ContentArea.vue +++ b/apps/desktop/src/components/layout/ContentArea.vue @@ -633,7 +633,10 @@ const mongoQueryResultSaveHandler = computed(() = }); const resultsPaneOpen = ref(false); const resultsPaneSize = ref(Number(safeLocalStorageGet("dbx-results-pane-size")) || DEFAULT_QUERY_RESULTS_PANE_SIZE); -const editorPaneSize = computed(() => (resultsPaneOpen.value ? 100 - resultsPaneSize.value : 100)); +// In editor-only mode the results pane is never mounted in this splitpanes, +// so the editor pane must stay at 100%: a reactive size update alone does not +// re-normalize a single pane, and shrinking it would leave a blank dead zone. +const editorPaneSize = computed(() => (props.editorOnly || !resultsPaneOpen.value ? 100 : 100 - resultsPaneSize.value)); const queryRunningElapsed = ref(0); function toggleResultsPane(): boolean { diff --git a/apps/desktop/src/components/layout/__tests__/ContentArea.outputView.spec.ts b/apps/desktop/src/components/layout/__tests__/ContentArea.outputView.spec.ts index df9b2887cc..007dbadf12 100644 --- a/apps/desktop/src/components/layout/__tests__/ContentArea.outputView.spec.ts +++ b/apps/desktop/src/components/layout/__tests__/ContentArea.outputView.spec.ts @@ -14,6 +14,16 @@ describe("ContentArea completed query output", () => { }); }); +describe("ContentArea editor-only split sizing", () => { + it("keeps the editor pane at 100% in editor-only mode so no blank dead zone is left behind", () => { + // The shared result surface renders results in its own workspace pane, so + // this splitpanes has a single (editor) pane in editor-only mode. A purely + // reactive size prop does not re-normalize a lone pane, so any value below + // 100 would shrink the editor and leave the remainder as empty background. + expect(contentAreaSource).toContain("const editorPaneSize = computed(() => (props.editorOnly || !resultsPaneOpen.value ? 100 : 100 - resultsPaneSize.value));"); + }); +}); + describe("ContentArea Mongo tab reuse", () => { it("remounts the document browser when the active tab changes collections", () => { expect(contentAreaSource).toContain(':key="`${activeTab.id}:${activeTab.sql}`"');