From c67cce56545008f54c055c1882e286ef54704c81 Mon Sep 17 00:00:00 2001 From: LRcoding <38545827+LwClick@users.noreply.github.com> Date: Fri, 17 Jul 2026 00:10:15 +0800 Subject: [PATCH] fix(results): keep output toolbar height stable --- apps/desktop/src/components/grid/DataGrid.vue | 3 ++- .../src/components/layout/ContentArea.vue | 3 ++- packages/app-tests/queryResultToolbar.test.ts | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 3ef8410138..ecdb633e64 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -7369,7 +7369,8 @@ const gridContextMenuItems = computed(() => {
-
+ +
diff --git a/apps/desktop/src/components/layout/ContentArea.vue b/apps/desktop/src/components/layout/ContentArea.vue index fff60dc8b6..231152cecd 100644 --- a/apps/desktop/src/components/layout/ContentArea.vue +++ b/apps/desktop/src/components/layout/ContentArea.vue @@ -1054,7 +1054,8 @@ defineExpose({ focusSearch, refreshData, refreshQueryEditorCompletionCache, hand
-
+ +
{ assert.match(dataGrid, /dataGridTopbarWidth\.value < DATA_GRID_COMPACT_TOPBAR_WIDTH/); }); +test("embedded and standalone result toolbars share the same fixed height", () => { + const contentArea = source(contentAreaPath); + const dataGrid = source(dataGridPath); + const standaloneClasses = contentArea.match(/ref="standaloneResultToolbarRef" class="([^"]+)"/)?.[1].split(/\s+/) ?? []; + const embeddedClasses = dataGrid.match(/ref="dataGridTopbarRef"[^>]+class="([^"]+)"/)?.[1].split(/\s+/) ?? []; + + assert.ok(standaloneClasses.includes("h-7")); + assert.ok(embeddedClasses.includes("h-7")); + assert.ok(!standaloneClasses.includes("min-h-7")); + assert.ok(!embeddedClasses.includes("min-h-7")); +}); + test("DataGrid marks toolbar refresh separately from current-result reloads", () => { const dataGrid = source(dataGridPath); @@ -91,8 +103,5 @@ test("DataGrid marks toolbar refresh separately from current-result reloads", () test("Elasticsearch JSON refresh preserves multi-result query groups", () => { const contentArea = source(contentAreaPath); - assert.match( - contentArea, - /if \(activeElasticsearchJsonResponse\.value\) \{[\s\S]*?emit\("reload", activeResultSql\.value, undefined, undefined, undefined, undefined, undefined, "refresh"\);/, - ); + assert.match(contentArea, /if \(activeElasticsearchJsonResponse\.value\) \{[\s\S]*?emit\("reload", activeResultSql\.value, undefined, undefined, undefined, undefined, undefined, "refresh"\);/); });