@@ -10,6 +10,7 @@ import { SubgraphNode } from '@/lib/litegraph/src/litegraph'
1010import type { LGraphNode } from ' @/lib/litegraph/src/litegraph'
1111import { useCanvasStore } from ' @/renderer/core/canvas/canvasStore'
1212import { useRightSidePanelStore } from ' @/stores/workspace/rightSidePanelStore'
13+ import type { RightSidePanelTab } from ' @/stores/workspace/rightSidePanelStore'
1314import { isLGraphNode } from ' @/utils/litegraphUtil'
1415import { cn } from ' @/utils/tailwindUtil'
1516
@@ -54,8 +55,13 @@ function closePanel() {
5455 rightSidePanelStore .closePanel ()
5556}
5657
57- const tabs = computed <{ label: () => string ; value: string }[]>(() => {
58- const list = [
58+ type RightSidePanelTabList = Array <{
59+ label: () => string
60+ value: RightSidePanelTab
61+ }>
62+
63+ const tabs = computed <RightSidePanelTabList >(() => {
64+ const list: RightSidePanelTabList = [
5965 {
6066 label : () => t (' rightSidePanel.parameters' ),
6167 value: ' parameters'
@@ -108,7 +114,11 @@ watchEffect(() => {
108114 : 'bg-secondary-background'
109115 )
110116 "
111- @click =" isEditingSubgraph = !isEditingSubgraph"
117+ @click ="
118+ rightSidePanelStore.openPanel(
119+ isEditingSubgraph ? 'parameters' : 'subgraph'
120+ )
121+ "
112122 >
113123 <i class =" icon-[lucide--settings-2]" />
114124 </IconButton >
@@ -124,11 +134,15 @@ watchEffect(() => {
124134 </IconButton >
125135 </div >
126136 </div >
127- <nav
128- v-if =" hasSelection && !(isSubgraphNode && isEditingSubgraph)"
129- class =" px-4 pb-2 pt-1"
130- >
131- <TabList v-model =" activeTab" >
137+ <nav v-if =" hasSelection" class =" px-4 pb-2 pt-1" >
138+ <TabList
139+ v-model =" activeTab"
140+ @update:model-value ="
141+ (newTab) => {
142+ rightSidePanelStore.openPanel(newTab as RightSidePanelTab)
143+ }
144+ "
145+ >
132146 <Tab
133147 v-for =" tab in tabs"
134148 :key =" tab.value"
0 commit comments