fix(objects): open view data tab on double-click and stop source toggle-off

This commit is contained in:
Terry Yao authored and GitHub committed 2026-09-20 13:49:05 +08:00
1 parent 555cb25c4f
commit 853a408d30
3 files changed
+24 -14

No files matched your search

@@ -152,7 +152,7 @@ import {
type ObjectBrowserSortDirection,
type ObjectBrowserSortKey,
} from "@/lib/table/objectBrowserRows";
import { isSourceOnlyObjectBrowserRow, resolveRowClickAction, shouldDeferSingleClick, type ObjectBrowserRowAction } from "@/lib/table/objectBrowserRowAction";
import { isSourceOnlyObjectBrowserRow, resolveRowClickAction, shouldDeferSingleClick, singleClickRowAction, type ObjectBrowserRowAction } from "@/lib/table/objectBrowserRowAction";
import { objectBrowserTableSelectionAnchor, objectBrowserTableSelectionRange } from "@/lib/table/objectBrowserSelection";
import { customTypeCapabilities, supportsTypeObjectSource } from "@/lib/database/databaseObjectCapabilities";
import { filterObjectBrowserTableColumns } from "@/lib/table/objectBrowserTableInfo";
@@ -1036,13 +1036,18 @@ function onRowClick(row: ObjectBrowserRow, event: MouseEvent) {
if (row.type === "TABLE") tableSelectionAnchorId.value = row.id;
const activation = settingsStore.editorSettings.sidebarActivation;
const { action, isDouble } = resolveRowClickAction(row, event.detail, activation, effectiveDatabaseType.value);
// Double click: cancel any pending single-click and fire immediately
// Double click: cancel any pending single-click and fire immediately. When
// the row's single/double actions are identical (e.g. VIEW → open-source),
// this gesture's first click already ran it — re-executing would toggle the
// just-opened side panel back off (or emit open-table twice for MongoDB).
if (isDouble) {
if (singleClickTimer) {
clearTimeout(singleClickTimer);
singleClickTimer = null;
}
executeRowAction(row, action);
if (action !== singleClickRowAction(row, effectiveDatabaseType.value)) {
executeRowAction(row, action);
}
return;
}
// Single click: defer when the row has a distinct double-click action so a