Skip to content

Conversation

@Myestery
Copy link
Collaborator

@Myestery Myestery commented Nov 1, 2025

This pull request introduces several improvements to Vue reactivity and user experience in the graph node and widget system. The main focus is on ensuring that changes to node and widget data reliably trigger updates in Vue components, improving drag-and-drop support for nodes, and enhancing widget value handling for better compatibility and reactivity.

Vue Reactivity Improvements:

  • In useGraphNodeManager.ts, node data updates now create a completely new object and add a timestamp (_updateTs) to force Vue's reactivity system to detect changes. Additionally, node data is re-set on the next tick to guarantee component updates. [1] [2]
  • Widget value composables (useWidgetValue and related helpers) now accept either a direct value or a getter function for modelValue, and always normalize it to a getter. Watches are updated to use this getter for more reliable reactivity. [1] [2] [3] [4] [5] [6] [7]
  • In useImageUploadWidget.ts, widget value updates now use a new array/object to ensure Vue detects the change, especially for batch uploads.

Drag-and-Drop Support for Nodes:

  • The LGraphNode.vue component adds drag-and-drop event handlers (dragover, dragleave, drop) and visual feedback (isDraggingOver state and highlight ring) for improved user experience when dragging files onto nodes. Node callbacks (onDragOver, onDragDrop) are used for custom validation and handling. [1] [2] [3]

Widget and Audio Upload Handling:

  • In uploadAudio.ts, after uploading an audio file, the widget's callback is manually triggered to ensure Vue nodes update. There is also a commented-out call to mark the canvas as dirty for potential future refresh logic. [1] [2]

These changes collectively improve the reliability and responsiveness of UI updates in the graph node system, especially in scenarios involving external updates, drag-and-drop interactions, and batch widget value changes.

Screen.Recording.2025-11-01.at.11.21.27.mov

┆Issue is synchronized with this Notion page by Unito

Enable drag-and-drop file uploads for load image, load video, and load audio
nodes in VueNodes mode by forwarding drag events to existing litegraph callbacks.

- Add drag event handlers (@dragover, @dragleave, @drop) to node container
- Add visual feedback (border highlight) when dragging valid files over nodes
- Forward drop events to node.onDragDrop callback
- Mark canvas as dirty after drop to trigger VueNodes refresh
Create new arrays for batch uploads to ensure Vue detects value changes.
When allow_batch is true, spread the output array to create a new reference
instead of reusing the same array reference which Vue won't detect as changed.
After uploading audio files, manually invoke the widget callback to ensure
VueNodes reactive system detects the value change and updates the UI.
Also mark canvas as dirty in the callback to trigger VueNodes refresh.
Add nextTick callback to completely replace node data object after widget
updates, ensuring Vue's reactivity system detects changes and re-renders
all dependent components.
Pass modelValue as a getter function (() => props.modelValue) instead of
the direct prop value to ensure the watcher inside useWidgetValue properly
tracks reactive prop changes.
Update useWidgetValue to accept modelValue as either a value or getter function.
Normalize input to always use getter function for proper reactivity tracking.
This fixes the issue where widget value changes weren't detected because the
watcher was watching a static captured value instead of a reactive prop.
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 1, 2025
@github-actions
Copy link

github-actions bot commented Nov 1, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 11/03/2025, 08:36:34 PM UTC

📈 Summary

  • Total Tests: 499
  • Passed: 466 ✅
  • Failed: 0
  • Flaky: 3 ⚠️
  • Skipped: 30 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 457 / ❌ 0 / ⚠️ 3 / ⏭️ 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.

@github-actions
Copy link

github-actions bot commented Nov 1, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 11/03/2025, 08:22:32 PM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Nov 1, 2025

Bundle Size Report

Summary

  • Raw size: 12.2 MB baseline 12.2 MB — 🔴 +1.38 kB
  • Gzip: 2.48 MB baseline 2.48 MB — 🔴 +248 B
  • Brotli: 1.95 MB baseline 1.95 MB — 🔴 +297 B
  • Bundles: 58 current • 58 baseline • 13 added / 13 removed

Category Glance
Graph Workspace 🔴 +1.14 kB (729 kB) · App Entry Points 🔴 +240 B (3.27 MB) · Vendor & Third-Party ⚪ 0 B (5.32 MB) · Other ⚪ 0 B (2.55 MB) · Panels & Settings ⚪ 0 B (293 kB) · UI Components ⚪ 0 B (12.6 kB) · + 3 more

Per-category breakdown
App Entry Points — 3.27 MB (baseline 3.27 MB) • 🔴 +240 B

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-aEbMF5Dj.js (new) 2.89 MB 🔴 +2.89 MB 🔴 +597 kB 🔴 +451 kB
assets/index-B0O_Bl84.js (removed) 2.89 MB 🟢 -2.89 MB 🟢 -597 kB 🟢 -451 kB
assets/index-DkfJ07M2.js (new) 382 kB 🔴 +382 kB 🔴 +76.6 kB 🔴 +62.1 kB
assets/index-D0RmEWS7.js (removed) 382 kB 🟢 -382 kB 🟢 -76.6 kB 🟢 -62.1 kB
assets/index-BGGunjV3.js (removed) 1.75 kB 🟢 -1.75 kB 🟢 -576 B 🟢 -485 B
assets/index-ClK3u_J-.js (new) 1.75 kB 🔴 +1.75 kB 🔴 +577 B 🔴 +484 B

Status: 3 added / 3 removed

Graph Workspace — 729 kB (baseline 728 kB) • 🔴 +1.14 kB

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-pnloaC2t.js (new) 729 kB 🔴 +729 kB 🔴 +142 kB 🔴 +110 kB
assets/GraphView-8qvFdQOA.js (removed) 728 kB 🟢 -728 kB 🟢 -142 kB 🟢 -110 kB

Status: 1 added / 1 removed

Views & Navigation — 8.18 kB (baseline 8.18 kB) • ⚪ 0 B

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-CHXgpwYm.js (removed) 8.18 kB 🟢 -8.18 kB 🟢 -2.48 kB 🟢 -2.17 kB
assets/UserSelectView-DEcwhfiT.js (new) 8.18 kB 🔴 +8.18 kB 🔴 +2.48 kB 🔴 +2.17 kB

Status: 1 added / 1 removed

Panels & Settings — 293 kB (baseline 293 kB) • ⚪ 0 B

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/CreditsPanel-BJ4OL75N.js (new) 22.9 kB 🔴 +22.9 kB 🔴 +5.45 kB 🔴 +4.76 kB
assets/CreditsPanel-DZXMMksd.js (removed) 22.9 kB 🟢 -22.9 kB 🟢 -5.45 kB 🟢 -4.76 kB
assets/KeybindingPanel-CFhj1cIc.js (new) 15.3 kB 🔴 +15.3 kB 🔴 +3.77 kB 🔴 +3.33 kB
assets/KeybindingPanel-DnFoIYR7.js (removed) 15.3 kB 🟢 -15.3 kB 🟢 -3.78 kB 🟢 -3.33 kB
assets/ExtensionPanel-BN4Bv1IT.js (new) 12.1 kB 🔴 +12.1 kB 🔴 +2.84 kB 🔴 +2.49 kB
assets/ExtensionPanel-BpD3k3B7.js (removed) 12.1 kB 🟢 -12.1 kB 🟢 -2.84 kB 🟢 -2.49 kB
assets/AboutPanel-KIBQ_Agp.js (new) 10.3 kB 🔴 +10.3 kB 🔴 +2.67 kB 🔴 +2.34 kB
assets/AboutPanel-VT2Ez-uC.js (removed) 10.3 kB 🟢 -10.3 kB 🟢 -2.67 kB 🟢 -2.34 kB
assets/ServerConfigPanel-CNE8iimS.js (new) 8.23 kB 🔴 +8.23 kB 🔴 +2.17 kB 🔴 +1.91 kB
assets/ServerConfigPanel-Dqap6EoW.js (removed) 8.23 kB 🟢 -8.23 kB 🟢 -2.18 kB 🟢 -1.91 kB
assets/UserPanel-C18AmS1l.js (removed) 7.94 kB 🟢 -7.94 kB 🟢 -2.07 kB 🟢 -1.81 kB
assets/UserPanel-ppIgQ8Mj.js (new) 7.94 kB 🔴 +7.94 kB 🔴 +2.07 kB 🔴 +1.8 kB
assets/settings-0O6mq5to.js 24.3 kB 24.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BYaBy7dC.js 20.4 kB 20.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-C3vygQN4.js 25.7 kB 25.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CbKYXyH0.js 22.7 kB 22.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CCholIsI.js 25 kB 25 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DFX7vRkK.js 19.8 kB 19.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-INJLrcmT.js 31.3 kB 31.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-iR6BKRXe.js 23.7 kB 23.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-YjQmudNE.js 23.5 kB 23.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

UI Components — 12.6 kB (baseline 12.6 kB) • ⚪ 0 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/ComfyQueueButton-BmknSUW1.js (removed) 11.3 kB 🟢 -11.3 kB 🟢 -2.83 kB 🟢 -2.5 kB
assets/ComfyQueueButton-CemZDjVp.js (new) 11.3 kB 🔴 +11.3 kB 🔴 +2.83 kB 🔴 +2.5 kB
assets/UserAvatar.vue_vue_type_script_setup_true_lang-CY-Afo9h.js 1.29 kB 1.29 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 1 added / 1 removed

Data & Services — 10.4 kB (baseline 10.4 kB) • ⚪ 0 B

Stores, services, APIs, and repositories

File Before After Δ Raw Δ Gzip Δ Brotli
assets/keybindingService-B-alrT5I.js (removed) 7.6 kB 🟢 -7.6 kB 🟢 -1.85 kB 🟢 -1.59 kB
assets/keybindingService-CPso6seg.js (new) 7.6 kB 🔴 +7.6 kB 🔴 +1.84 kB 🔴 +1.59 kB
assets/serverConfigStore-Drx1xdev.js 2.79 kB 2.79 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 1 added / 1 removed

Utilities & Hooks — 1.07 kB (baseline 1.07 kB) • ⚪ 0 B

Helpers, composables, and utility bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/mathUtil-CTARWQ-l.js 1.07 kB 1.07 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Vendor & Third-Party — 5.32 MB (baseline 5.32 MB) • ⚪ 0 B

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-other-DTJaZ2wB.js 3.22 MB 3.22 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-PESgPnbc.js 517 B 517 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-JDoAqkQm.js 1.37 MB 1.37 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-BovKm-bo.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-D0cJmhlH.js 92.6 kB 92.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-BZLod3g9.js 407 kB 407 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 2.55 MB (baseline 2.55 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/commands-B2KZRBmX.js 15.1 kB 15.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-Bw-ckyga.js 13.9 kB 13.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-C_NmM85I.js 13.8 kB 13.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CuozCW4W.js 14 kB 14 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DGfVUJCR.js 16.2 kB 16.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-dOJNDogK.js 14.5 kB 14.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DwiE551e.js 14.7 kB 14.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-Fw7mvqSy.js 13.1 kB 13.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-FXnO1W4Q.js 13.2 kB 13.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-B2H4r1yK.js 70.7 kB 70.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BfrcYvru.js 59.4 kB 59.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BhRi1J0e.js 68.4 kB 68.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BUG9wuyt.js 80.3 kB 80.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-C0hL5eRA.js 76.4 kB 76.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CkKZCT7r.js 58.7 kB 58.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-D1RQ0Vb_.js 66.3 kB 66.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DdyfZOXg.js 67.6 kB 67.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DPE2NqRw.js 92.9 kB 92.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-3I1vPgv4.js 181 kB 181 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-B2huPGKQ.js 190 kB 190 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BWugyUzd.js 215 kB 215 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-bXqu6Stq.js 194 kB 194 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CtB2M3sY.js 229 kB 229 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-D-rCrn-T.js 200 kB 200 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-D38DSnl1.js 179 kB 179 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DAsU52ON.js 192 kB 192 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DnGONaA_.js 196 kB 196 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

@christian-byrne christian-byrne added the claude-review Add to trigger a PR code review from Claude Code label Nov 2, 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: Drag vuenodes input (#6514)
Impact: 94 additions, 20 deletions across 6 files

Issue Distribution

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

Category Breakdown

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

Key Findings

Architecture & Design

The main architectural concern is the forced reactivity approach using nextTick and object reassignment. This indicates that the reactive data structure design needs improvement. The current solution is a workaround rather than a proper architectural solution to reactivity challenges.

Performance Impact

Two performance concerns were identified:

  1. Using Date.now() and object spread operations on every widget update could impact performance in graphs with many frequently-updating widgets
  2. Unnecessary array spread operations for non-batch upload scenarios create wasteful operations

Code Quality Issues

Several code quality improvements were identified:

  1. Type assertions without proper runtime validation could cause runtime errors
  2. Manual callback invocations without error handling could lead to uncaught exceptions
  3. Potential null reference errors in drag event handling where event.relatedTarget could be null

Positive Observations

  • The drag-and-drop functionality implementation is well-structured with proper event handling
  • The reactivity improvements address real user experience issues with Vue component updates
  • Code includes helpful comments explaining the reasoning behind the changes
  • The approach to maintaining LiteGraph/Vue synchronization shows good understanding of the dual-state management challenge

References

Next Steps

  1. Address the high-priority architectural issue around reactivity design before merge
  2. Consider implementing proper type guards for the medium-priority type safety issues
  3. Add error handling for callback invocations
  4. Optimize performance for frequently-updated widgets

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

@github-actions github-actions bot removed the claude-review Add to trigger a PR code review from Claude Code label Nov 2, 2025
@dosubot dosubot bot removed the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 3, 2025
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 3, 2025
@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 Nov 3, 2025
const nodeContainerRef = ref<HTMLDivElement>()
// Track mouse position relative to node container for drag and drop
const { isOutside } = useMouseInElement(nodeContainerRef)
Copy link
Contributor

Choose a reason for hiding this comment

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

How does useMouseInElement work? What are the performance tradeoffs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No much perf gains,
The composable helps us know when the dragged file is within the node or not
@DrJKL suggests we should adopt the composable for checks like these

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking of using Pragmatic Drag and Drop instead of re-implementing it in this one component.

@Myestery Myestery merged commit fac86e3 into main Nov 5, 2025
32 checks passed
@Myestery Myestery deleted the drag-vuenodes-input branch November 5, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants