Skip to content

Conversation

Myestery
Copy link
Collaborator

@Myestery Myestery commented Sep 30, 2025

This pull request refactors the node selection logic in the Vue nodes event handler composable to simplify the function signature and improve single vs. multi-selection behavior. The main change is the removal of the wasDragging parameter from the handleNodeSelect function, with selection logic now determined by the current selection state. Related test code is updated to match the new function signature.

Node selection logic improvements:

  • Refactored the handleNodeSelect function in useNodeEventHandlersIndividual to remove the wasDragging parameter, making the function signature simpler and relying on selection state to handle single vs. multi-selection.
  • Updated the selection logic to check if multiple nodes are already selected using isLGraphNode, and only perform single selection if not.

Code and test updates:

  • Updated all calls to handleNodeSelect in the composable to remove the wasDragging argument, ensuring consistent usage throughout the codebase. [1] [2] [3]
  • Updated all related test cases to use the new handleNodeSelect signature without the third parameter. [1] [2] [3] [4] [5] [6]

Utility import:

  • Added an import for isLGraphNode from @/utils/litegraphUtil to support the updated selection logic.## Summary

Screenshots (if applicable)

Screen.Recording.2025-09-30.at.17.47.18.mov

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 30, 2025
Copy link

github-actions bot commented Sep 30, 2025

🎭 Playwright Test Results

Some tests failed

⏰ Completed at: 10/09/2025, 08:51:08 PM UTC

📈 Summary

  • Total Tests: 488
  • Passed: 453 ✅
  • Failed: 1 ❌
  • Flaky: 4 ⚠️
  • Skipped: 30 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 444 / ❌ 1 / ⚠️ 4 / ⏭️ 30
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 6 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

Copy link

github-actions bot commented Sep 30, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 10/09/2025, 08:31:13 PM UTC

🔗 Links


🎉 Your Storybook is ready for review!

// If it wasn't a drag: single-select the node
if (!wasDragging) {
const selectedMultipleNodes =
canvasStore.selectedItems.filter((n) => isLGraphNode(n)).length > 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a little weird to me. Can we change the selection logic in useNodePointerInteractions instead? I think we'll have to change the interface there anyway since that's where the dragging logic lives.

I would expect the selection to be apparent as I click and drag, not after I release the click.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - I think we should try to match litegraph behavior exactly (unless it's extremely difficult to do).

Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be fairly comfortable to add a test case here, following the existing patterns:

test(`should allow selecting multiple nodes with ${name}+click`, async ({
comfyPage
}) => {
await comfyPage.page.getByText('Load Checkpoint').click()
expect(await comfyPage.vueNodes.getSelectedNodeCount()).toBe(1)
await comfyPage.page.getByText('Empty Latent Image').click({
modifiers: [modifier]
})
expect(await comfyPage.vueNodes.getSelectedNodeCount()).toBe(2)
await comfyPage.page.getByText('KSampler').click({
modifiers: [modifier]
})
expect(await comfyPage.vueNodes.getSelectedNodeCount()).toBe(3)
})

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Oct 3, 2025
@christian-byrne
Copy link
Contributor

The tests might need to be updated

@Myestery
Copy link
Collaborator Author

Myestery commented Oct 3, 2025

Screen.Recording.2025-10-03.at.06.43.01.mov

@Myestery
Copy link
Collaborator Author

Myestery commented Oct 3, 2025

Screen.Recording.2025-10-03.at.06.43.01.mov

Added support for dragging with ctrl and selecting nodes at the same time
Ie node1 is selected, hold ctrl and drag node2
everything drags just like litegraph

@christian-byrne christian-byrne added the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 5, 2025
@Myestery Myestery added New Browser Test Expectations New browser test screenshot should be set by github action and removed New Browser Test Expectations New browser test screenshot should be set by github action labels Oct 7, 2025
Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these tests, we should avoid using litegraph test utils/fixtures (since we are manipulating Vue nodes) and also try to accomplish changes by emulating user behaviors rather than calling methods on code objects. For testing code, we can rely moreso on unit tests; for e2e tests we should test the system using more of a black-box approach - which provides a different breadth of coverage and ensures things work from the most important perspective (user), among other reasons. This means:

  1. Not using NodeReference to get nodes but rather just finding the nodes by using locators that query for visible title text (as a user would do)
  2. Not calling LGraphNode.pin to pin but rather just selecting the node and pressing the pin hotkey (as a user would do).

To see an example of both, check here.

@christian-byrne christian-byrne added the claude-review Add to trigger a PR code review from Claude Code label Oct 7, 2025
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comprehensive PR Review

This review is generated by Claude. It may not always be accurate, as with human reviewers. If you believe that any of the comments are invalid or incorrect, please state why for each. For others, please implement the changes in one way or another.

Review Summary

PR: Select Vue Nodes After Drag (#5863)
Impact: 189 additions, 121 deletions across 8 files

Issue Distribution

  • Critical: 0
  • High: 0
  • Medium: 2
  • Low: 2

Category Breakdown

  • Architecture: 2 issues
  • Security: 0 issues
  • Performance: 1 issue
  • Code Quality: 1 issue

Key Findings

Architecture & Design

This refactoring simplifies the node selection API by removing the wasDragging parameter from handleNodeSelect. However, this introduces two important behavioral changes:

  1. Selection timing change: Selection now occurs on pointer down instead of pointer up, which may affect user experience during drag operations
  2. Selection logic change: The new logic checks for multiple existing selections rather than drag state, which could cause unintended single-selection behavior when clicking on nodes with existing multi-selections

Security Considerations

No security issues identified in this refactoring. The changes maintain the same security boundaries and do not introduce new attack vectors.

Performance Impact

The new hasMultipleNodesSelected function introduces O(n) complexity on every non-multi-select click. While the function includes early termination optimization, it could impact performance with large selection counts.

Integration Points

The changes maintain backward compatibility with existing components and tests. All test files have been properly updated to match the new function signature.

Positive Observations

  • Well-structured refactoring with clear intent
  • Comprehensive test coverage updates across all affected files
  • Good documentation and comments explaining the changes
  • Proper use of TypeScript types and Vue 3 Composition API patterns
  • Clean separation of concerns between selection logic and pointer interactions

Next Steps

  1. Verify the behavioral changes are intentional and align with UX expectations
  2. Consider performance optimizations for the selection checking logic
  3. Validate that drag operations work as expected with the new selection timing
  4. Consider grouping import statements for better code organization

This is a comprehensive automated review. For architectural decisions requiring human judgment, please request additional manual review.

@DrJKL DrJKL requested a review from simula-r October 8, 2025 01:29
christian-byrne
christian-byrne previously approved these changes Oct 8, 2025
Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christian-byrne
Copy link
Contributor

I will fix the conflict

@Myestery
Copy link
Collaborator Author

Myestery commented Oct 8, 2025

I will fix the conflict

Already fixed locally

@christian-byrne christian-byrne removed the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 9, 2025
@christian-byrne christian-byrne added the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 9, 2025
Copy link

github-actions bot commented Oct 9, 2025

Updating Playwright Expectations

@github-actions github-actions bot removed the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 9, 2025
@christian-byrne christian-byrne added the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 9, 2025
@github-actions github-actions bot removed the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 9, 2025
christian-byrne added a commit that referenced this pull request Oct 9, 2025
… build

The workflow was trying to launch the ComfyUI server with
`--front-end-root ../dist` before building the frontend, causing:
  error: argument --front-end-root: The path '../dist' does not exist.

Changes:
- Remove `launch_server: true` from setup-comfyui-server action
- Add setup-frontend step with `include_build_step: true` to build dist/
- Add separate "Launch ComfyUI Server" step that runs AFTER frontend is built

This ensures the dist/ directory exists before the server tries to use it.

Fixes errors seen on PR #5863 and any PR using /update-playwright comment.
christian-byrne added a commit that referenced this pull request Oct 9, 2025
… build

The workflow was trying to launch the ComfyUI server with
`--front-end-root ../dist` before building the frontend, causing:
  error: argument --front-end-root: The path '../dist' does not exist.

Solution: Build frontend before setting up server, so dist/ exists when
the server launches.

Fixes errors seen on PR #5863 and any PR using /update-playwright comment.
DrJKL pushed a commit that referenced this pull request Oct 9, 2025
… build (#6005)

## Problem

The `update-playwright-expectations.yaml` workflow was failing with:
```
error: argument --front-end-root: The path '../dist' does not exist.
```

This was happening because the workflow was trying to launch the ComfyUI
server with `--front-end-root ../dist` before building the frontend.

## Root Cause

The workflow was missing the frontend build step entirely. It went
directly from checkout → setup server with `launch_server: true` → run
tests, skipping the crucial frontend build.

## Solution

1. Remove `launch_server: true` from `setup-comfyui-server` action call
2. Add `setup-frontend` action with `include_build_step: true` to build
the frontend
3. Add separate "Launch ComfyUI Server" step that runs AFTER frontend is
built

This ensures the `dist/` directory exists before the server tries to use
it.

## Testing

This fixes errors seen on PR #5863 and any PR using the
`/update-playwright` comment trigger.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6005-bugfix-Fix-update-playwright-expectations-workflow-missing-frontend-build-2876d73d36508182bb1af1123f3b2a87)
by [Unito](https://www.unito.io)
@christian-byrne christian-byrne added the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 10, 2025
@github-actions github-actions bot removed the New Browser Test Expectations New browser test screenshot should be set by github action label Oct 10, 2025
Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@christian-byrne christian-byrne merged commit 4cb03cf into main Oct 10, 2025
2 checks passed
@christian-byrne christian-byrne deleted the select-node-after-drag branch October 10, 2025 03:48
@arjansingh arjansingh mentioned this pull request Oct 11, 2025
arjansingh added a commit that referenced this pull request Oct 11, 2025
## What's Changed

### 🚀 Features
- Implement DOMWidget for vue (#6006)
- Implement drop-on-canvas + linkconnectoradapter consolidation (#5898)
- Vuenodes/audio widgets (#5627)
- Allow reordering of linked subgraph widgets (#5981)
- Contextmenu Monkeypatch Standardization (#5977)
- Fix/vue nodes snap to grid (#5973)
- Select Vue Nodes After Drag (#5863)
- fix Vue node widgets should be in disabled state if their slots are
connected with a link (#5834)

### 🐛 Bug Fixes
- [bugfix] Fix update-playwright-expectations workflow missing frontend
build (#6005)
- Fix: Reset size when collapsing (#6004)
- fix: misc LOD polish (#6001)
- Fix: Allow uncoloring Vue Nodes (#5991)
- [ci] Fix detached HEAD state in Playwright update workflow (#5985)
- Close zoom menu when toggling minimap visibility (#5974)

### 🔧 Maintenance
- Devex: Improve dev server (#6002)
- CI: Add concurrency checks to PR workflows (#6000)
- [feat] Auto-remove New Browser Test Expectations label after workflow
completes (#5998)
- CI: Simplify update playwright expectations (maybe) (#5994)
- Lint: Add tailwind linter (#5984)
- [feat] Auto-remove claude-review label after CI review completes
(#5983)
- Fix CI: Remove explicit repository parameter causing non-reproducible
test results (#5950)
- refactor: Reorganize GitHub Actions for better reusability (#5949)
- devex: Update CODEOWNERS (#5999)
- Docs: Update agent instructions about style classes (#5990)
- Style: Fix move cursors that should be grabs (#5989)
- Workflow templates review (#5975)

**Full Changelog**:
v1.29.0...v1.29.1

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6012-1-29-1-2896d73d365081b08418f46934651c41)
by [Unito](https://www.unito.io)

Co-authored-by: arjansingh <[email protected]>
arjansingh pushed a commit that referenced this pull request Oct 12, 2025
… build (#6005)

## Problem

The `update-playwright-expectations.yaml` workflow was failing with:
```
error: argument --front-end-root: The path '../dist' does not exist.
```

This was happening because the workflow was trying to launch the ComfyUI
server with `--front-end-root ../dist` before building the frontend.

## Root Cause

The workflow was missing the frontend build step entirely. It went
directly from checkout → setup server with `launch_server: true` → run
tests, skipping the crucial frontend build.

## Solution

1. Remove `launch_server: true` from `setup-comfyui-server` action call
2. Add `setup-frontend` action with `include_build_step: true` to build
the frontend
3. Add separate "Launch ComfyUI Server" step that runs AFTER frontend is
built

This ensures the `dist/` directory exists before the server tries to use
it.

## Testing

This fixes errors seen on PR #5863 and any PR using the
`/update-playwright` comment trigger.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6005-bugfix-Fix-update-playwright-expectations-workflow-missing-frontend-build-2876d73d36508182bb1af1123f3b2a87)
by [Unito](https://www.unito.io)
arjansingh pushed a commit that referenced this pull request Oct 12, 2025
This pull request refactors the node selection logic in the Vue nodes
event handler composable to simplify the function signature and improve
single vs. multi-selection behavior. The main change is the removal of
the `wasDragging` parameter from the `handleNodeSelect` function, with
selection logic now determined by the current selection state. Related
test code is updated to match the new function signature.

**Node selection logic improvements:**

* Refactored the `handleNodeSelect` function in
`useNodeEventHandlersIndividual` to remove the `wasDragging` parameter,
making the function signature simpler and relying on selection state to
handle single vs. multi-selection.
* Updated the selection logic to check if multiple nodes are already
selected using `isLGraphNode`, and only perform single selection if not.

**Code and test updates:**

* Updated all calls to `handleNodeSelect` in the composable to remove
the `wasDragging` argument, ensuring consistent usage throughout the
codebase.
[[1]](diffhunk://#diff-8d3820a1ca9c569bce00671fdd6290af81315ae11b8f3d6f29a5a9d30379d084L125-R123)
[[2]](diffhunk://#diff-8d3820a1ca9c569bce00671fdd6290af81315ae11b8f3d6f29a5a9d30379d084L146-R144)
[[3]](diffhunk://#diff-8d3820a1ca9c569bce00671fdd6290af81315ae11b8f3d6f29a5a9d30379d084L173-R171)
* Updated all related test cases to use the new `handleNodeSelect`
signature without the third parameter.
[[1]](diffhunk://#diff-89bfc2a05201c6ff7116578efa45f96097594eb346f18446c70aa7125ab1811aL105-R105)
[[2]](diffhunk://#diff-89bfc2a05201c6ff7116578efa45f96097594eb346f18446c70aa7125ab1811aL125-R125)
[[3]](diffhunk://#diff-89bfc2a05201c6ff7116578efa45f96097594eb346f18446c70aa7125ab1811aL144-R144)
[[4]](diffhunk://#diff-89bfc2a05201c6ff7116578efa45f96097594eb346f18446c70aa7125ab1811aL162-R162)
[[5]](diffhunk://#diff-89bfc2a05201c6ff7116578efa45f96097594eb346f18446c70aa7125ab1811aL174-R174)
[[6]](diffhunk://#diff-89bfc2a05201c6ff7116578efa45f96097594eb346f18446c70aa7125ab1811aL187-R187)

**Utility import:**

* Added an import for `isLGraphNode` from `@/utils/litegraphUtil` to
support the updated selection logic.## Summary

<!-- One sentence describing what changed and why. -->


## Screenshots (if applicable)



https://github.com/user-attachments/assets/71e856d3-afc2-497d-826e-5b485066e7fe

---------

Co-authored-by: github-actions <[email protected]>
arjansingh added a commit that referenced this pull request Oct 12, 2025
## What's Changed

### 🚀 Features
- Implement DOMWidget for vue (#6006)
- Implement drop-on-canvas + linkconnectoradapter consolidation (#5898)
- Vuenodes/audio widgets (#5627)
- Allow reordering of linked subgraph widgets (#5981)
- Contextmenu Monkeypatch Standardization (#5977)
- Fix/vue nodes snap to grid (#5973)
- Select Vue Nodes After Drag (#5863)
- fix Vue node widgets should be in disabled state if their slots are
connected with a link (#5834)

### 🐛 Bug Fixes
- [bugfix] Fix update-playwright-expectations workflow missing frontend
build (#6005)
- Fix: Reset size when collapsing (#6004)
- fix: misc LOD polish (#6001)
- Fix: Allow uncoloring Vue Nodes (#5991)
- [ci] Fix detached HEAD state in Playwright update workflow (#5985)
- Close zoom menu when toggling minimap visibility (#5974)

### 🔧 Maintenance
- Devex: Improve dev server (#6002)
- CI: Add concurrency checks to PR workflows (#6000)
- [feat] Auto-remove New Browser Test Expectations label after workflow
completes (#5998)
- CI: Simplify update playwright expectations (maybe) (#5994)
- Lint: Add tailwind linter (#5984)
- [feat] Auto-remove claude-review label after CI review completes
(#5983)
- Fix CI: Remove explicit repository parameter causing non-reproducible
test results (#5950)
- refactor: Reorganize GitHub Actions for better reusability (#5949)
- devex: Update CODEOWNERS (#5999)
- Docs: Update agent instructions about style classes (#5990)
- Style: Fix move cursors that should be grabs (#5989)
- Workflow templates review (#5975)

**Full Changelog**:
v1.29.0...v1.29.1

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6012-1-29-1-2896d73d365081b08418f46934651c41)
by [Unito](https://www.unito.io)

Co-authored-by: arjansingh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:node-interaction area:vue-migration claude-review Add to trigger a PR code review from Claude Code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants