feat(sidebar): add shortcut to disconnect connections

This commit is contained in:
lxk955 authored and GitHub committed 2026-10-03 13:45:26 +08:00
1 parent 30a4131bb2
commit 3a3eb7dd7c
19 files changed
+93 -5

No files matched your search

@@ -43,7 +43,7 @@ describe("shortcutRegistry editor actions", () => {
"exPasteSqlInCondition",
"toggleFold",
];
const sidebarShortcutActionIds: ShortcutActionId[] = ["copySidebarSelection", "pasteSidebarSelection", "editSidebarConnection", "viewTableDdl"];
const sidebarShortcutActionIds: ShortcutActionId[] = ["copySidebarSelection", "pasteSidebarSelection", "editSidebarConnection", "disconnectSidebarConnection", "viewTableDdl"];
it("registers pagination navigation as unassigned grid shortcuts", () => {
const paginationActions = [
@@ -321,6 +321,10 @@ export function isEditSidebarConnectionShortcut(event: ShortcutLikeEvent, shortc
return matchesShortcut(event, actionShortcut("editSidebarConnection", shortcuts));
}
export function isDisconnectSidebarConnectionShortcut(event: ShortcutLikeEvent, shortcuts?: Partial<ShortcutSettings>): boolean {
return matchesShortcut(event, actionShortcut("disconnectSidebarConnection", shortcuts));
}
export function isViewTableDdlShortcut(event: ShortcutLikeEvent, shortcuts?: Partial<ShortcutSettings>): boolean {
return matchesShortcut(event, actionShortcut("viewTableDdl", shortcuts));
}
@@ -78,6 +78,7 @@ export type ShortcutActionId =
| "copySidebarSelection"
| "pasteSidebarSelection"
| "editSidebarConnection"
| "disconnectSidebarConnection"
| "openDataInNewTab"
| "viewTableDdl"
| "sendSelectionToAi"
@@ -614,6 +615,12 @@ export const SHORTCUT_DEFINITIONS: ShortcutDefinition[] = [
scope: "sidebar",
defaultShortcut: "Mod+E",
},
{
id: "disconnectSidebarConnection",
labelKey: "settings.shortcutDisconnectSidebarConnection",
scope: "sidebar",
defaultShortcut: "Shift+Mod+E",
},
{
id: "openDataInNewTab",
labelKey: "settings.shortcutOpenDataInNewTab",