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。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
feat(explain): add default explain plan view mode setting
lxk9554dbbfec86f0e
diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vueindex 35c925f5a8..e4c9035711 100644--- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue+++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue@@ -93,6 +93,7 @@ import {type DataGridFilterEditorView,type DataGridToolbarLayout,type MultiStatementDefaultView,+ type DefaultExplainView,type ResultTabNamingMode,type OpenTabsRestoreMode,type AppCloseUnsavedTabsMode,@@ -756,6 +757,7 @@ const dataGridFilterViewPreviewExpanded = ref(true);const editDataGridTextFilterPanelHeight = ref(settingsStore.editorSettings.dataGridTextFilterPanelHeight);const editDefaultAutoKeepResults = ref(settingsStore.editorSettings.defaultAutoKeepResults);const editMultiStatementDefaultView = ref<MultiStatementDefaultView>(settingsStore.editorSettings.multiStatementDefaultView);+const editDefaultExplainView = ref<DefaultExplainView>(settingsStore.editorSettings.defaultExplainView);const editDataGridAutoTransposeSingleRow = ref(settingsStore.editorSettings.dataGridAutoTransposeSingleRow);const editDataGridCellDetailButtonVisible = ref(settingsStore.editorSettings.dataGridCellDetailButtonVisible);const editDataGridCellDetailDialogDefault = ref(settingsStore.editorSettings.dataGridCellDetailDialogDefault);@@ -1120,6 +1122,7 @@ function currentEditorSettingsDraft(): EditorSettingsDraft {dataGridTextFilterPanelHeight: editDataGridTextFilterPanelHeight.value,defaultAutoKeepResults: editDefaultAutoKeepResults.value,multiStatementDefaultView: editMultiStatementDefaultView.value,+ defaultExplainView: editDefaultExplainView.value,dataGridAutoTransposeSingleRow: editDataGridAutoTransposeSingleRow.value,dataGridCellDetailButtonVisible: editDataGridCellDetailButtonVisible.value,dataGridCellDetailDialogDefault: editDataGridCellDetailDialogDefault.value,@@ -1799,6 +1802,7 @@ function syncEditorSettingsDraftFromStore() {editDataGridTextFilterPanelHeight.value = settingsStore.editorSettings.dataGridTextFilterPanelHeight;editDefaultAutoKeepResults.value = settingsStore.editorSettings.defaultAutoKeepResults;editMultiStatementDefaultView.value = settingsStore.editorSettings.multiStatementDefaultView;+ editDefaultExplainView.value = settingsStore.editorSettings.defaultExplainView;editDataGridAutoTransposeSingleRow.value = settingsStore.editorSettings.dataGridAutoTransposeSingleRow;editDataGridCellDetailButtonVisible.value = settingsStore.editorSettings.dataGridCellDetailButtonVisible;editDataGridCellDetailDialogDefault.value = settingsStore.editorSettings.dataGridCellDetailDialogDefault;@@ -1953,6 +1957,7 @@ const editorSettingsDraftRefs: EditorSettingsDraftRefMap = {dataGridTextFilterPanelHeight: editDataGridTextFilterPanelHeight,defaultAutoKeepResults: editDefaultAutoKeepResults,multiStatementDefaultView: editMultiStatementDefaultView,+ defaultExplainView: editDefaultExplainView,dataGridAutoTransposeSingleRow: editDataGridAutoTransposeSingleRow,dataGridCellDetailButtonVisible: editDataGridCellDetailButtonVisible,dataGridCellDetailDialogDefault: editDataGridCellDetailDialogDefault,@@ -2544,6 +2549,7 @@ function resetDefaultsForTab(tab: SettingsCategory) {editDataGridTextFilterPanelHeight.value = DEFAULT_EDITOR_SETTINGS.dataGridTextFilterPanelHeight;editDefaultAutoKeepResults.value = DEFAULT_EDITOR_SETTINGS.defaultAutoKeepResults;editMultiStatementDefaultView.value = DEFAULT_EDITOR_SETTINGS.multiStatementDefaultView;+ editDefaultExplainView.value = DEFAULT_EDITOR_SETTINGS.defaultExplainView;editDataGridAutoTransposeSingleRow.value = DEFAULT_EDITOR_SETTINGS.dataGridAutoTransposeSingleRow;editDataGridCellDetailButtonVisible.value = DEFAULT_EDITOR_SETTINGS.dataGridCellDetailButtonVisible;editDataGridCellDetailDialogDefault.value = DEFAULT_EDITOR_SETTINGS.dataGridCellDetailDialogDefault;@@ -2665,6 +2671,7 @@ function resetAllDefaults() {editDataGridTextFilterPanelHeight.value = DEFAULT_EDITOR_SETTINGS.dataGridTextFilterPanelHeight;editDefaultAutoKeepResults.value = DEFAULT_EDITOR_SETTINGS.defaultAutoKeepResults;editMultiStatementDefaultView.value = DEFAULT_EDITOR_SETTINGS.multiStatementDefaultView;+ editDefaultExplainView.value = DEFAULT_EDITOR_SETTINGS.defaultExplainView;editDataGridAutoTransposeSingleRow.value = DEFAULT_EDITOR_SETTINGS.dataGridAutoTransposeSingleRow;editDataGridCellDetailButtonVisible.value = DEFAULT_EDITOR_SETTINGS.dataGridCellDetailButtonVisible;editDataGridCellDetailDialogDefault.value = DEFAULT_EDITOR_SETTINGS.dataGridCellDetailDialogDefault;@@ -8619,6 +8626,24 @@ onUnmounted(() => {</SelectContent></Select></div>+ <div data-settings-search-id="default-explain-view" :class="['settings-item flex items-center justify-between gap-4 rounded-md border bg-muted/20 px-3 py-2', settingsSearchTargetClass('default-explain-view')]">+ <div class="min-w-0 space-y-1">+ <Label for="default-explain-view">{{ t("settings.defaultExplainView") }}</Label>+ <p class="text-xs text-muted-foreground">{{ t("settings.defaultExplainViewDescription") }}</p>+ </div>+ <Select v-model="editDefaultExplainView">+ <SelectTrigger id="default-explain-view" class="h-8 w-36 shrink-0">+ <SelectValue :placeholder="t('settings.defaultExplainView')" />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value="canvas">{{ t("explain.canvas") }}</SelectItem>+ <SelectItem value="tree">{{ t("explain.tree") }}</SelectItem>+ <SelectItem value="summary">{{ t("explain.summary") }}</SelectItem>+ <SelectItem value="table">{{ t("explain.standardTable") }}</SelectItem>+ <SelectItem value="raw">{{ t("explain.raw") }}</SelectItem>+ </SelectContent>+ </Select>+ </div><div class="settings-item flex items-center justify-between gap-4 rounded-md border bg-muted/20 px-3 py-2"><div class="space-y-1"><Label for="query-result-max-rows-enabled">diff --git a/apps/desktop/src/components/explain/ExplainPlanViewer.vue b/apps/desktop/src/components/explain/ExplainPlanViewer.vueindex d11aca332c..6702135d27 100644--- a/apps/desktop/src/components/explain/ExplainPlanViewer.vue+++ b/apps/desktop/src/components/explain/ExplainPlanViewer.vue@@ -7,9 +7,12 @@ import { flattenExplainPlanNodes, formatExplainPlanDetails } from "@/lib/diagramimport { extractActualRows } from "@/lib/diagram/planCanvas";import { Button } from "@/components/ui/button";import type { QueryResult } from "@/types/database";+import type { DefaultExplainView } from "@/stores/settingsStore";import ExplainPlanNodeTree from "./ExplainPlanNodeTree.vue";import ExplainPlanDiagram from "./ExplainPlanDiagram.vue";+export type ExplainView = DefaultExplainView;+const props = defineProps<{plan?: ParsedExplainPlan;error?: string;@@ -18,18 +21,51 @@ const props = defineProps<{explainSql?: string;tableResult?: QueryResult;tableError?: string;+ defaultView?: ExplainView;}>();const { t } = useI18n();-const activeView = ref<"canvas" | "tree" | "summary" | "raw" | "table">("canvas");+const userSelectedView = ref<ExplainView | null>(null);+const activeView = ref<ExplainView>("canvas");const hasTableView = computed(() => !!props.tableResult || !!props.tableError);+function isViewAvailable(view: ExplainView): boolean {+ if (view === "table") return hasTableView.value;+ return !!props.plan;+}++function resolveView(): ExplainView {+ if (userSelectedView.value && isViewAvailable(userSelectedView.value)) {+ return userSelectedView.value;+ }++ const preferred = props.defaultView ?? "canvas";+ if (preferred === "table") {+ if (hasTableView.value) return "table";+ if (props.plan) return "canvas";+ return "table";+ }++ if (props.plan) return preferred;+ if (!props.loading && hasTableView.value) return "table";+ return preferred;+}++function selectView(view: ExplainView) {+ userSelectedView.value = view;+ activeView.value = view;+}++watch([() => props.loading, () => props.sourceSql, () => props.explainSql, () => props.defaultView], ([loading, sourceSql, explainSql, defaultView], [prevLoading, prevSourceSql, prevExplainSql, prevDefaultView]) => {+ if ((loading && !prevLoading) || sourceSql !== prevSourceSql || explainSql !== prevExplainSql || defaultView !== prevDefaultView) {+ userSelectedView.value = null;+ }+});+watch(- [hasTableView, () => !!props.tableResult, () => !!props.plan, () => props.loading],- ([available, hasTableResult, hasPlan, loading]) => {- if (!available && activeView.value === "table") activeView.value = "canvas";- // Wait for JSON EXPLAIN to finish so regular MySQL still defaults to its visual tree.- if (!loading && hasTableResult && !hasPlan) activeView.value = "table";+ [hasTableView, () => !!props.tableResult, () => !!props.plan, () => props.loading, () => props.defaultView],+ () => {+ activeView.value = resolveView();},{ immediate: true },);@@ -86,24 +122,24 @@ function tableCellText(value: unknown): string {<span v-if="measuredRowsLabel" class="shrink-0 whitespace-nowrap ml-1 inline-flex items-center gap-1 rounded bg-green-100 px-1.5 py-0.5 font-semibold text-green-700 dark:bg-green-900/30 dark:text-green-300" style="font-size: 10px">{{ measuredRowsLabel }}</span><span class="flex-1 min-w-2" /><div v-if="plan || hasTableView" class="shrink-0 inline-flex rounded-md border bg-muted/40 p-0.5">- <Button v-if="plan" size="sm" :variant="activeView === 'canvas' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="activeView = 'canvas'">+ <Button v-if="plan" size="sm" :variant="activeView === 'canvas' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="selectView('canvas')"><Workflow class="h-3.5 w-3.5" />{{ t("explain.canvas") }}</Button>- <Button v-if="plan" size="sm" :variant="activeView === 'tree' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="activeView = 'tree'">+ <Button v-if="plan" size="sm" :variant="activeView === 'tree' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="selectView('tree')"><GitBranch class="h-3.5 w-3.5" />{{ t("explain.tree") }}</Button>- <Button v-if="plan" size="sm" :variant="activeView === 'summary' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="activeView = 'summary'">+ <Button v-if="plan" size="sm" :variant="activeView === 'summary' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="selectView('summary')"><Table2 class="h-3.5 w-3.5" />{{ t("explain.summary") }}</Button>- <Button v-if="plan" size="sm" :variant="activeView === 'raw' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="activeView = 'raw'">+ <Button v-if="plan" size="sm" :variant="activeView === 'raw' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="selectView('raw')"><FileText v-if="isRawString" class="h-3.5 w-3.5" /><Braces v-else class="h-3.5 w-3.5" />{{ rawFormatLabel }}</Button>- <Button v-if="hasTableView" size="sm" :variant="activeView === 'table' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="activeView = 'table'">+ <Button v-if="hasTableView" size="sm" :variant="activeView === 'table' ? 'secondary' : 'ghost'" class="h-6 px-2 text-xs gap-1" @click="selectView('table')"><Table2 class="h-3.5 w-3.5" />{{ t("explain.standardTable") }}</Button>diff --git a/apps/desktop/src/components/explain/__tests__/ExplainPlanViewer.defaultView.spec.ts b/apps/desktop/src/components/explain/__tests__/ExplainPlanViewer.defaultView.spec.tsnew file mode 100644index 0000000000..0fccdddffc--- /dev/null+++ b/apps/desktop/src/components/explain/__tests__/ExplainPlanViewer.defaultView.spec.ts@@ -0,0 +1,208 @@+// @vitest-environment happy-dom++import { afterEach, describe, expect, it } from "vitest";+import { createApp, h, nextTick, ref, type App } from "vue";+import { createI18n } from "vue-i18n";+import en from "@/i18n/locales/en";+import zhCN from "@/i18n/locales/zh-CN";+import { parseExplainResult } from "@/lib/diagram/explainPlan";+import ExplainPlanViewer from "@/components/explain/ExplainPlanViewer.vue";+import type { QueryResult } from "@/types/database";++let app: App | undefined;++afterEach(() => {+ app?.unmount();+ app = undefined;+ document.body.innerHTML = "";+});++function createMockPlan() {+ return parseExplainResult("mysql", {+ columns: ["EXPLAIN"],+ rows: [[JSON.stringify({ query_block: { select_id: 1, cost_info: { query_cost: "1.00" }, table: { table_name: "users", access_type: "ALL", rows_examined_per_scan: 10 } } })]],+ affected_rows: 0,+ execution_time_ms: 1,+ });+}++const mockTableResult: QueryResult = {+ columns: ["id", "select_type", "table", "type", "rows"],+ rows: [[1, "SIMPLE", "users", "ALL", 10]],+ affected_rows: 1,+ execution_time_ms: 1,+};++describe("ExplainPlanViewer defaultView prop", () => {+ it("defaults to canvas view when defaultView is not specified", async () => {+ const plan = createMockPlan();+ const i18n = createI18n({ legacy: false, locale: "en", messages: { en, "zh-CN": zhCN } });+ const container = document.createElement("div");+ document.body.append(container);++ app = createApp(ExplainPlanViewer, {+ plan,+ tableResult: mockTableResult,+ });+ app.use(i18n);+ app.mount(container);+ await nextTick();++ // Canvas button should have the secondary variant (active), and table button should be ghost+ const canvasBtn = [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("Canvas"));+ const tableBtn = [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("Table"));++ expect(canvasBtn).toBeDefined();+ expect(tableBtn).toBeDefined();+ expect(canvasBtn?.className).toContain("bg-secondary");+ expect(tableBtn?.className).not.toContain("bg-secondary");+ });++ it("defaults to standard table view when defaultView is table and tableResult is present", async () => {+ const plan = createMockPlan();+ const i18n = createI18n({ legacy: false, locale: "en", messages: { en, "zh-CN": zhCN } });+ const container = document.createElement("div");+ document.body.append(container);++ app = createApp(ExplainPlanViewer, {+ plan,+ tableResult: mockTableResult,+ defaultView: "table",+ });+ app.use(i18n);+ app.mount(container);+ await nextTick();++ const canvasBtn = [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("Canvas"));+ const tableBtn = [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("Table"));++ expect(canvasBtn?.className).not.toContain("bg-secondary");+ expect(tableBtn?.className).toContain("bg-secondary");+ expect(container.querySelector("table")).not.toBeNull();+ expect(container.textContent).toContain("SIMPLE");+ });++ it("falls back to canvas view when defaultView is table but tableResult is not available", async () => {+ const plan = createMockPlan();+ const i18n = createI18n({ legacy: false, locale: "en", messages: { en, "zh-CN": zhCN } });+ const container = document.createElement("div");+ document.body.append(container);++ app = createApp(ExplainPlanViewer, {+ plan,+ defaultView: "table",+ });+ app.use(i18n);+ app.mount(container);+ await nextTick();++ const canvasBtn = [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("Canvas"));+ expect(canvasBtn?.className).toContain("bg-secondary");+ });++ it("defaults to tree view when defaultView is tree", async () => {+ const plan = createMockPlan();+ const i18n = createI18n({ legacy: false, locale: "en", messages: { en, "zh-CN": zhCN } });+ const container = document.createElement("div");+ document.body.append(container);++ app = createApp(ExplainPlanViewer, {+ plan,+ tableResult: mockTableResult,+ defaultView: "tree",+ });+ app.use(i18n);+ app.mount(container);+ await nextTick();++ const treeBtn = [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("Tree"));+ expect(treeBtn?.className).toContain("bg-secondary");+ });++ it("defaults to summary view when defaultView is summary", async () => {+ const plan = createMockPlan();+ const i18n = createI18n({ legacy: false, locale: "en", messages: { en, "zh-CN": zhCN } });+ const container = document.createElement("div");+ document.body.append(container);++ app = createApp(ExplainPlanViewer, {+ plan,+ tableResult: mockTableResult,+ defaultView: "summary",+ });+ app.use(i18n);+ app.mount(container);+ await nextTick();++ const summaryBtn = [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("Summary"));+ expect(summaryBtn?.className).toContain("bg-secondary");+ });++ it("defaults to raw view when defaultView is raw", async () => {+ const plan = createMockPlan();+ const i18n = createI18n({ legacy: false, locale: "en", messages: { en, "zh-CN": zhCN } });+ const container = document.createElement("div");+ document.body.append(container);++ app = createApp(ExplainPlanViewer, {+ plan,+ tableResult: mockTableResult,+ defaultView: "raw",+ });+ app.use(i18n);+ app.mount(container);+ await nextTick();++ const rawBtn = [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("JSON"));+ expect(rawBtn?.className).toContain("bg-secondary");+ });++ it("allows switching views by clicking buttons and resets to default on new execution", async () => {+ const plan = createMockPlan();+ const i18n = createI18n({ legacy: false, locale: "en", messages: { en, "zh-CN": zhCN } });+ const container = document.createElement("div");+ document.body.append(container);++ const loadingRef = ref(false);+ const sourceSqlRef = ref("SELECT * FROM users");++ const Wrapper = {+ setup() {+ return () =>+ h(ExplainPlanViewer, {+ plan,+ tableResult: mockTableResult,+ defaultView: "table",+ loading: loadingRef.value,+ sourceSql: sourceSqlRef.value,+ });+ },+ };++ app = createApp(Wrapper);+ app.use(i18n);+ app.mount(container);+ await nextTick();++ const canvasBtn = () => [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("Canvas"));+ const tableBtn = () => [...container.querySelectorAll("button")].find((btn) => btn.textContent?.includes("Table"));++ expect(tableBtn()?.className).toContain("bg-secondary");++ // Manually click canvas+ canvasBtn()!.click();+ await nextTick();+ expect(canvasBtn()?.className).toContain("bg-secondary");+ expect(tableBtn()?.className).not.toContain("bg-secondary");++ // Trigger a new execution+ loadingRef.value = true;+ await nextTick();+ loadingRef.value = false;+ await nextTick();++ // Should reset back to defaultView ("table")+ expect(tableBtn()?.className).toContain("bg-secondary");+ expect(canvasBtn()?.className).not.toContain("bg-secondary");+ });+});diff --git a/apps/desktop/src/components/layout/ContentArea.vue b/apps/desktop/src/components/layout/ContentArea.vueindex 196a7aa1a4..b992031c02 100644--- a/apps/desktop/src/components/layout/ContentArea.vue+++ b/apps/desktop/src/components/layout/ContentArea.vue@@ -2367,6 +2367,7 @@ defineExpose({:explain-sql="activeTab.explainSql":table-result="activeTab.explainTableResult":table-error="activeTab.explainTableError"+ :default-view="settingsStore.editorSettings.defaultExplainView"/><ElasticsearchProfilePanel v-else-if="activeOutputView === 'profile' && canShowProfile" class="flex-1 min-h-0" :body="activeElasticsearchProfileBody ?? ''" />diff --git a/apps/desktop/src/i18n/locales/az.ts b/apps/desktop/src/i18n/locales/az.tsindex dec78728e4..a15da0debd 100644--- a/apps/desktop/src/i18n/locales/az.ts+++ b/apps/desktop/src/i18n/locales/az.ts@@ -7236,6 +7236,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "Tətbiq edildikdə açıq sorğu vərəqləri yenilənir və yeni vərəqlər üçün standart təyin olunur. Hər vərəqdə ayrıca dəyişə bilərsiniz.",multiStatementDefaultView: "Bir neçə əmr üçün standart görünüş",multiStatementDefaultViewDescription: "Bir neçə SQL əmrindən ibarət toplunun nəticə cədvəlində, yoxsa icra xülasəsində açılacağını seçin.",+ defaultExplainView: "İcra planı üçün standart görünüş",+ defaultExplainViewDescription: "İcra planı işə salındıqdan sonra standart olaraq göstəriləcək görünüş rejimini seçin (iş səthi, ağac, xülasə, cədvəl və ya xam).",queryResultMaxRows: "Sorğu nəticəsində maksimum sətir sayı",queryResultMaxRowsEnabled: "Sorğu nəticəsindəki sətirləri məhdudlaşdır",queryResultMaxRowsDescription: "Sorğuların, cədvəl verilənlərinin, saxlanılan prosedurların və davamlı yükləmənin qaytardığı sətirləri məhdudlaşdırır.",diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.tsindex c29e850871..1879df72d5 100644--- a/apps/desktop/src/i18n/locales/en.ts+++ b/apps/desktop/src/i18n/locales/en.ts@@ -3044,6 +3044,7 @@ export default {rows: "Rows",details: "Details",canvas: "Canvas",+ raw: "Raw",costShare: "Cost share",estRows: "Est. rows",actualRows: "Actual rows",@@ -8123,6 +8124,8 @@ export default {defaultAutoKeepResultsDescription: "Applying this setting updates open query tabs and sets the default for new ones. You can still toggle it per tab.",multiStatementDefaultView: "Default view for multiple statements",multiStatementDefaultViewDescription: "Choose whether batches with multiple SQL statements open in the result table or execution summary.",+ defaultExplainView: "Default view for execution plan",+ defaultExplainViewDescription: "Choose the default view displayed after running an execution plan (canvas, tree, summary, table, or raw).",queryResultMaxRows: "Maximum query result rows",queryResultMaxRowsEnabled: "Limit query result rows",queryResultMaxRowsDescription: "Caps rows returned by queries, table data, stored procedures, and continuous loading.",diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.tsindex 04d4a145bb..e5956dab98 100644--- a/apps/desktop/src/i18n/locales/es.ts+++ b/apps/desktop/src/i18n/locales/es.ts@@ -2984,6 +2984,7 @@ export default withEnglishFallback({rows: "Filas",details: "Detalles",canvas: "Canvas",+ raw: "Crudo",costShare: "Costo (%)",estRows: "Filas est.",actualRows: "Filas reales",@@ -7448,6 +7449,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "Al aplicar este ajuste se actualizan las pestañas de consulta abiertas y se establece el valor predeterminado para las nuevas. Puedes cambiarlo en cada pestaña.",multiStatementDefaultView: "Vista predeterminada para varias sentencias",multiStatementDefaultViewDescription: "Elige si los lotes con varias sentencias SQL se abren en la tabla de resultados o en el resumen de ejecución.",+ defaultExplainView: "Vista predeterminada para el plan de ejecución",+ defaultExplainViewDescription: "Elige la vista predeterminada que se mostrará tras ejecutar un plan de ejecución (canvas, árbol, resumen, tabla o crudo).",queryResultMaxRows: "Máximo de filas del resultado",queryResultMaxRowsEnabled: "Limitar filas del resultado",queryResultMaxRowsDescription: "Limita las filas conservadas por consultas, datos de tablas, procedimientos almacenados y carga continua.",diff --git a/apps/desktop/src/i18n/locales/id.ts b/apps/desktop/src/i18n/locales/id.tsindex 08ca66ac24..0d74ee1a8b 100644--- a/apps/desktop/src/i18n/locales/id.ts+++ b/apps/desktop/src/i18n/locales/id.ts@@ -7906,6 +7906,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "Menerapkan pengaturan ini memperbarui tab kueri yang terbuka dan mengatur default untuk tab baru. Anda tetap dapat mengaktifkan/menonaktifkannya per tab.",multiStatementDefaultView: "Tampilan default untuk beberapa pernyataan",multiStatementDefaultViewDescription: "Pilih apakah batch dengan beberapa pernyataan SQL terbuka pada tabel hasil atau ringkasan eksekusi.",+ defaultExplainView: "Tampilan default untuk rencana eksekusi",+ defaultExplainViewDescription: "Pilih mode tampilan default yang ditampilkan setelah menjalankan rencana eksekusi (canvas, pohon, ringkasan, tabel, atau mentah).",queryResultMaxRows: "Jumlah baris maksimum hasil kueri",queryResultMaxRowsEnabled: "Batasi jumlah baris hasil kueri",queryResultMaxRowsDescription: "Membatasi baris yang dikembalikan oleh kueri, data tabel, prosedur tersimpan, dan pemuatan berkelanjutan.",diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.tsindex 367df5a2c7..8bdd7b4bec 100644--- a/apps/desktop/src/i18n/locales/it.ts+++ b/apps/desktop/src/i18n/locales/it.ts@@ -2835,6 +2835,7 @@ export default withEnglishFallback({rows: "Righe",details: "Dettagli",canvas: "Canvas",+ raw: "Grezzo",costShare: "Costo (%)",estRows: "Righe stim.",actualRows: "Righe effettive",@@ -7226,6 +7227,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "Applicando questa impostazione si aggiornano le schede di query aperte e si imposta il valore predefinito per le nuove. Puoi modificarlo per ogni scheda.",multiStatementDefaultView: "Vista predefinita per istruzioni multiple",multiStatementDefaultViewDescription: "Scegli se i batch con più istruzioni SQL si aprono nella tabella dei risultati o nel riepilogo dell'esecuzione.",+ defaultExplainView: "Vista predefinita per il piano di esecuzione",+ defaultExplainViewDescription: "Scegli la modalità di visualizzazione predefinita mostrata dopo l'esecuzione di un piano (canvas, albero, riepilogo, tabella o grezzo).",queryResultMaxRows: "Numero massimo di righe del risultato",queryResultMaxRowsEnabled: "Limita le righe del risultato",queryResultMaxRowsDescription: "Limita le righe conservate da query, dati tabella, stored procedure e caricamento continuo.",diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.tsindex 67767aaf84..4ee2843408 100644--- a/apps/desktop/src/i18n/locales/ja.ts+++ b/apps/desktop/src/i18n/locales/ja.ts@@ -2861,6 +2861,7 @@ export default withEnglishFallback({rows: "行数",details: "詳細",canvas: "キャンバス",+ raw: "生データ",costShare: "コスト比率",estRows: "推定行数",actualRows: "実際の行数",@@ -7253,6 +7254,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "適用すると開いているクエリタブを更新し、新しいタブの既定値にも設定します。タブごとに切り替えられます。",multiStatementDefaultView: "複数ステートメントの既定ビュー",multiStatementDefaultViewDescription: "複数の SQL ステートメントを含むバッチを、結果テーブルまたは実行サマリーのどちらで開くか選択します。",+ defaultExplainView: "実行計画の既定ビュー",+ defaultExplainViewDescription: "実行計画の実行後に既定で表示するビューモード(キャンバス、ツリー、サマリー、標準テーブル、生データ)を選択します。",queryResultMaxRows: "クエリ結果の最大行数",queryResultMaxRowsEnabled: "クエリ結果の行数を制限",queryResultMaxRowsDescription: "クエリ、テーブルデータ、ストアドプロシージャ、および連続読み込みで保持する合計行数を制限します。",diff --git a/apps/desktop/src/i18n/locales/ko.ts b/apps/desktop/src/i18n/locales/ko.tsindex 481427e727..5661063624 100644--- a/apps/desktop/src/i18n/locales/ko.ts+++ b/apps/desktop/src/i18n/locales/ko.ts@@ -2751,6 +2751,7 @@ export default withEnglishFallback({rows: "행",details: "상세",canvas: "캔버스",+ raw: "원시 데이터",costShare: "비용 비율",estRows: "예상 행",actualRows: "실제 행",@@ -7030,6 +7031,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "적용하면 열린 쿼리 탭을 업데이트하고 새 탭의 기본값으로 설정합니다. 탭별로 전환할 수 있습니다.",multiStatementDefaultView: "여러 구문 기본 보기",multiStatementDefaultViewDescription: "여러 SQL 구문이 있는 배치를 결과 테이블 또는 실행 요약 중 어디에서 열지 선택합니다.",+ defaultExplainView: "실행 계획 기본 보기",+ defaultExplainViewDescription: "실행 계획 실행 후 기본으로 표시할 보기 모드(캔버스, 트리, 요약, 표, 원시 데이터)를 선택합니다。",queryResultMaxRows: "쿼리 결과 최대 행 수",queryResultMaxRowsEnabled: "쿼리 결과 행 수 제한",queryResultMaxRowsDescription: "쿼리, 테이블 데이터, 저장 프로시저 및 연속 로딩에서 유지할 총 행 수를 제한합니다.",diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.tsindex 56eb018267..62ef5876c3 100644--- a/apps/desktop/src/i18n/locales/pt-BR.ts+++ b/apps/desktop/src/i18n/locales/pt-BR.ts@@ -2837,6 +2837,7 @@ export default withEnglishFallback({rows: "Linhas",details: "Detalhes",canvas: "Canvas",+ raw: "Bruto",costShare: "Custo (%)",estRows: "Linhas est.",actualRows: "Linhas reais",@@ -7228,6 +7229,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "Ao aplicar esta configuração, as abas de consulta abertas são atualizadas e o padrão para novas abas é definido. Você pode alternar em cada aba.",multiStatementDefaultView: "Visualização padrão para várias instruções",multiStatementDefaultViewDescription: "Escolha se lotes com várias instruções SQL abrem na tabela de resultados ou no resumo da execução.",+ defaultExplainView: "Visualização padrão para plano de execução",+ defaultExplainViewDescription: "Escolha o modo de visualização padrão exibido após executar um plano de execução (canvas, árvore, resumo, tabela ou bruto).",queryResultMaxRows: "Máximo de linhas do resultado",queryResultMaxRowsEnabled: "Limitar linhas do resultado",queryResultMaxRowsDescription: "Limita as linhas mantidas por consultas, dados de tabelas, procedimentos armazenados e carregamento contínuo.",diff --git a/apps/desktop/src/i18n/locales/ru.ts b/apps/desktop/src/i18n/locales/ru.tsindex 518a2f99ef..68b2c51ed8 100644--- a/apps/desktop/src/i18n/locales/ru.ts+++ b/apps/desktop/src/i18n/locales/ru.ts@@ -2902,6 +2902,7 @@ export default withEnglishFallback({rows: "Строки",details: "Детали",canvas: "Диаграмма",+ raw: "Исходный",costShare: "Доля стоимости",estRows: "Оценка строк",actualRows: "Фактические строки",@@ -8443,6 +8444,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "Применение этой настройки обновляет открытые вкладки запросов и задаёт значение по умолчанию для новых. Переключать её для каждой вкладки всё равно можно.",multiStatementDefaultView: "Вид по умолчанию для нескольких операторов",multiStatementDefaultViewDescription: "Выберите, открывать пакеты с несколькими SQL-операторами в таблице результатов или в сводке выполнения.",+ defaultExplainView: "Вид по умолчанию для плана выполнения",+ defaultExplainViewDescription: "Выберите режим отображения по умолчанию после запуска плана выполнения (диаграмма, дерево, сводка, таблица или исходный).",queryResultMaxRows: "Максимум строк результата запроса",queryResultMaxRowsEnabled: "Ограничить строки результата запроса",queryResultMaxRowsDescription: "Ограничивает строки, возвращаемые запросами, данными таблиц, хранимыми процедурами и непрерывной загрузкой.",diff --git a/apps/desktop/src/i18n/locales/tr.ts b/apps/desktop/src/i18n/locales/tr.tsindex da3dbfc8f3..59ded1f80c 100644--- a/apps/desktop/src/i18n/locales/tr.ts+++ b/apps/desktop/src/i18n/locales/tr.ts@@ -7120,6 +7120,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "Bu ayar uygulandığında açık sorgu sekmeleri güncellenir ve yeni sekmeler için varsayılan belirlenir. Her sekmede ayrı ayrı değiştirebilirsiniz.",multiStatementDefaultView: "Birden çok ifade için varsayılan görünüm",multiStatementDefaultViewDescription: "Birden çok SQL ifadesi içeren toplu işlerin sonuç tablosunda mı yoksa yürütme özetinde mi açılacağını seçin.",+ defaultExplainView: "Yürütme planı için varsayılan görünüm",+ defaultExplainViewDescription: "Yürütme planı çalıştırıldıktan sonra varsayılan olarak görüntülenecek görünüm modunu seçin (canvas, ağaç, özet, tablo veya ham).",queryResultMaxRows: "En fazla sorgu sonucu satırı",queryResultMaxRowsEnabled: "Sorgu sonucu satırlarını sınırla",queryResultMaxRowsDescription: "Sorgular, tablo verisi, saklı yordamlar ve sürekli yükleme tarafından döndürülen satırlara üst sınır koyar.",diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.tsindex ad27ac3cc2..95d1e646cf 100644--- a/apps/desktop/src/i18n/locales/zh-CN.ts+++ b/apps/desktop/src/i18n/locales/zh-CN.ts@@ -2978,6 +2978,7 @@ export default withEnglishFallback({rows: "行数",details: "详情",canvas: "画布",+ raw: "原始格式",costShare: "成本占比",estRows: "预估行数",actualRows: "实际行数",@@ -8109,6 +8110,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "应用后同步更新已打开的查询标签,新建查询标签也使用此设置。仍可在标签内单独切换。",multiStatementDefaultView: "多语句执行默认视图",multiStatementDefaultViewDescription: "选择多条 SQL 语句批量执行后默认打开数据表或执行摘要。",+ defaultExplainView: "执行计划默认视图",+ defaultExplainViewDescription: "选择执行计划运行后默认展示的视图模式(画布、树、摘要、标准表格或原始格式)。",queryResultMaxRows: "查询结果最大行数",queryResultMaxRowsEnabled: "限制查询结果行数",queryResultMaxRowsDescription: "限制查询、表数据、存储过程及连续滚动累计保留的总行数。",diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.tsindex 8047bd3998..70df5352dc 100644--- a/apps/desktop/src/i18n/locales/zh-TW.ts+++ b/apps/desktop/src/i18n/locales/zh-TW.ts@@ -2842,6 +2842,7 @@ export default withEnglishFallback({rows: "筆數",details: "詳情",canvas: "畫布",+ raw: "原始格式",costShare: "成本佔比",estRows: "預估筆數",actualRows: "實際筆數",@@ -6576,6 +6577,8 @@ export default withEnglishFallback({defaultAutoKeepResultsDescription: "套用後同步更新已開啟的查詢分頁,新建查詢分頁也使用此設定。仍可在分頁內個別切換。",multiStatementDefaultView: "多語句執行預設檢視",multiStatementDefaultViewDescription: "選擇多條 SQL 語句批次執行後預設開啟資料表或執行摘要。",+ defaultExplainView: "執行計畫預設檢視",+ defaultExplainViewDescription: "選擇執行計畫運行後預設顯示的檢視模式(畫布、樹狀、摘要、標準表格或原始格式)。",queryResultMaxRows: "查詢結果最大列數",queryResultMaxRowsEnabled: "限制查詢結果列數",queryResultMaxRowsDescription: "限制查詢、資料表資料、預存程序及連續捲動累計保留的總列數。",diff --git a/apps/desktop/src/lib/settings/__tests__/editorSettingsDraft.spec.ts b/apps/desktop/src/lib/settings/__tests__/editorSettingsDraft.spec.tsindex 675144b088..1436da34c1 100644--- a/apps/desktop/src/lib/settings/__tests__/editorSettingsDraft.spec.ts+++ b/apps/desktop/src/lib/settings/__tests__/editorSettingsDraft.spec.ts@@ -140,6 +140,10 @@ describe("EDITOR_SETTINGS_DRAFT_KEYS", () => {expect(EDITOR_SETTINGS_DRAFT_KEYS).toContain("multiStatementDefaultView");});+ it("includes the default explain view", () => {+ expect(EDITOR_SETTINGS_DRAFT_KEYS).toContain("defaultExplainView");+ });+it("includes the cell detail button visibility", () => {expect(EDITOR_SETTINGS_DRAFT_KEYS).toContain("dataGridCellDetailButtonVisible");});@@ -245,6 +249,10 @@ describe("editorSettingsDraftFromSettings", () => {expect(editorSettingsDraftFromSettings(makeSettings({ multiStatementDefaultView: "summary" })).multiStatementDefaultView).toBe("summary");});+ it("maps the default explain view from settings", () => {+ expect(editorSettingsDraftFromSettings(makeSettings({ defaultExplainView: "table" })).defaultExplainView).toBe("table");+ });+it("preserves the table-open default for legacy settings", () => {const settings = makeSettings();delete (settings as Partial<EditorSettings>).tableOpenPageSize;@@ -393,6 +401,13 @@ describe("editorSettingsPatchFromDraft", () => {expect(editorSettingsPatchFromDraft(summary, result)).toEqual({ multiStatementDefaultView: "summary" });});+ it("includes the default explain view when changed", () => {+ const canvas = editorSettingsDraftFromSettings(makeSettings({ defaultExplainView: "canvas" }));+ const table = editorSettingsDraftFromSettings(makeSettings({ defaultExplainView: "table" }));++ expect(editorSettingsPatchFromDraft(table, canvas)).toEqual({ defaultExplainView: "table" });+ });+it("includes continueOnErrorOnBatch in patch when changed", () => {const settings = makeSettings({ continueOnErrorOnBatch: false });const draft = editorSettingsDraftFromSettings(settings);diff --git a/apps/desktop/src/lib/settings/__tests__/settingsSearch.spec.ts b/apps/desktop/src/lib/settings/__tests__/settingsSearch.spec.tsindex 4e4c12eede..81768c34f5 100644--- a/apps/desktop/src/lib/settings/__tests__/settingsSearch.spec.ts+++ b/apps/desktop/src/lib/settings/__tests__/settingsSearch.spec.ts@@ -113,6 +113,16 @@ describe("settings search", () => {});});+ it("indexes the default explain view and its settings control", () => {+ expect(SETTINGS_SEARCH_DEFINITIONS).toContainEqual({+ id: "default-explain-view",+ category: "data",+ titleKey: "settings.defaultExplainView",+ descriptionKey: "settings.defaultExplainViewDescription",+ targetId: "default-explain-view",+ });+ });+it("places SQL file limits in their owning settings categories", () => {expect(SETTINGS_SEARCH_DEFINITIONS).toContainEqual({id: "sql-file-editor-max-mb",diff --git a/apps/desktop/src/lib/settings/editorSettingsDraft.ts b/apps/desktop/src/lib/settings/editorSettingsDraft.tsindex 31b4cd6ba7..6116896565 100644--- a/apps/desktop/src/lib/settings/editorSettingsDraft.ts+++ b/apps/desktop/src/lib/settings/editorSettingsDraft.ts@@ -73,6 +73,7 @@ export const EDITOR_SETTINGS_DRAFT_KEYS = ["dataGridTextFilterPanelHeight","defaultAutoKeepResults","multiStatementDefaultView",+ "defaultExplainView","dataGridAutoTransposeSingleRow","dataGridCellDetailButtonVisible","dataGridCellDetailDialogDefault",diff --git a/apps/desktop/src/lib/settings/settingsSearch.ts b/apps/desktop/src/lib/settings/settingsSearch.tsindex e430e366b3..ccdbfdafdc 100644--- a/apps/desktop/src/lib/settings/settingsSearch.ts+++ b/apps/desktop/src/lib/settings/settingsSearch.ts@@ -229,6 +229,7 @@ export const SETTINGS_SEARCH_DEFINITIONS: readonly SettingsSearchDefinition[] ={ id: "data-table-local-sort-direction", category: "data", titleKey: "settings.tableLocalSortDirection", targetId: "data" },{ id: "default-auto-keep-results", category: "data", titleKey: "settings.defaultAutoKeepResults", descriptionKey: "settings.defaultAutoKeepResultsDescription", targetId: "default-auto-keep-results" },{ id: "multi-statement-default-view", category: "data", titleKey: "settings.multiStatementDefaultView", descriptionKey: "settings.multiStatementDefaultViewDescription", targetId: "multi-statement-default-view" },+ { id: "default-explain-view", category: "data", titleKey: "settings.defaultExplainView", descriptionKey: "settings.defaultExplainViewDescription", targetId: "default-explain-view" },{ id: "query-result-max-rows", category: "data", titleKey: "settings.queryResultMaxRows", descriptionKey: "settings.queryResultMaxRowsDescription", targetId: "data" },{ id: "data-grid-header-comments", category: "data", titleKey: "settings.showColumnCommentsInHeader", descriptionKey: "settings.showColumnCommentsInHeaderDescription", targetId: "data" },{ id: "data-grid-header-types", category: "data", titleKey: "settings.showColumnTypesInHeader", descriptionKey: "settings.showColumnTypesInHeaderDescription", targetId: "data" },diff --git a/apps/desktop/src/lib/settings/settingsTransfer.ts b/apps/desktop/src/lib/settings/settingsTransfer.tsindex 83e7b84357..b288ebd276 100644--- a/apps/desktop/src/lib/settings/settingsTransfer.ts+++ b/apps/desktop/src/lib/settings/settingsTransfer.ts@@ -166,6 +166,7 @@ const SETTINGS_TRANSFER_CATEGORY_KEYS: Record<SettingsTransferCategoryId, readon"dataGridToolbarLayout","defaultAutoKeepResults","multiStatementDefaultView",+ "defaultExplainView","dataGridAutoTransposeSingleRow","dataGridCellDetailButtonVisible","dataGridCellDetailDialogDefault",diff --git a/apps/desktop/src/stores/__tests__/settingsStore.spec.ts b/apps/desktop/src/stores/__tests__/settingsStore.spec.tsindex c9260b3c9a..89cf07b687 100644--- a/apps/desktop/src/stores/__tests__/settingsStore.spec.ts+++ b/apps/desktop/src/stores/__tests__/settingsStore.spec.ts@@ -614,6 +614,15 @@ describe("normalizeEditorSettings", () => {expect(normalizeEditorSettings({ multiStatementDefaultView: "invalid" as any }).multiStatementDefaultView).toBe("result");});+ it("defaults execution plan view to canvas and preserves valid options", () => {+ expect(normalizeEditorSettings({}).defaultExplainView).toBe("canvas");+ expect(normalizeEditorSettings({ defaultExplainView: "table" }).defaultExplainView).toBe("table");+ expect(normalizeEditorSettings({ defaultExplainView: "tree" }).defaultExplainView).toBe("tree");+ expect(normalizeEditorSettings({ defaultExplainView: "summary" }).defaultExplainView).toBe("summary");+ expect(normalizeEditorSettings({ defaultExplainView: "raw" }).defaultExplainView).toBe("raw");+ expect(normalizeEditorSettings({ defaultExplainView: "invalid" as any }).defaultExplainView).toBe("canvas");+ });+it("defaults persistent data grid view options off and preserves enabled values", () => {const defaults = normalizeEditorSettings({});expect(defaults.dataGridMultiRowTranspose).toBe(false);diff --git a/apps/desktop/src/stores/settingsStore.ts b/apps/desktop/src/stores/settingsStore.tsindex 1d2b8fa1e1..560ce472ab 100644--- a/apps/desktop/src/stores/settingsStore.ts+++ b/apps/desktop/src/stores/settingsStore.ts@@ -734,6 +734,8 @@ export const RESULT_TAB_NAMING_MODES = ["source", "ordinal", "comment"] as constexport type ResultTabNamingMode = (typeof RESULT_TAB_NAMING_MODES)[number];const MULTI_STATEMENT_DEFAULT_VIEWS = ["result", "summary"] as const;export type MultiStatementDefaultView = (typeof MULTI_STATEMENT_DEFAULT_VIEWS)[number];+export const DEFAULT_EXPLAIN_VIEWS = ["canvas", "tree", "summary", "table", "raw"] as const;+export type DefaultExplainView = (typeof DEFAULT_EXPLAIN_VIEWS)[number];export const TABLE_FONT_SIZE_MIN = 8;export const TABLE_FONT_SIZE_MAX = 16;export const TABLE_FONT_SIZE_DEFAULT = 13;@@ -988,6 +990,7 @@ export interface EditorSettings {resultRunDisplayMode: ResultRunDisplayMode;defaultAutoKeepResults: boolean;multiStatementDefaultView: MultiStatementDefaultView;+ defaultExplainView: DefaultExplainView;dataGridAutoTransposeSingleRow: boolean;dataGridCellDetailButtonVisible: boolean;dataGridCellDetailDialogDefault: boolean;@@ -1299,6 +1302,7 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {resultRunDisplayMode: "tabs",defaultAutoKeepResults: false,multiStatementDefaultView: "result",+ defaultExplainView: "canvas",dataGridAutoTransposeSingleRow: false,dataGridCellDetailButtonVisible: true,dataGridCellDetailDialogDefault: false,@@ -1518,6 +1522,10 @@ function normalizeMultiStatementDefaultView(value: unknown): MultiStatementDefaureturn MULTI_STATEMENT_DEFAULT_VIEWS.includes(value as MultiStatementDefaultView) ? (value as MultiStatementDefaultView) : DEFAULT_EDITOR_SETTINGS.multiStatementDefaultView;}+function normalizeDefaultExplainView(value: unknown): DefaultExplainView {+ return DEFAULT_EXPLAIN_VIEWS.includes(value as DefaultExplainView) ? (value as DefaultExplainView) : DEFAULT_EDITOR_SETTINGS.defaultExplainView;+}+function normalizeTableFontSize(value: unknown): number {if (typeof value !== "number" || !Number.isFinite(value)) return TABLE_FONT_SIZE_DEFAULT;return Math.min(TABLE_FONT_SIZE_MAX, Math.max(TABLE_FONT_SIZE_MIN, Math.round(value)));@@ -1911,6 +1919,7 @@ export function normalizeEditorSettings(settings: Partial<EditorSettings>, existresultRunDisplayMode: normalizeResultRunDisplayMode(settings.resultRunDisplayMode),defaultAutoKeepResults: settings.defaultAutoKeepResults === true,multiStatementDefaultView: normalizeMultiStatementDefaultView(settings.multiStatementDefaultView),+ defaultExplainView: normalizeDefaultExplainView(settings.defaultExplainView),dataGridAutoTransposeSingleRow: settings.dataGridAutoTransposeSingleRow === true,dataGridCellDetailButtonVisible: typeof settings.dataGridCellDetailButtonVisible === "boolean" ? settings.dataGridCellDetailButtonVisible : DEFAULT_EDITOR_SETTINGS.dataGridCellDetailButtonVisible,dataGridCellDetailDialogDefault: settings.dataGridCellDetailDialogDefault === true,@@ -2776,6 +2785,7 @@ export const useSettingsStore = defineStore("settings", () => {if (partial.resultRunDisplayMode !== undefined) editorSettings.value.resultRunDisplayMode = normalizeResultRunDisplayMode(partial.resultRunDisplayMode);if (partial.defaultAutoKeepResults !== undefined) editorSettings.value.defaultAutoKeepResults = partial.defaultAutoKeepResults === true;if (partial.multiStatementDefaultView !== undefined) editorSettings.value.multiStatementDefaultView = normalizeMultiStatementDefaultView(partial.multiStatementDefaultView);+ if (partial.defaultExplainView !== undefined) editorSettings.value.defaultExplainView = normalizeDefaultExplainView(partial.defaultExplainView);if (partial.dataGridAutoTransposeSingleRow !== undefined) editorSettings.value.dataGridAutoTransposeSingleRow = partial.dataGridAutoTransposeSingleRow === true;if (partial.dataGridCellDetailButtonVisible !== undefined) editorSettings.value.dataGridCellDetailButtonVisible = typeof partial.dataGridCellDetailButtonVisible === "boolean" ? partial.dataGridCellDetailButtonVisible : DEFAULT_EDITOR_SETTINGS.dataGridCellDetailButtonVisible;if (partial.dataGridCellDetailDialogDefault !== undefined) editorSettings.value.dataGridCellDetailDialogDefault = partial.dataGridCellDetailDialogDefault === true;