ITADN

Dragging a group in Vue nodes mode leaves its nodes behind

#15566Openchristian-byrne 创建于 3 天前
Potential Bugarea:vue-migrationarea:groups
C
christian-byrnecommented
## Summary With Vue nodes enabled (`Comfy.VueNodes.Enabled`), dragging a group moves the group frame but leaves every node inside it behind. Both the litegraph geometry and the layout store keep the nodes at their old position, so the nodes' hit targets stay where they were while the group visibly moves away. ## Root cause `LGraphGroup.move` moves the frame and then delegates to each child: ```ts // src/lib/litegraph/src/LGraphGroup.ts:255-265 move(deltaX: number, deltaY: number, skipChildren: boolean = false): void { if (this.pinned) return this._pos[0] += deltaX this._pos[1] += deltaY if (skipChildren === true) return for (const item of this._children) { item.move(deltaX, deltaY) } } ``` `LGraphNode.move` returns early in Vue nodes mode: ```ts // src/lib/litegraph/src/LGraphNode.ts:2165-2177 move(deltaX: number, deltaY: number): void { if (this.pinned) return // If Vue nodes mode is enabled, skip LiteGraph's direct position update // The layout store will handle the movement and sync back to LiteGraph if (LiteGraph.vueNodesMode) { return } this.pos = [this._pos[0] + deltaX, this._pos[1] + deltaY] } ``` The comment is only true for a node drag, which originates in the Vue layer and writes to `layoutStore` itself. A group drag originates in litegraph and writes nothing to `layoutStore` for the children, so the delta is dropped entirely. ## Reproduction 1. Enable `Comfy.VueNodes.Enabled`. 2. Create a group containing at least one node. 3. Drag the group by its title bar. The group moves; the nodes do not. Unit reproduction (green on `main` today, pinned in `src/renderer/core/layout/store/hitTargetAuthority.test.ts`): ```ts LiteGraph.vueNodesMode = true group.move(100, 100) expect([...group.pos]).toEqual([200, 460]) expect(graph.getNodeOnPos(125, 425)).toBe(node) // node did not move expect(graph.getNodeOnPos(225, 525)).toBeNull() ``` The same test in legacy mode moves the node and its slot hit targets correctly. ## Impact Group drag is a core interaction and it is broken whenever Vue nodes are on, which is the default on Cloud and Desktop (`defaultsByInstallVersion` `1.41.0`). Relevant to the ECS migration's invariant I2 (geometry writable through two paths that disagree). ## Suggested fix Have `LGraphGroup.move` write child moves through the layout store when `LiteGraph.vueNodesMode` is set, rather than relying on `LGraphNode.move`, which is deliberately inert in that mode.
0 条评论