From 6a5dd3b51b52113395e49a1bc7c74b1df5bc64ab Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Sat, 9 May 2026 16:27:25 +0800 Subject: [PATCH] feat(sidebar): create connections from group menu --- src/components/layout/AppDialogs.vue | 12 +++++++++++- src/components/sidebar/TreeItem.vue | 8 ++++++++ src/lib/sidebarLayout.ts | 17 ++++++++++++++++- src/stores/connectionStore.ts | 16 +++++++++++++++- tests/sidebarLayout.test.ts | 13 +++++++++++++ 5 files changed, 63 insertions(+), 3 deletions(-) diff --git a/src/components/layout/AppDialogs.vue b/src/components/layout/AppDialogs.vue index 9debba06e6..b912a4aa2e 100644 --- a/src/components/layout/AppDialogs.vue +++ b/src/components/layout/AppDialogs.vue @@ -70,10 +70,20 @@ watch(editConfig, (v) => { if (v) emit("update:showConnectionDialog", true); }); +watch( + () => connectionStore.newConnectionGroupId, + (v) => { + if (v) emit("update:showConnectionDialog", true); + }, +); + watch( () => props.showConnectionDialog, (v) => { - if (!v) connectionStore.stopEditing(); + if (!v) { + connectionStore.stopEditing(); + connectionStore.stopCreatingConnectionInGroup(); + } }, ); diff --git a/src/components/sidebar/TreeItem.vue b/src/components/sidebar/TreeItem.vue index 7c6960c887..6ed41ee3d4 100644 --- a/src/components/sidebar/TreeItem.vue +++ b/src/components/sidebar/TreeItem.vue @@ -1075,6 +1075,10 @@ function deleteConnectionGroup() { showDeleteGroupConfirm.value = true; } +function newConnectionInGroup() { + connectionStore.startCreatingConnectionInGroup(props.node.id); +} + function confirmDeleteGroup() { connectionStore.deleteConnectionGroup(props.node.id); showDeleteGroupConfirm.value = false; @@ -1325,6 +1329,10 @@ const isDragging = computed(() => dragState.active && dragState.draggedId === pr