feat(editor): add sql editor split panes with shared results
This commit is contained in:
1 parent
24a274bd89
commit
5a3a6e2bb0
76 files changed
+7997
-3343
No files matched your search
+3
-1
@@ -28,5 +28,7 @@ test("data tab header shows the active connection before the table context", ()
|
||||
assert.match(template, /v-if="activeConnection\?\.name\?\.trim\(\)"/);
|
||||
assert.match(template, /:title="activeConnection\.name"/);
|
||||
assert.doesNotMatch(template, /data-data-header-connection class="[^"]*(?:max-w-4[89]|max-w-5[0-9])/);
|
||||
assert.match(template, /data-data-header-connection class="[^"]*min-w-0[^"]*truncate/);
|
||||
// min-w floor keeps scrollWidth reporting real overflow for the measured
|
||||
// condensation tiers; chips still flex and only truncate under pressure.
|
||||
assert.match(template, /data-data-header-connection class="[^"]*min-w-12[^"]*truncate/);
|
||||
});
|
||||
+1
-1
@@ -77,7 +77,7 @@ test("ContentArea wires server messages into the switcher and the messages view"
|
||||
assert.match(contentArea, /<QueryMessagesView v-else-if="activeOutputView === 'messages'"[\s\S]*:messages="activeTab\.result\?\.messages \?\? \[\]"/);
|
||||
// Results with no result set auto-switch via the shared default-view helper.
|
||||
assert.match(contentArea, /import \{ defaultViewForResult \} from "@\/lib\/query\/queryResultDefaultView"/);
|
||||
assert.match(contentArea, /emit\("update:activeOutputView", result \? defaultViewForResult\(result\) : "summary"\)/);
|
||||
assert.match(contentArea, /emit\("update:activeOutputView", props\.activeTab\.id, result \? defaultViewForResult\(result\) : "summary"\)/);
|
||||
});
|
||||
|
||||
test("every locale defines the query message strings", () => {
|
||||
|
||||
+1
-1
@@ -230,5 +230,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", props\.activeTab\.id, activeResultSql\.value, undefined, undefined, undefined, undefined, undefined, "refresh"\);/);
|
||||
});
|
||||
+7
-7
@@ -96,7 +96,7 @@ test("data reload executes before slow metadata refresh completes", async () =>
|
||||
assert.ok(tab);
|
||||
|
||||
const actions = useDataGridActions(computed(() => tab));
|
||||
const reload = actions.onReloadData(undefined, undefined, undefined, undefined, 50, 0);
|
||||
const reload = actions.onReloadData(tabId, undefined, undefined, undefined, undefined, 50, 0);
|
||||
|
||||
await waitFor(() => !!executeBody, 5_000);
|
||||
assert.equal(executeBody.clientSessionId, tabId);
|
||||
@@ -161,7 +161,7 @@ test("data reload preserves current page offset instead of resetting to page 1",
|
||||
|
||||
const actions = useDataGridActions(computed(() => tab));
|
||||
// Simulate refresh from page 5 with pageSize=100 → offset=400
|
||||
await actions.onReloadData(undefined, undefined, undefined, undefined, 100, 400);
|
||||
await actions.onReloadData(tabId, undefined, undefined, undefined, undefined, 100, 400);
|
||||
|
||||
assert.equal(buildSqlOptions?.offset, 400, "build-table-select-sql must receive offset=400 to stay on page 5");
|
||||
assert.equal(buildSqlOptions?.limit, 100, "limit must be 100");
|
||||
@@ -210,7 +210,7 @@ test("infinite pagination fetches and appends only the next table segment", asyn
|
||||
tab.resultPageOffset = 0;
|
||||
|
||||
const actions = useDataGridActions(computed(() => tab));
|
||||
await actions.onPaginate(1, 100);
|
||||
await actions.onPaginate(tabId, 1, 100);
|
||||
|
||||
assert.equal(buildSqlOptions?.offset, 1);
|
||||
assert.equal(buildSqlOptions?.limit, 100);
|
||||
@@ -264,8 +264,8 @@ test("query toolbar refresh reruns the complete multi-result SQL and keeps the a
|
||||
});
|
||||
const actions = useDataGridActions(computed(() => tab));
|
||||
|
||||
await actions.onReloadData("select * from orders", undefined, undefined, undefined, 100, 0, "refresh");
|
||||
await actions.onReloadData("select * from orders", undefined, undefined, undefined, 100, 0, "refresh");
|
||||
await actions.onReloadData(tabId, "select * from orders", undefined, undefined, undefined, 100, 0, "refresh");
|
||||
await actions.onReloadData(tabId, "select * from orders", undefined, undefined, undefined, 100, 0, "refresh");
|
||||
|
||||
assert.equal(executeTabSql.mock.calls.length, 2);
|
||||
for (const call of executeTabSql.mock.calls) {
|
||||
@@ -389,7 +389,7 @@ describe("multi-result preservation after submit", () => {
|
||||
|
||||
// Simulate DataGrid submit reload: onReloadData with the current
|
||||
// result's sourceStatement (single statement, not the full batch SQL)
|
||||
await actions.onReloadData("select * from users");
|
||||
await actions.onReloadData(tabId, "select * from users");
|
||||
|
||||
// The second result must be preserved
|
||||
assert.equal(tab.results?.length, 2, "both results must survive after submit");
|
||||
@@ -493,7 +493,7 @@ describe("multi-result preservation after submit", () => {
|
||||
const actions = useDataGridActions(computed(() => tab));
|
||||
|
||||
// Simulate DataGrid submit reload on the SECOND result
|
||||
await actions.onReloadData("select * from orders");
|
||||
await actions.onReloadData(tabId, "select * from orders");
|
||||
|
||||
// The first result must be preserved
|
||||
assert.equal(tab.results?.length, 2, "both results must survive after submit on second result");
|
||||
|
||||
Reference in new issue
Block a user