-
Notifications
You must be signed in to change notification settings - Fork 490
fix: inner groups being moved double when moving outer group (in vue mode) #7447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+184
−3
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a42615f
fix inner groups being moved
christian-byrne ee72ce5
test: add nested group drag test for vue mode
christian-byrne 71e4254
fix: use canvasPosToClientPos for proper coordinate conversion
christian-byrne 281e81e
chore: remove temp file
christian-byrne 350dc16
fix: skip nested groups in moveGroupChildren to prevent double-movement
christian-byrne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
browser_tests/assets/groups/nested-groups-1-inner-node.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| { | ||
| "id": "2ba0b800-2f13-4f21-b8d6-c6cdb0152cae", | ||
| "revision": 0, | ||
| "last_node_id": 17, | ||
| "last_link_id": 9, | ||
| "nodes": [ | ||
| { | ||
| "id": 17, | ||
| "type": "VAEDecode", | ||
| "pos": [ | ||
| 318.8446183157076, | ||
| 355.3961392345528 | ||
| ], | ||
| "size": [ | ||
| 225, | ||
| 102 | ||
| ], | ||
| "flags": {}, | ||
| "order": 0, | ||
| "mode": 0, | ||
| "inputs": [ | ||
| { | ||
| "name": "samples", | ||
| "type": "LATENT", | ||
| "link": null | ||
| }, | ||
| { | ||
| "name": "vae", | ||
| "type": "VAE", | ||
| "link": null | ||
| } | ||
| ], | ||
| "outputs": [ | ||
| { | ||
| "name": "IMAGE", | ||
| "type": "IMAGE", | ||
| "links": null | ||
| } | ||
| ], | ||
| "properties": { | ||
| "Node name for S&R": "VAEDecode" | ||
| }, | ||
| "widgets_values": [] | ||
| } | ||
| ], | ||
| "links": [], | ||
| "groups": [ | ||
| { | ||
| "id": 4, | ||
| "title": "Outer Group", | ||
| "bounding": [ | ||
| -46.25245366331014, | ||
| -150.82497138023245, | ||
| 1034.4034361963616, | ||
| 1007.338460439933 | ||
| ], | ||
| "color": "#3f789e", | ||
| "font_size": 24, | ||
| "flags": {} | ||
| }, | ||
| { | ||
| "id": 3, | ||
| "title": "Inner Group", | ||
| "bounding": [ | ||
| 80.96059074101554, | ||
| 28.123757436778178, | ||
| 718.286373661183, | ||
| 691.2397164539732 | ||
| ], | ||
| "color": "#3f789e", | ||
| "font_size": 24, | ||
| "flags": {} | ||
| } | ||
| ], | ||
| "config": {}, | ||
| "extra": { | ||
| "ds": { | ||
| "scale": 0.7121393732101533, | ||
| "offset": [ | ||
| 289.18242848011835, | ||
| 367.0747755524199 | ||
| ] | ||
| }, | ||
| "frontendVersion": "1.35.5", | ||
| "VHS_latentpreview": false, | ||
| "VHS_latentpreviewrate": 0, | ||
| "VHS_MetadataImage": true, | ||
| "VHS_KeepIntermediate": true, | ||
| "workflowRendererVersion": "Vue" | ||
| }, | ||
| "version": 0.4 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,4 +32,42 @@ test.describe('Vue Node Groups', () => { | |
| 'vue-groups-fit-to-contents.png' | ||
| ) | ||
| }) | ||
|
|
||
| test('should move nested groups together when dragging outer group', async ({ | ||
| comfyPage | ||
| }) => { | ||
| await comfyPage.loadWorkflow('groups/nested-groups-1-inner-node') | ||
|
|
||
| // Get initial positions with null guards | ||
| const outerInitial = await comfyPage.getGroupPosition('Outer Group') | ||
| const innerInitial = await comfyPage.getGroupPosition('Inner Group') | ||
|
|
||
| const initialOffsetX = innerInitial.x - outerInitial.x | ||
| const initialOffsetY = innerInitial.y - outerInitial.y | ||
|
|
||
| // Drag the outer group | ||
| const dragDelta = { x: 100, y: 80 } | ||
| await comfyPage.dragGroup({ | ||
| name: 'Outer Group', | ||
| deltaX: dragDelta.x, | ||
| deltaY: dragDelta.y | ||
| }) | ||
|
|
||
| // Use retrying assertion to wait for positions to update | ||
| await expect(async () => { | ||
| const outerFinal = await comfyPage.getGroupPosition('Outer Group') | ||
| const innerFinal = await comfyPage.getGroupPosition('Inner Group') | ||
|
|
||
| const finalOffsetX = innerFinal.x - outerFinal.x | ||
| const finalOffsetY = innerFinal.y - outerFinal.y | ||
|
|
||
| // Both groups should have moved | ||
| expect(outerFinal.x).not.toBe(outerInitial.x) | ||
| expect(innerFinal.x).not.toBe(innerInitial.x) | ||
|
|
||
| // The relative offset should be maintained (inner group moved with outer) | ||
| expect(finalOffsetX).toBeCloseTo(initialOffsetX, 0) | ||
| expect(finalOffsetY).toBeCloseTo(initialOffsetY, 0) | ||
| }).toPass({ timeout: 5000 }) | ||
|
Comment on lines
+36
to
+71
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Y-axis movement assertions (currently only X is checked). You drag by @@
// Both groups should have moved
expect(outerFinal.x).not.toBe(outerInitial.x)
+ expect(outerFinal.y).not.toBe(outerInitial.y)
expect(innerFinal.x).not.toBe(innerInitial.x)
+ expect(innerFinal.y).not.toBe(innerInitial.y)🤖 Prompt for AI Agents |
||
| }) | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
LGTM! Consider parameter naming consistency.
The method correctly locates the group, converts coordinates, and performs the drag operation. The magic numbers for the title area offset are appropriately documented.
Minor optional suggestion: For consistency with
getGroupPosition, consider usingtitleinstead ofnamefor the group identifier parameter. Both methods refer to the same concept (the group's title property), so using the same terminology would improve API consistency.🤖 Prompt for AI Agents