From 89964dafe411b6ad36d3db1ac03b0915ff52627c Mon Sep 17 00:00:00 2001
From: OOMEcho <228389787@qq.com>
Date: Wed, 30 Sep 2026 12:24:11 +0800
Subject: [PATCH] fix(grid): open Columns tab via the table structure shortcut
---
apps/desktop/src/components/grid/DataGrid.vue | 8 ++--
...DataGridEditTableStructureShortcut.spec.ts | 40 +++++++++++++------
2 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue
index 88b66f577b..0bb983edd0 100644
--- a/apps/desktop/src/components/grid/DataGrid.vue
+++ b/apps/desktop/src/components/grid/DataGrid.vue
@@ -9492,7 +9492,7 @@ async function onGridKeydown(event: KeyboardEvent) {
if (!targetAllowsNativeClipboard && props.context === "table-data" && canOpenTableStructureEditor.value && isEditTableStructureShortcut(event, settingsStore.editorSettings.shortcuts)) {
event.preventDefault();
event.stopPropagation();
- openTableStructureEditor();
+ openTableStructureEditor("columns");
return;
}
if (!targetAllowsNativeClipboard && isGoToColumnShortcut(event, settingsStore.editorSettings.shortcuts) && openGoToColumn()) {
@@ -11582,9 +11582,9 @@ function copyDdl() {
copyText(ddlContent.value);
}
-function openTableStructureEditor() {
+function openTableStructureEditor(initialTab: TableInfoTab) {
if (!props.connectionId || !props.database || !props.tableMeta?.tableName || !canOpenTableStructureEditor.value) return;
- queryStore.openTableStructure(props.connectionId, props.database, props.tableMeta.schema, props.tableMeta.tableName, activeTableInfoTab.value, undefined, props.tableMeta.catalog, (props.tableMeta.tableType || "").toUpperCase() === "VIEW" ? "view" : "table");
+ queryStore.openTableStructure(props.connectionId, props.database, props.tableMeta.schema, props.tableMeta.tableName, initialTab, undefined, props.tableMeta.catalog, (props.tableMeta.tableType || "").toUpperCase() === "VIEW" ? "view" : "table");
}
function toggleDdlWrap() {
@@ -14010,7 +14010,7 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
{{ t("contextMenu.dropAllIndexes") }}
-