fix(editor): keep editor pane full height in editor-only mode

This commit is contained in:
t8y2 committed 2026-09-04 20:11:47 +08:00
1 parent e56823334f
commit d9723afceb
2 files changed
+14 -1

No files matched your search

@@ -633,7 +633,10 @@ const mongoQueryResultSaveHandler = computed<CustomSaveHandler | undefined>(() =
});
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 {
@@ -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}`"');