fix(sidebar): follow activation mode for object browsing
This commit is contained in:
1 parent
ef2fdb941c
commit
f958bf4602
19 files changed
+117
-95
No files matched your search
@@ -512,7 +512,7 @@ const dataTabReuseModeHelp = ref<DataTabReuseMode | null>(null);
|
||||
const editRoutineSourceOpenMode = ref(settingsStore.editorSettings.routineSourceOpenMode);
|
||||
const editSidebarTableSearchEnabled = ref(settingsStore.editorSettings.sidebarTableSearchEnabled);
|
||||
const editAutoSelectActiveSidebarNode = ref(settingsStore.editorSettings.autoSelectActiveSidebarNode);
|
||||
const editSidebarOpenDatabaseOnSingleClick = ref(settingsStore.editorSettings.sidebarOpenDatabaseOnSingleClick);
|
||||
const editSidebarBrowseObjectsOnDatabaseActivation = ref(settingsStore.editorSettings.sidebarBrowseObjectsOnDatabaseActivation);
|
||||
const editOpenTabsRestoreMode = ref<OpenTabsRestoreMode>(settingsStore.editorSettings.openTabsRestoreMode);
|
||||
const editDisconnectTabHandlingMode = ref<DisconnectTabHandlingMode>(settingsStore.editorSettings.disconnectTabHandlingMode);
|
||||
const editDataTabReuseMode = ref<DataTabReuseMode>(settingsStore.editorSettings.dataTabReuseMode);
|
||||
@@ -656,7 +656,7 @@ function currentEditorSettingsDraft(): EditorSettingsDraft {
|
||||
routineSourceOpenMode: editRoutineSourceOpenMode.value,
|
||||
sidebarTableSearchEnabled: editSidebarTableSearchEnabled.value,
|
||||
autoSelectActiveSidebarNode: editAutoSelectActiveSidebarNode.value,
|
||||
sidebarOpenDatabaseOnSingleClick: editSidebarOpenDatabaseOnSingleClick.value,
|
||||
sidebarBrowseObjectsOnDatabaseActivation: editSidebarBrowseObjectsOnDatabaseActivation.value,
|
||||
openTabsRestoreMode: editOpenTabsRestoreMode.value,
|
||||
disconnectTabHandlingMode: editDisconnectTabHandlingMode.value,
|
||||
dataTabReuseMode: editDataTabReuseMode.value,
|
||||
@@ -1052,7 +1052,7 @@ function syncEditorSettingsDraftFromStore() {
|
||||
editRoutineSourceOpenMode.value = settingsStore.editorSettings.routineSourceOpenMode;
|
||||
editSidebarTableSearchEnabled.value = settingsStore.editorSettings.sidebarTableSearchEnabled;
|
||||
editAutoSelectActiveSidebarNode.value = settingsStore.editorSettings.autoSelectActiveSidebarNode;
|
||||
editSidebarOpenDatabaseOnSingleClick.value = settingsStore.editorSettings.sidebarOpenDatabaseOnSingleClick;
|
||||
editSidebarBrowseObjectsOnDatabaseActivation.value = settingsStore.editorSettings.sidebarBrowseObjectsOnDatabaseActivation;
|
||||
editOpenTabsRestoreMode.value = settingsStore.editorSettings.openTabsRestoreMode;
|
||||
editDisconnectTabHandlingMode.value = settingsStore.editorSettings.disconnectTabHandlingMode;
|
||||
editDataTabReuseMode.value = settingsStore.editorSettings.dataTabReuseMode;
|
||||
@@ -1313,7 +1313,7 @@ function resetDefaultsForTab(tab: SettingsCategory) {
|
||||
editRoutineSourceOpenMode.value = DEFAULT_EDITOR_SETTINGS.routineSourceOpenMode;
|
||||
editSidebarTableSearchEnabled.value = DEFAULT_EDITOR_SETTINGS.sidebarTableSearchEnabled;
|
||||
editAutoSelectActiveSidebarNode.value = DEFAULT_EDITOR_SETTINGS.autoSelectActiveSidebarNode;
|
||||
editSidebarOpenDatabaseOnSingleClick.value = DEFAULT_EDITOR_SETTINGS.sidebarOpenDatabaseOnSingleClick;
|
||||
editSidebarBrowseObjectsOnDatabaseActivation.value = DEFAULT_EDITOR_SETTINGS.sidebarBrowseObjectsOnDatabaseActivation;
|
||||
editOpenTabsRestoreMode.value = DEFAULT_EDITOR_SETTINGS.openTabsRestoreMode;
|
||||
editDisconnectTabHandlingMode.value = DEFAULT_EDITOR_SETTINGS.disconnectTabHandlingMode;
|
||||
editDataTabReuseMode.value = DEFAULT_EDITOR_SETTINGS.dataTabReuseMode;
|
||||
@@ -1447,7 +1447,7 @@ function resetAllDefaults() {
|
||||
editRoutineSourceOpenMode.value = DEFAULT_EDITOR_SETTINGS.routineSourceOpenMode;
|
||||
editSidebarTableSearchEnabled.value = DEFAULT_EDITOR_SETTINGS.sidebarTableSearchEnabled;
|
||||
editAutoSelectActiveSidebarNode.value = DEFAULT_EDITOR_SETTINGS.autoSelectActiveSidebarNode;
|
||||
editSidebarOpenDatabaseOnSingleClick.value = DEFAULT_EDITOR_SETTINGS.sidebarOpenDatabaseOnSingleClick;
|
||||
editSidebarBrowseObjectsOnDatabaseActivation.value = DEFAULT_EDITOR_SETTINGS.sidebarBrowseObjectsOnDatabaseActivation;
|
||||
editOpenTabsRestoreMode.value = DEFAULT_EDITOR_SETTINGS.openTabsRestoreMode;
|
||||
editDisconnectTabHandlingMode.value = DEFAULT_EDITOR_SETTINGS.disconnectTabHandlingMode;
|
||||
editDataTabReuseMode.value = DEFAULT_EDITOR_SETTINGS.dataTabReuseMode;
|
||||
@@ -5396,6 +5396,15 @@ onUnmounted(() => {
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-4 rounded-md border bg-muted/20 px-3 py-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<Label for="sidebar-browse-objects-on-database-activation">{{ t("settings.sidebarBrowseObjectsOnDatabaseActivation") }}</Label>
|
||||
<HelpTooltip :label="t('settings.sidebarBrowseObjectsOnDatabaseActivation')">
|
||||
{{ t("settings.sidebarBrowseObjectsOnDatabaseActivationDescription") }}
|
||||
</HelpTooltip>
|
||||
</div>
|
||||
<Switch id="sidebar-browse-objects-on-database-activation" v-model="editSidebarBrowseObjectsOnDatabaseActivation" />
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<Label>{{ t("settings.reuseDataTab") }}</Label>
|
||||
@@ -5556,15 +5565,6 @@ onUnmounted(() => {
|
||||
<Switch id="editor-prefill-new-query" v-model="editPrefillNewQueryWithSelect" class="mt-0.5" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-4 rounded-md border bg-muted/20 px-3 py-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<Label for="sidebar-open-database-on-single-click">{{ t("settings.sidebarOpenDatabaseOnSingleClick") }}</Label>
|
||||
<HelpTooltip :label="t('settings.sidebarOpenDatabaseOnSingleClick')">
|
||||
{{ t("settings.sidebarOpenDatabaseOnSingleClickDescription") }}
|
||||
</HelpTooltip>
|
||||
</div>
|
||||
<Switch id="sidebar-open-database-on-single-click" v-model="editSidebarOpenDatabaseOnSingleClick" />
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-4 rounded-md border bg-muted/20 px-3 py-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<Label for="sidebar-table-search-enabled">{{ t("settings.sidebarTableSearchEnabled") }}</Label>
|
||||
|
||||
+4
-4
@@ -138,16 +138,16 @@ describe("EditorSettingsDialog live preview placement", () => {
|
||||
const objectDisplay = navigationSection.indexOf('t("settings.sidebarObjectDisplay")');
|
||||
const routineOpenMode = navigationSection.indexOf('t("settings.routineSourceOpenMode")');
|
||||
const tableNavigation = navigationSection.indexOf('id="editor-click-table-navigation-ddl"');
|
||||
const openDatabaseOnClick = navigationSection.indexOf('id="sidebar-open-database-on-single-click"');
|
||||
const browseObjectsOnDatabaseActivation = navigationSection.indexOf('id="sidebar-browse-objects-on-database-activation"');
|
||||
const tableSearch = navigationSection.indexOf('id="sidebar-table-search-enabled"');
|
||||
const activeNodeSelection = navigationSection.indexOf('id="auto-select-active-sidebar-node"');
|
||||
|
||||
expect(adjacentDataTabs).toBeGreaterThanOrEqual(0);
|
||||
expect(browseObjectsOnDatabaseActivation).toBeGreaterThanOrEqual(0);
|
||||
expect(adjacentDataTabs).toBeGreaterThan(browseObjectsOnDatabaseActivation);
|
||||
expect(objectDisplay).toBeGreaterThan(adjacentDataTabs);
|
||||
expect(routineOpenMode).toBeGreaterThan(objectDisplay);
|
||||
expect(tableNavigation).toBeGreaterThan(routineOpenMode);
|
||||
expect(openDatabaseOnClick).toBeGreaterThan(tableNavigation);
|
||||
expect(tableSearch).toBeGreaterThan(openDatabaseOnClick);
|
||||
expect(tableSearch).toBeGreaterThan(tableNavigation);
|
||||
expect(activeNodeSelection).toBeGreaterThan(tableSearch);
|
||||
});
|
||||
|
||||
|
||||
@@ -1005,7 +1005,7 @@ function runRowClickAction(clickDetail: number, requestId: number) {
|
||||
void openObjectBrowser();
|
||||
return;
|
||||
}
|
||||
const action = treeNodeRowAction(node.type, canExpand.value, settingsStore.editorSettings.sidebarActivation, currentDatabaseType(), settingsStore.editorSettings.sidebarOpenDatabaseOnSingleClick, canOpenObjectBrowser.value);
|
||||
const action = treeNodeRowAction(node.type, canExpand.value, settingsStore.editorSettings.sidebarActivation, currentDatabaseType(), settingsStore.editorSettings.sidebarBrowseObjectsOnDatabaseActivation, canOpenObjectBrowser.value);
|
||||
// WebKit can keep incrementing click.detail while the pointer moves quickly
|
||||
// between adjacent rows. Nacos entries are idempotent navigation targets, so
|
||||
// do not mistake that rapid one-click switching for a double-click toggle.
|
||||
@@ -1370,7 +1370,7 @@ function onDoubleClick(event: MouseEvent) {
|
||||
void openObjectBrowser();
|
||||
return;
|
||||
}
|
||||
const action = treeNodeRowDoubleClickAction(activeNode.value.type, canOpenObjectBrowser.value, settingsStore.editorSettings.sidebarActivation, canExpand.value, currentDatabaseType(), canOpenConnectionDatabaseBrowser.value, settingsStore.editorSettings.sidebarOpenDatabaseOnSingleClick);
|
||||
const action = treeNodeRowDoubleClickAction(activeNode.value.type, canOpenObjectBrowser.value, settingsStore.editorSettings.sidebarActivation, canExpand.value, currentDatabaseType(), canOpenConnectionDatabaseBrowser.value, settingsStore.editorSettings.sidebarBrowseObjectsOnDatabaseActivation);
|
||||
if (action === "open-database-browser") {
|
||||
void openDatabaseBrowser();
|
||||
} else if (action === "open-object-browser") {
|
||||
|
||||
@@ -86,7 +86,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, shouldOpenObjectBrowserOnSingleClick } from "@/lib/sidebar/treeNodeClick";
|
||||
import { shouldActivateTreeNodeOnSingleClick } from "@/lib/sidebar/treeNodeClick";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -1362,10 +1362,6 @@ 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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user