feat(sidebar): browse objects on database single click

This commit is contained in:
lizzzzz777 authored and GitHub committed 2026-08-14 15:30:31 +08:00
1 parent f29590b1c6
commit 041dc8b856
16 files changed
+101 -7

No files matched your search

@@ -894,10 +894,15 @@ function runRowClickAction(clickDetail: number) {
openMongoTreeData(node);
return;
}
const action = treeNodeRowAction(node.type, canExpand.value, settingsStore.editorSettings.sidebarActivation, currentDatabaseType());
const action = treeNodeRowAction(node.type, canExpand.value, settingsStore.editorSettings.sidebarActivation, currentDatabaseType(), settingsStore.editorSettings.sidebarOpenDatabaseOnSingleClick, canOpenObjectBrowser.value);
if (!shouldRunTreeNodeRowAction(action, clickDetail, isGroupLabel(node))) return;
if (action === "open-data") {
scheduleOpenData(node);
} else if (action === "open-object-browser") {
void openObjectBrowser();
} else if (action === "open-object-browser-and-expand") {
void openObjectBrowser();
if (!node.isExpanded) void toggle();
} else if (action === "open-source") {
openObjectSourceDialog(false);
} else if (action === "open-extension-details") {
@@ -1231,7 +1236,7 @@ function requestDeleteSelectedNode(): boolean {
function onDoubleClick(event: MouseEvent) {
if (dataTabOpenModeFromTreeClick(activeNode.value.type, event, settingsStore.editorSettings.shortcuts.openDataInNewTab) === "new-tab") return;
const action = treeNodeRowDoubleClickAction(activeNode.value.type, canOpenObjectBrowser.value, settingsStore.editorSettings.sidebarActivation, canExpand.value, currentDatabaseType(), canOpenConnectionDatabaseBrowser.value);
const action = treeNodeRowDoubleClickAction(activeNode.value.type, canOpenObjectBrowser.value, settingsStore.editorSettings.sidebarActivation, canExpand.value, currentDatabaseType(), canOpenConnectionDatabaseBrowser.value, settingsStore.editorSettings.sidebarOpenDatabaseOnSingleClick);
if (action === "open-database-browser") {
void openDatabaseBrowser();
} else if (action === "open-object-browser") {
@@ -77,7 +77,7 @@ import { sidebarTreeRuntimeKey } from "@/lib/sidebar/sidebarTreeRuntime";
import { treeNodePinKey } from "@/lib/app/pinnedItems";
import { isTreeGroupNodeType } from "@/lib/sidebar/treeNodeGroup";
import { customTypeCapabilities } from "@/lib/database/databaseObjectCapabilities";
import { shouldActivateTreeNodeOnSingleClick } from "@/lib/sidebar/treeNodeClick";
import { shouldActivateTreeNodeOnSingleClick, shouldOpenObjectBrowserOnSingleClick } from "@/lib/sidebar/treeNodeClick";
const { t } = useI18n();
@@ -1188,6 +1188,10 @@ function onClick(event: MouseEvent) {
}
selectSingleTreeNode(props.node);
rowRef.value?.focus({ preventScroll: true });
if (shouldOpenObjectBrowserOnSingleClick(props.node.type, settingsStore.editorSettings.sidebarOpenDatabaseOnSingleClick)) {
treeRuntime.handleRowClick(props.node, event.detail);
return;
}
if (!shouldActivateTreeNodeOnSingleClick(props.node.type, settingsStore.editorSettings.sidebarActivation) && props.node.type !== "load-more") return;
treeRuntime.handleRowClick(props.node, event.detail);
}