fix(sidebar): open object browser on double click

This commit is contained in:
t8y2
2026-05-16 11:23:05 +08:00
parent 3be6f4486a
commit 69f05cdf6f
3 changed files with 16 additions and 0 deletions
+3
View File
@@ -373,6 +373,9 @@ function onDoubleClick() {
);
if (action === "open-object-browser") {
void openObjectBrowser();
} else if (action === "open-object-browser-and-expand") {
void openObjectBrowser();
if (!props.node.isExpanded) void toggle();
} else if (action === "open-data") {
openData();
} else if (action === "open-source") {
+3
View File
@@ -5,6 +5,7 @@ export type TreeNodeRowAction = "open-data" | "toggle" | "none";
export type TreeNodeRowDoubleClickAction =
| "open-data"
| "open-object-browser"
| "open-object-browser-and-expand"
| "open-source"
| "open-saved-sql"
| "toggle"
@@ -40,6 +41,8 @@ export function treeNodeRowDoubleClickAction(
if (sourceNodeTypes.has(type)) return "open-source";
if (type === "saved-sql-file") return "open-saved-sql";
if (toggleLeafNodeTypes.has(type)) return "toggle";
if (canOpenObjectBrowser && objectBrowserNodeTypes.has(type) && canExpand) return "open-object-browser-and-expand";
if (canOpenObjectBrowser && objectBrowserNodeTypes.has(type)) return "open-object-browser";
if (canExpand) return "toggle";
}
if (canOpenObjectBrowser && objectBrowserNodeTypes.has(type)) return "open-object-browser";