Allow reordering of linked subgraph widgets (#5981)

Widgets which are promoted by linking to a subgraphInput node are now
also displayed in the subgraph configuration window. They can now be
reordered by drag and drop along with proxyWidgets


![linked-reorder](https://github.com/user-attachments/assets/e1b8d590-211a-4d84-9f84-3a5fd5a7aa6c)

Known Issues:
- "Hide All" will incorrectly remove physically linked widgets

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5981-Allow-reordering-of-linked-subgraph-widgets-2866d73d365081d9b27cf4a9c3078007)
by [Unito](https://www.unito.io)
This commit is contained in:
AustinMroz
2025-10-09 13:50:15 -07:00
committed by GitHub
parent 13db1e484b
commit 4e08ed64f0
5 changed files with 89 additions and 65 deletions

View File

@@ -9,13 +9,15 @@ import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets.ts'
import { useLitegraphService } from '@/services/litegraphService'
import { useSubgraphNavigationStore } from '@/stores/subgraphNavigationStore'
export type WidgetItem = [LGraphNode, IBaseWidget]
type PartialNode = Pick<LGraphNode, 'title' | 'id' | 'type'>
export type WidgetItem = [PartialNode, IBaseWidget]
function getProxyWidgets(node: SubgraphNode) {
return parseProxyWidgets(node.properties.proxyWidgets)
}
export function promoteWidget(
node: LGraphNode,
node: PartialNode,
widget: IBaseWidget,
parents: SubgraphNode[]
) {
@@ -30,7 +32,7 @@ export function promoteWidget(
}
export function demoteWidget(
node: LGraphNode,
node: PartialNode,
widget: IBaseWidget,
parents: SubgraphNode[]
) {