When converting single group to subgraph, also convert children (#5217)

* On conversion of single group, convert children

If convert to subgraph is called on a selection consisting of a single
group, the groups children are also converted to subgraph.

* Update locales [skip ci]

* Create new set to avoid mutating passed argument

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
AustinMroz
2025-09-06 02:15:54 -07:00
committed by snomiao
parent 2713f29c56
commit 348046ec91

View File

@@ -1482,6 +1482,12 @@ export class LGraph
if (items.size === 0)
throw new Error('Cannot convert to subgraph: nothing to convert')
const { state, revision, config } = this
const firstChild = [...items][0]
if (items.size === 1 && firstChild instanceof LGraphGroup) {
items = new Set([firstChild])
firstChild.recomputeInsideNodes()
firstChild.children.forEach((n) => items.add(n))
}
const {
boundaryLinks,