Skip to content

Restore Vue upload-node file drops and harden media drag/paste handling after #9463 - #10841

Open
xmarre wants to merge 1 commit into
Comfy-Org:mainfrom
xmarre:codex/async-dnd-drop-bridge
Open

xmarre wants to merge 1 commit into
Comfy-Org:mainfrom
xmarre:codex/async-dnd-drop-bridge

Conversation

@xmarre

@xmarre xmarre commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Restore local file drops over Vue upload nodes after #9463. Graph-canvas drops that already have defaultPrevented can reach the intended node; explicit event ownership prevents duplicate handling by Vue, Agent-panel, and document handlers.

The routing also handles DataTransfer.items, Firefox URI transfers, zero-byte BMP placeholders, and empty-MIME media files. Explicit MIME types take precedence over filename extensions. Clipboard files are captured before asynchronous work, with a compatible selected media node taking priority.

Behavior and compatibility

  • Revalidate node acceptance at drop time; permissive native hover acceptance does not authorize a drop.
  • Preserve URI-only document fallback, real BMP uploads, selection-only guards, success-only Agent attachment telemetry, and upload error reporting.
  • Clear consumed model-drop state and mark the event handled so a stale upload node or document fallback cannot process it again.
  • Normalize empty-MIME EXR/HDR files before filtering, including files available only through transfer items.
  • Restore the shared file-extraction, BMP-placeholder, and handled-event utility exports used by these paths.
  • Expose the shared file-drop entry point through the current ComfyApp interface and read the app registry through useApp().

Upstream reconciliation — November 13, 2026

Rebuilt the existing one-commit PR on the exact upstream main commit 47fb5568bb1b46c97bffa177b49a0c446af3d35e (35 new upstream commits since the November 12 base 9d22b6634e4889b583b26dbc0ed27cdc21c10d33). Six PR-owned files changed upstream; the other 13 retain their exact previous PR blobs.

Upstream changes preserved and rationale

  • perf: show downscaled previews for large images in Vue nodes #23284 (Vue preview performance): image previews use worker-generated display copies for large originals; Vue-mode widgets avoid redundant legacy-canvas image loads. Original-file actions and display-cache lifetime remain upstream-owned. The existing file filter and explicit reject ownership are preserved.
  • refactor: carry structured preview metadata through Vue nodes #23317 (structured preview metadata): Vue node output previews now flow through getNodeOutputs / getNodeOutputItems, retaining original-versus-preview identity and cache revisions, while preserving live preview rendering and MIME-sensitive output filtering. The PR's useVueNodeDragAndDrop hook remains installed independently of the preview contract.
  • refactor: consolidate the properties panel into one domain home #23328 (properties-panel ownership): LGraphNode uses the moved usePropertiesPanelStore domain import; no removed right-side-panel import or obsolete nodeMedia.value.urls usage is reintroduced.
  • feat(execution): nodes Cloud skipped turn red in the editor #23344 (Cloud skipped-output errors): queuePrompt clears prior run errors, preserves early socket errors for the current prompt and uses recordSubmissionNodeErrors with prompt id. The PR's document-drop handler remains separate from that submission/error lifecycle.
  • Add load time optimizations #20361 (startup performance): app startup no longer synchronously calls the subgraph/blueprint fetch, nor retains its unused useSubgraphStore import. The node-drop implementation does not revive those startup side effects.

The PR's existing drag/paste behavior and all previous upstream contracts remain intact.

Isolation, tree verification and limits

  • Original head checkpoint: xmarre/ComfyUI_frontend:checkpoint/pr-10841-20261113 preserves d8c201f8a9941bd77a80c370ee07b30da1218c12.
  • Mirror: mirror/pr-10841-reconcile-20261113 is built on the exact upstream base. Isolated fork validation PR #51, against validation/pr-10841-base-20261113, reports mergeable: true, mergeable_state: clean.
  • Published head: 81b929f9ea56faa9409ab907293f756c74999c45, with one parent 47fb5568bb1b46c97bffa177b49a0c446af3d35e.
  • GitHub topology: one commit ahead / zero behind; 19 changed files; +1,745/−222, identical to the previous PR footprint.
  • Structural evidence: old-base→upstream and old-base→PR line edits for all six shared files were independently extracted and replayed back to each source successfully before integration. No overlapping original-line replacements were found; one same-anchor insertion in LGraphNode.test.ts was deliberately combined in upstream-then-PR order to keep both the structured-preview fixture and native file-drag fixtures. All 13 other paths were copied using their previous Git blob IDs. A read of all 19 final file blobs confirmed no merge markers, obsolete properties-panel imports, stale nodeMedia.value.urls references or unguarded URL.parse calls.
  • Review: 35 prior review threads remain resolved; none unresolved.
  • Execution validation still outstanding: no fresh typecheck, lint/format run, Vitest, production build, browser E2E or native OS-to-browser file-drop execution has been performed on this tree. The isolated fork PR has no CI runs; 14 upstream PR workflows are action_required (no jobs executed) and CLA Assistant passed. Structural verification and clean GitHub mergeability are not runtime test passes.

Upstream GitHub reports mergeable: true with mergeable_state: blocked from review/check gates. This reconciliation updates the existing PR; it does not merge it.

@xmarre
xmarre requested a review from a team April 3, 2026 23:06
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 3, 2026
@coderabbitai

coderabbitai Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Walkthrough

📝 Walkthrough

Walkthrough

The change centralizes media-file classification, adds extension-based detection, improves clipboard file routing, and refactors Vue node drag-and-drop handling. Application drop routing preserves drag-over targets and supports handled or default-prevented canvas drops. Tests cover these flows.

Changes

Media classification and drag-drop handling

Layer / File(s) Summary
Media classification and file extraction
src/utils/eventUtils.ts, src/utils/__tests__/eventUtils.test.ts, src/utils/mediaUploadUtil.ts
Shared helpers classify media by MIME type or filename extension, extract files from transfer items, retain real BMP files, ignore zero-byte BMP placeholders, and expand picker accept lists.
Paste and upload media routing
src/composables/usePaste.ts, src/composables/usePaste.test.ts, src/renderer/extensions/vueNodes/widgets/composables/useImageUploadWidget.ts, src/scripts/app.ts, src/scripts/app.test.ts
Paste and application file handling use shared predicates, preserve clipboard order, filter files for selected media nodes, and ignore missing clipboard data.
Node drag-drop validation and dispatch
src/composables/node/useNodeDragAndDrop.ts, src/composables/node/useNodeDragAndDrop.test.ts
Node drag-and-drop validates direct and item-derived files, excludes synthetic placeholders, supports opaque file items, and dispatches valid drops.
Vue node drag-drop orchestration
src/renderer/extensions/vueNodes/composables/useVueNodeDragAndDrop.ts, src/renderer/extensions/vueNodes/components/LGraphNode.vue, src/renderer/extensions/vueNodes/components/LGraphNode.test.ts
A composable manages drag state, transfer validation, drop handling, callback dispatch, error reporting, and cleanup. LGraphNode delegates to it.
Application drop routing
src/scripts/app.ts, src/scripts/app.test.ts
Canvas drop handling recognizes handled events, default-prevented drops, prior drag-over targets, aggregate targets, and position-based fallback routing.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LGraphNode
  participant useVueNodeDragAndDrop
  participant ComfyApp
  participant MediaPredicates
  participant onDragDrop
  LGraphNode->>useVueNodeDragAndDrop: handleDragOver(DataTransfer)
  useVueNodeDragAndDrop->>MediaPredicates: validate transfer files
  useVueNodeDragAndDrop->>ComfyApp: store dragOverNode
  LGraphNode->>useVueNodeDragAndDrop: handleDrop(DragEvent)
  useVueNodeDragAndDrop->>onDragDrop: dispatch accepted drop
  useVueNodeDragAndDrop->>ComfyApp: mark event handled and clear drag state
  ComfyApp->>ComfyApp: route unhandled canvas drops
Loading
Merge Risk: Minimal · up to 41940

This change restores local file drops on Vue upload nodes and standardizes media drag, drop, and paste handling; no actionable merge-blocking risk remains beyond normal checks and review.

Pre-merge checks: Passed 7 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
End-To-End Test Suggestion For User-Facing Changes Warning This is a suggestion, not a merge requirement. The check used only the review context, as required. No shell commands were run. 1. The diff changes behavior in src/. The PR title is "Restore Vue… Suggestion, not a merge requirement. Feature: A user drags a local image file onto a Vue upload node, or pastes a clipboard image while an image node is selected. The file attaches to that node. Suggested Playwright spec: Add a new …
Passed Passed checks: 7 passed

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
End-To-End Regression Coverage For Fixes Passed The PR description gives a concrete reason for omitting browser_tests/: the Playwright harness cannot reproduce native external drag semantics.
Website End-To-End Regression Coverage Passed The PR changes only frontend files under src/ and no files under apps/website/src/ or apps/website/public/. The website-specific check is not applicable.
Title check Passed The title clearly summarizes the primary change: restoring Vue upload-node file drops and improving media drag and paste handling after issue #9463.
Description check Passed The description follows the template's Summary and Verification sections and is detailed. It explains the problem (local file drops over Vue upload nodes after #9463 no longer reach the node), the rou…
Adr Compliance For Entity/Litegraph Changes Passed PR #10841 (Comfy-Org/ComfyUI_frontend, author xmarre) is in scope for this check. It changes files that relate to graph nodes and widgets, such as LGraphNode.vue, LGraphNode.test.ts, and `useImage…
Full details: Description check

Explanation

The description follows the template's Summary and Verification sections and is detailed. It explains the problem (local file drops over Vue upload nodes after #9463 no longer reach the node), the routing changes, and the compatibility decisions. It also gives concrete verification notes: an upstream reconciliation, structural checks, and the outstanding runtime checks. The template's 'Fixes #ISSUE_NUMBER' line is absent, and no linked issue is named. The Verification section lists no executed tests, typecheck, lint, build, or E2E runs, and it states that none were performed. That gap is disclosed, but it means the verification evidence is incomplete for a runtime change.

Full details: Adr Compliance For Entity/Litegraph Changes

Explanation

PR #10841 (Comfy-Org/ComfyUI_frontend, author xmarre) is in scope for this check. It changes files that relate to graph nodes and widgets, such as LGraphNode.vue, LGraphNode.test.ts, and useImageUploadWidget.ts. It does not change files under src/lib/litegraph/ or src/ecs/. No changed file appears to be a core litegraph or ECS file. The check requires me to use only the PR metadata in the review context. I did not run shell commands. I compared the four patterns against the supplied summaries and description: 1. Command pattern (ADR-LAYOUT): No direct node.pos =, node.size =, or group.pos = mutation appears in the summaries. The drop logic runs in event handlers and composables, not in entity state. 2. God-object growth (ADR-ECS): The summaries show no new methods or properties added to LGraphNode, LGraphCanvas, LGraph, or Subgraph. LGraphNode.vue removes local drag handlers (-24 lines). It delegates them to the new useVueNodeDragAndDrop composable. This extracts behavior. The only ComfyApp change is an optional onDragOver field on dragOverNode. ComfyApp is not one of the four listed classes. 3. ECS data/behavior separation (ADR-ECS): No ECS component or World data structure appears in the diff. 4. Extension ecosystem (ADR-ECS): The PR uses the existing node.onDragDrop and node.onDragOver callbacks. It does not change the listed callbacks (onConnectionsChange, onRemoved, onAdded, onConfigure, onConnectInput/Output, onWidgetChanged). It does not change node.widgets access, node.serialize overrides, or graph._version++. useImageUploadWidget.ts only swaps local MIME predicates for shared hasVideoType/hasImageType helpers. Limits: I reviewed AI-generated file summaries, not the full raw patch. A pattern hidden in an unsummarized hunk would not appear here. The review threads concern drag-and-drop correctness and workflow automation. They do not raise ADR concerns. No ADR-specific pattern match was found.

Full details: End-To-End Test Suggestion For User-Facing Changes

Explanation

This is a suggestion, not a merge requirement. The check used only the review context, as required. No shell commands were run. 1. The diff changes behavior in src/. The PR title is "Restore Vue upload-node file drops and harden media drag/paste handling after #9463." The diff summary shows behavioral changes in src/composables/usePaste.ts, src/utils/eventUtils.ts, src/scripts/app.ts, src/composables/node/useNodeDragAndDrop.ts, src/renderer/extensions/vueNodes/components/LGraphNode.vue, src/renderer/extensions/vueNodes/composables/useVueNodeDragAndDrop.ts, and src/utils/mediaUploadUtil.ts. These changes cover drop routing, file-type detection, paste dispatch, and the accepted-file lists. This condition holds. 2. A user can trigger the behavior. A user drags a local image or video file onto a Vue upload node. A user pastes a clipboard image while an image node is selected. A user drops a file with an empty MIME type, such as .exr or .hdr. Review threads also report that a URL drag from Firefox can route to the wrong handler. These are normal user actions. This condition holds. 3. No browser_tests/ spec is in the PR. The changed-file summaries cover unit tests under src/ only: usePaste.test.ts, app.test.ts, eventUtils.test.ts, LGraphNode.test.ts, useNodeDragAndDrop.test.ts, and useVueNodeDragAndDrop.test.ts. The review context also lists .github/workflows and scripts/ files. No listed path is under browser_tests/. This condition holds. The PR description also states that no browser E2E run was performed. All three failure conditions hold. The prior FAIL stands. The PR does not address it. Unit tests do not replace an end-to-end spec for these user-visible triggers. Note: the PR also adds eight refresh-automation workflow and script files. Those are CI and tooling. They do not change the result of this check.

Resolution

Suggestion, not a merge requirement. Feature: A user drags a local image file onto a Vue upload node, or pastes a clipboard image while an image node is selected. The file attaches to that node. Suggested Playwright spec: Add a new spec under browser_tests/ for Vue node file drops and paste. No changed file points to an existing spec under browser_tests/. If an existing node drag-and-drop spec exists, extend it instead. - Open a workflow that contains an image upload node in Vue nodes mode. - Drag a local PNG file onto the upload node. - Expect the upload node to accept the file. - Expect no new node to appear on the canvas. - Drag a file with an empty MIME type and an image extension, such as .exr, onto the upload node. - Expect the upload node to accept the file as an image. - Select an image node and paste a clipboard image. - Expect the image to attach to the selected node. - Expect no new node to appear on the canvas.

Finishing Touches

🧪 Generate unit tests (beta)

  • Create PR with unit tests
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
ℹ️ Recent review info

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6ed21089-5162-472a-9ac5-aa3984aa34e2

📥 Commits

Reviewing files that changed from the base of the PR and between d0b83d9 and 4194003.

📒 Files selected for processing (1)

  • src/renderer/extensions/vueNodes/composables/useVueNodeDragAndDrop.test.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.

@github-actions

github-actions Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: loading Building...

@github-actions

github-actions Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ⏳ Running...

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/renderer/extensions/vueNodes/components/LGraphNode.test.ts (1)

346-369: Cover the “promise resolves false still claims event” contract explicitly.

Great regression test. One small gap: it only checks the Promise<true> path. Since this PR intentionally claims the event for async handlers regardless of final resolution, add a mockResolvedValue(false) variant so that behavior is locked in.

Suggested test addition
+    it('should still stop propagation when onDragDrop promise resolves false', async () => {
+      const onDragDrop = vi.fn().mockResolvedValue(false)
+      mockData.mockLgraphNode = {
+        onDragDrop,
+        onDragOver: vi.fn(),
+        isSubgraphNode: () => false
+      }
+
+      const wrapper = mountLGraphNode({ nodeData: mockNodeData })
+      const parentListener = vi.fn()
+      const parent = wrapper.element.parentElement
+      expect(parent).not.toBeNull()
+      parent!.addEventListener('drop', parentListener)
+
+      wrapper.element.dispatchEvent(
+        new Event('drop', { bubbles: true, cancelable: true })
+      )
+
+      await Promise.resolve()
+
+      expect(onDragDrop).toHaveBeenCalled()
+      expect(parentListener).not.toHaveBeenCalled()
+    })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/extensions/vueNodes/components/LGraphNode.test.ts` around lines
346 - 369, Add a second test case mirroring the existing "should stop
propagation when onDragDrop returns a promise" scenario but set onDragDrop =
vi.fn().mockResolvedValue(false); mount the node the same way (using
mountLGraphNode with mockNodeData), attach a parent 'drop' listener
(parentListener), dispatch a cancelable bubbling 'drop' event on
wrapper.element, await the promise resolution (e.g., await Promise.resolve()),
and assert that onDragDrop was called and parentListener was not called;
reference the mockData.mockLgraphNode object and the onDragDrop mock to locate
where to inject this new test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/renderer/extensions/vueNodes/components/LGraphNode.test.ts`:
- Around line 346-369: Add a second test case mirroring the existing "should
stop propagation when onDragDrop returns a promise" scenario but set onDragDrop
= vi.fn().mockResolvedValue(false); mount the node the same way (using
mountLGraphNode with mockNodeData), attach a parent 'drop' listener
(parentListener), dispatch a cancelable bubbling 'drop' event on
wrapper.element, await the promise resolution (e.g., await Promise.resolve()),
and assert that onDragDrop was called and parentListener was not called;
reference the mockData.mockLgraphNode object and the onDragDrop mock to locate
where to inject this new test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8d532a8e-8dc2-481a-8248-e5d5ebbdd6fb

📥 Commits

Reviewing files that changed from the base of the PR and between 17d2870 and c5b37f4.

📒 Files selected for processing (2)
  • src/renderer/extensions/vueNodes/components/LGraphNode.test.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.vue

@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 Apr 3, 2026
coderabbitai[bot]
coderabbitai Bot previously requested changes Apr 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/composables/usePaste.ts`:
- Around line 72-83: The initial paste dispatch in usePaste() currently checks
item.type.startsWith(...) and therefore ignores clipboard File items with empty
MIME; update that dispatch loop to detect files by item.kind === 'file', call
item.getAsFile(), and use
hasImageType(file)/hasAudioType(file)/hasVideoType(file) to decide whether to
call pasteImageNode(), pasteAudioNode(), or pasteVideoNode(); ensure this
mirrors pasteItemsOnNode() behavior and add a regression test for usePaste()
that pastes a File with type === '' and verifies it routes to the appropriate
paste*Node handler.

In `@src/utils/eventUtils.ts`:
- Around line 36-46: The function getMediaTypeFromFile currently falls back to
getMediaTypeFromFilename even when File.type is non-empty; change
getMediaTypeFromFile to only call getMediaTypeFromFilename when type is empty
(e.g., type === ''), and if type is non-empty and doesn't start with
image|audio|video return null immediately; update the function's control flow
around the existing type.startsWith checks and the filename fallback, and add a
regression test that asserts a mismatched non-empty MIME (e.g., name
"report.jpg" with type "application/pdf") returns null to ensure precedence is
enforced.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7e865afd-ab9e-460d-9288-9c1d49c68649

📥 Commits

Reviewing files that changed from the base of the PR and between c5b37f4 and 9762961.

📒 Files selected for processing (7)
  • src/composables/usePaste.test.ts
  • src/composables/usePaste.ts
  • src/renderer/extensions/vueNodes/widgets/composables/useImageUploadWidget.ts
  • src/scripts/app.test.ts
  • src/scripts/app.ts
  • src/utils/__tests__/eventUtils.test.ts
  • src/utils/eventUtils.ts

Comment thread src/composables/usePaste.ts Resolved
Comment thread src/utils/eventUtils.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/renderer/extensions/vueNodes/components/LGraphNode.test.ts (1)

347-353: Add a concrete id to the async mockLgraphNode.

At Line 349, the drop cleanup path is keyed by node.id; this mock currently omits it, so the guard is exercised via undefined rather than realistic IDs.

Suggested test tweak
     const onDragDrop = vi.fn().mockResolvedValue(true)
     mockData.mockLgraphNode = {
+      id: 123,
       onDragDrop,
       onDragOver: vi.fn(() => true),
       isSubgraphNode: () => false
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/extensions/vueNodes/components/LGraphNode.test.ts` around lines
347 - 353, The test's mockLgraphNode lacks a concrete id which causes the
drop-cleanup guard (keyed by node.id) to run with undefined; update the
mockLgraphNode in the "should stop propagation when onDragDrop returns a
promise" test to include a realistic id (e.g., id: 'node-1') so the cleanup path
is exercised with a proper identifier; modify the mock object that contains
onDragDrop, onDragOver and isSubgraphNode to also include this id.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/renderer/extensions/vueNodes/components/LGraphNode.test.ts`:
- Around line 347-353: The test's mockLgraphNode lacks a concrete id which
causes the drop-cleanup guard (keyed by node.id) to run with undefined; update
the mockLgraphNode in the "should stop propagation when onDragDrop returns a
promise" test to include a realistic id (e.g., id: 'node-1') so the cleanup path
is exercised with a proper identifier; modify the mock object that contains
onDragDrop, onDragOver and isSubgraphNode to also include this id.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e2586fa1-3836-4d05-b2c0-cd8bb9a55823

📥 Commits

Reviewing files that changed from the base of the PR and between 9762961 and 55f385e.

📒 Files selected for processing (2)
  • src/renderer/extensions/vueNodes/components/LGraphNode.test.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.vue

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. size:L This PR changes 100-499 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 4, 2026
@xmarre xmarre changed the title Fix async Vue node drag-drop propagation Fix local file drops on Vue upload nodes after #9463 Apr 4, 2026
@xmarre

xmarre commented Apr 4, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Reviews resumed.

@xmarre xmarre changed the title Fix local file drops on Vue upload nodes after #9463 Restore Vue upload-node file drops and harden media drag/paste handling after #9463 Apr 4, 2026
coderabbitai[bot]
coderabbitai Bot previously requested changes Apr 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/extensions/vueNodes/components/LGraphNode.test.ts (1)

325-445: ⚠️ Potential issue | 🟠 Major

This bug fix still needs a browser-level regression or an explicit exemption.

These component tests cover the Vue boundary, but the reported failure only reproduced when the browser delivered the final drop to canvas#graph-canvas. The PR metadata still shows no browser_tests/ change and no explanation for skipping one, so the fix does not satisfy the repo’s bug-fix regression requirement yet.

Based on learnings, "End-to-end regression coverage for fixes: For PRs that include bug-fix language in the title or commit subjects (fix, fixed, fixes, fixing, bugfix, hotfix), ensure at least one of the following: (1) files are changed under browser_tests/, or (2) the PR description includes a concrete, non-placeholder explanation of why an end-to-end regression test was not added."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/extensions/vueNodes/components/LGraphNode.test.ts` around lines
325 - 445, The PR adds unit tests around Vue handling in LGraphNode.test.ts but
lacks the required browser-level regression for the bug that reproduced only
when the browser delivered the final drop to canvas#graph-canvas; either add an
end-to-end browser test under browser_tests/ that reproduces the failing drop
behavior (exercise the real DOM drop to canvas#graph-canvas and assert
propagation/handling matches the fix), or update the PR description to include a
concrete explanation why an E2E test is not applicable; reference the related
test/spec file LGraphNode.test.ts and the DOM target canvas#graph-canvas when
adding the browser test or documenting the exemption.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/composables/node/useNodeDragAndDrop.ts`:
- Around line 33-37: The Drag-and-Drop flow incorrectly treats Chrome→Firefox
BMP placeholders as real files; update the file-filtering so that any File with
type 'image/bmp' is removed before branching on "file-backed" length checks.
Concretely, change filterFiles and filterItemFiles (and the other spots
referenced near the other ranges) to filter out files with file.type ===
'image/bmp' (in addition to the existing fileFilter) and ensure any logic that
decides "is file-backed" uses the filtered array returned by getFilesFromItems /
filterFiles rather than the raw dataTransfer.files or raw File[]; keep using
getFilesFromItems for items but apply the BMP exclusion first so
extractFilesFromDragEvent receives a true URI-only path when appropriate.

In `@src/renderer/extensions/vueNodes/components/LGraphNode.vue`:
- Around line 827-845: hasFileTransfer currently treats any file item or
FileList entry as a file drop, which misclassifies Chrome→Firefox URI drags that
include a synthetic "image/bmp" placeholder; update hasFileTransfer to ignore
placeholder BMP entries (or otherwise mirror extractFilesFromDragEvent's filter)
by only returning true for file items/entries whose MIME type is not 'image/bmp'
(or not in the list extractFilesFromDragEvent ignores), so isUriOnlyDrop
correctly recognizes URI-only drops; apply the same logic where file-list checks
occur so both hasFileTransfer and isUriOnlyDrop behave consistently with
extractFilesFromDragEvent.

In `@src/scripts/app.ts`:
- Around line 610-627: Remove the drop tracing console.log added in the
app.documentDrop handler in src/scripts/app.ts: delete the entire
console.log('app.documentDrop', {...}) block (and any similar drag/upload
tracing added in this PR) so filenames, item file names, and the text/uri-list
payload are not logged; if lightweight telemetry is required instead, replace it
with a non-sensitive log that only records safe booleans or counts (e.g.,
whether a drop occurred and number of items) without including file names,
types, or URI contents.

---

Outside diff comments:
In `@src/renderer/extensions/vueNodes/components/LGraphNode.test.ts`:
- Around line 325-445: The PR adds unit tests around Vue handling in
LGraphNode.test.ts but lacks the required browser-level regression for the bug
that reproduced only when the browser delivered the final drop to
canvas#graph-canvas; either add an end-to-end browser test under browser_tests/
that reproduces the failing drop behavior (exercise the real DOM drop to
canvas#graph-canvas and assert propagation/handling matches the fix), or update
the PR description to include a concrete explanation why an E2E test is not
applicable; reference the related test/spec file LGraphNode.test.ts and the DOM
target canvas#graph-canvas when adding the browser test or documenting the
exemption.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 48b9157e-c849-42e1-b597-5bfd50f33319

📥 Commits

Reviewing files that changed from the base of the PR and between 99e50d6 and c9a867b.

📒 Files selected for processing (8)
  • src/composables/node/useNodeDragAndDrop.test.ts
  • src/composables/node/useNodeDragAndDrop.ts
  • src/composables/node/useNodeImageUpload.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.test.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.vue
  • src/scripts/app.ts
  • src/utils/__tests__/eventUtils.test.ts
  • src/utils/eventUtils.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/utils/tests/eventUtils.test.ts

Comment thread src/scripts/app.ts Resolved
@coderabbitai

coderabbitai Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Reviews resumed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/renderer/extensions/vueNodes/components/LGraphNode.vue (1)

873-880: Minor: Consider consistent cleanup pattern for early return.

This early return path clears app.dragOverNode unconditionally if it exists, unlike clearDragOverState(node.id) which checks the id. This is functionally fine since a node without onDragDrop shouldn't have been set as dragOverNode, but for consistency you could use:

 if (!node?.onDragDrop) {
-  isDraggingOver.value = false
-  if (app.dragOverNode) {
-    app.dragOverNode = null
-    app.canvas.setDirty(false, true)
-  }
+  clearDragOverState(node?.id)
   return
 }

With node?.id being undefined, clearDragOverState would only clear isDraggingOver.value (as intended). However, the current code explicitly clears app.dragOverNode which may be intentional for edge cases—no functional bug here.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/extensions/vueNodes/components/LGraphNode.vue` around lines 873
- 880, The early-return block that handles nodes without onDragDrop currently
sets isDraggingOver.value = false and unconditionally clears app.dragOverNode
and calls app.canvas.setDirty, which is inconsistent with the elsewhere-used
clearDragOverState behavior; replace the manual cleanup with a call to
clearDragOverState(node?.id) so the same id-check and cleanup logic is reused
(this will clear isDraggingOver.value and only clear app.dragOverNode when the
ids match) while preserving the canvas dirty handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/renderer/extensions/vueNodes/components/LGraphNode.vue`:
- Around line 873-880: The early-return block that handles nodes without
onDragDrop currently sets isDraggingOver.value = false and unconditionally
clears app.dragOverNode and calls app.canvas.setDirty, which is inconsistent
with the elsewhere-used clearDragOverState behavior; replace the manual cleanup
with a call to clearDragOverState(node?.id) so the same id-check and cleanup
logic is reused (this will clear isDraggingOver.value and only clear
app.dragOverNode when the ids match) while preserving the canvas dirty handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f435411b-482a-45c4-8987-270dbcfa600f

📥 Commits

Reviewing files that changed from the base of the PR and between c9a867b and d274885.

📒 Files selected for processing (5)
  • src/composables/node/useNodeDragAndDrop.test.ts
  • src/composables/node/useNodeDragAndDrop.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.test.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.vue
  • src/scripts/app.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/composables/node/useNodeDragAndDrop.test.ts
  • src/renderer/extensions/vueNodes/components/LGraphNode.test.ts
  • src/composables/node/useNodeDragAndDrop.ts

coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 4, 2026
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 18, 2026
@christian-byrne christian-byrne self-assigned this Apr 20, 2026
@xmarre
xmarre force-pushed the codex/async-dnd-drop-bridge branch from ab17cf7 to 93f5da8 Compare October 3, 2026 04:00

xmarre commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne October 3 upstream reconciliation is ready for review.

  • head: 93f5da8498aa88a6378ad288bbc2e612afdc5b4e
  • base/current main: ea562b36e4a9628c4e43883aaa117448b7c589a5
  • topology: 1 commit, 0 behind, 16 changed files, mergeable
  • review threads: 0 unresolved

I rebuilt the change from current main rather than resolving conflicts by selecting either side wholesale. The reconciliation preserves the newer Agent composer paste ownership from #18248, #19110's typed upload-widget structure, #19151/#18563 Vue warning/lint changes, #19230's required surface: 'graph' telemetry, #11420's canvas scheduler coverage, #18491 shared test mocks, and the current Agent/CRDT flow from #18700 and subsequent Agent work.

Validation was run on isolated fork PR xmarre#36 before rewriting this branch. Lint, both typecheck surfaces, repo checks, Fallow, localhost/desktop/cloud builds, package tests, all 8 application Vitest coverage shards, merged coverage thresholds, Storybook, website/billing checks, telemetry/assets/ADR/performance/binary-size checks, and CodeRabbit passed.

The fork browser matrix could not execute because the fork runner was denied access to ghcr.io/comfy-org/comfyui-ci-container:0.0.27; failures occurred during container initialization before checkout. The ecosystem matrix likewise reported its verdict as withheld because the registry corpus stage was unavailable. Those are documented in the PR body rather than treated as product-test failures.

Upstream advanced once during validation via #19916, which only changed .claude/skills/reviewing-unit-tests/SKILL.md; the validated 16-file tree was transplanted unchanged onto that final base. Fresh upstream workflows for the final head are currently action_required before jobs start, as expected for this fork PR.

xmarre commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne October 11 upstream reconciliation is ready for review.

  • head: 674cf506eaf47f4ef49a61c7792ccaf129a04802
  • base/current main: c3f213190f93317c71a83601786efb50ba271569
  • topology: 1 commit, 0 behind, 18 changed files, mergeable
  • review threads: 35 resolved, 0 unresolved

The branch is rebuilt from current upstream. The reconciliation retains #19722's extensionless-video rejection/warning and adds explicit, side-effect-free hover ownership for rejected video files; #20374's Vue pointer state machine; #16313's design-system toast API; and #20156's Agent asset-tray metadata and successful-attachment telemetry. Existing drag/drop handoff, URI/BMP handling, MIME fallback and paste routing are retained. The two additional changed files thread the video-rejection eligibility callback into node upload handling and test it.

Work was isolated on mirror/pr-10841-reconcile-20261011, then consolidated on mirror/pr-10841-final-20261011; the previous head is preserved at checkpoint/pr-10841-20261011. GitHub compare confirms 1 ahead / 0 behind, and all 18 final file blob SHAs match the reconciled mirror.

Validation limitation: the isolated fork validation PR #37 did not receive any workflow or check runs. No fresh Vitest, typecheck, lint, build or browser-test pass is claimed for this October 11 tree. The native OS-to-browser external-file drag path also still needs live verification. The updated PR description documents the reconciliation and its validation limits in detail.

xmarre commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

October 14 upstream reconciliation is on this PR.

  • Head: 27c72f7b38f26fb4ae9471d6f62779d1afe2b27c
  • Base: 791f2f7f3dc66ef3ace0cf9e13f6293f6cf66f71
  • GitHub confirms: 1 commit, 0 behind, 19 changed files, mergeable.
  • Original head checkpoint: checkpoint/pr-10841-20261014; mirror work and final candidate are preserved separately. Authorship remains xmarre.

The five conflicting files were reconciled against current behavior. The change preserves #20839's HDR normalization, #20540's consumed model-drop handling, #19143/#19153's app-registry architecture, #18389's Agent video validation, and the semantic colors/dependency removal from #16407, which landed during validation. Executable tests also exposed four missing event utility exports in the prior PR head; these are restored from the earlier implementation.

Evidence and limits: 777 tests passed / 1 skipped across 11 focused suites on the earlier mirror, and the later fetch-mock adjustment passed 26 node routing tests. Format, Stylelint, type-aware Oxlint, ESLint and the changed-line server-fact check completed. CodeRabbit reviewed the earlier mirror with no actionable findings. Typecheck identified a missing constructor argument in the new fixture; this head fixes it, but the execution environment disconnected before final-base revalidation. No fresh final-base typecheck/build or native external-drag pass is claimed, and no fork workflow runs were created. The PR description records the exact tested tree and the three final file differences.

xmarre commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne October 18 upstream reconciliation is ready for review.

  • Head: 057deee3afcc11fb39823459354f1e07552a2d61
  • Current upstream base: e5a8fe732edb5ba56f24212716cf61a4b73d52bc
  • GitHub: 1 commit, 0 behind, 19 changed files, mergeable; 35 existing review threads remain resolved.
  • Prior head preserved at checkpoint/pr-10841-20261018. All work was prepared on mirror/pr-10841-reconcile-20261018 and reviewed structurally via isolated fork PR #40.

The 118 intervening upstream commits include #20782 (import-cycle isolation), #19976/#20757 (canvas lifecycle and selection), #19601 (Agent attachment acceptance and invalid-state flow), and #17469 (Agent transport/identity changes). The reconciliation retains these upstream contracts and reapplies this PR's accepted-drop ownership and paste/media routing. The removed Agent drop-ownership test was retargeted to an existing workflow-JSON drop case. The PR description details the code paths and preserved behavior.

Validation limits: GitHub's merge shape and intended file scope are verified. CodeRabbit reports success on the isolated fork, and the final PR head has passing CLA and Socket Security checks. All 17 upstream Actions runs are action_required before jobs start. No fresh typecheck, Vitest, build, lint or native OS-to-browser drag pass is claimed for this October 18 head; the October 14 test results are historical. Maintainer workflow approval and runtime verification remain outstanding.

The branch is ready for review; it has not been merged.

xmarre commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne October 22 upstream reconciliation is ready for re-review.

  • Head: 117100c572fc87748d78278a458df75ef8c4e598
  • Current upstream base: 3821a0aedbfc463f746e4c4c4ff48ed56ec347ab
  • Topology: 1 commit ahead / 0 behind, 19 changed files, mergeable
  • All 35 prior review threads resolved; xmarre authorship preserved.

The 181 intervening upstream commits were audited for the affected code paths. The reconciliation preserves #20988's theme migration, #21423's extensionless imports, #21300's workflow-owned execution frames, and current Agent consent, workspace auth, EXR preview and attachment contracts (#21532, #21575, #21203). It also incorporates the latest #21644 change to refresh node definitions only after ComfyUI reconnects following an Agent restart. The sole non-exact overlapping hunk was the Agent panel import block; both the EXR imports and the PR's drop-ownership import are retained.

Work was isolated on mirror/pr-10841-reconcile-20261022. The original head is preserved at checkpoint/pr-10841-20261022. Fork validation PR #43 is mergeable, with CodeRabbit success and no review threads. All six upstream-overlapping file patches were checked against the original base/head before they were replayed.

Validation limitation: no current-tree typecheck, Vitest, lint, build, browser E2E or native external-file drag pass was executed. The 18 upstream Actions runs all show action_required before jobs start. These are workflow-approval gates, not test passes or failures. The PR description records the reconciliation details and exact evidence.

The PR branch now contains the final one-commit candidate; no upstream merge was performed.

xmarre commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne October 30 upstream reconciliation is published and ready for review.

The PR description includes the upstream rationale and specific compatibility decisions. No upstream merge was performed.

xmarre commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne Reconciled #10841 against current main.

Final head: 3d3a321796ae3515ef2b76f91666e6465432d386
Upstream base / parent: 3cd25a63c587b627f77a7160f3cceb217e5baf43
Topology: 1 commit ahead, 0 behind; 19 changed files; GitHub reports the PR mergeable.

The 37 upstream commits since the October 30 reconciliation overlap seven PR files. Their PR and upstream patches were replayed against the common base and merged without replacing unrelated changes. The substantive overlap was in ComfyApp's document-drop path: the refactored handler now retains upstream's already-presented graph-load error guard from #21983. The upstream graph-load/FIFO protection, Vue missing-resource indicator (#22344), and Agent send-gating/onboarding changes (#22235, #22475, #22269) remain in place. The PR's media-drop fixes and regression tests remain included.

The prior head is preserved at checkpoint/pr-10841-20261031; work was isolated on mirror/pr-10841-reconcile-20261031. Fork validation PR #46 is mergeable against an exact copy of the upstream base.

Test status: patch-replay and GitHub topology checks passed. Typecheck, lint, Vitest, build, browser E2E and native external file drag have not been run on this candidate. Upstream Actions runs are action_required pending approval, and the fork validation PR did not execute CI. These are remaining verification requirements, not passing checks.

The PR description contains the detailed upstream compatibility notes and verification boundaries.

xmarre commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne The November 4 upstream reconciliation is ready for review.

  • PR head: 1f56eb0ddfab12b556687f50cb490ba354d20ed5
  • Current upstream main / parent: 5826592a88e281d5eb82791af8be9262adbb0540 (199 upstream commits advanced since our October 31 base).
  • Topology: exactly 1 commit, 0 behind; 19 changed files; +1,745/−222 lines, unchanged from the prior PR footprint. GitHub reports mergeable; required review/check gates still block merging.
  • Isolation: previous head preserved at xmarre/ComfyUI_frontend:checkpoint/pr-10841-20261104; reconciliation performed on mirror/pr-10841-reconcile-20261104; exact-base validation PR #47 reports clean mergeability.
  • Upstream integration: nine shared files were reconciled from the common ancestor with verified replay of both sides and no overlapping base-line edits. Preserved browser-safe URL parsing (fix: guard URL.parse and URL.canParse, lint older-browser APIs #22452), object-info-parser migration (refactor: move node-def V2 schema, migration and input-spec interpreter into object-info-parser #22191), workflow canvas ownership (PM-875: fix: bind canvas ownership to the loaded tracker so store tab switches cannot persist the wrong graph #17331), app billing/Agent provenance, and the intervening Agent lifecycle, draft, tab and consent changes. Existing media drop/paste fixes and tests remain in place.
  • Review: all 35 review threads are resolved. Static inspection found no stale removed-schema imports, unguarded URL.parse/URL.canParse calls, or conflict markers across the changed files.
  • Execution gate: no local typecheck, Vitest, lint/format, build, browser E2E or native file-drag checks were executed. The fork validation PR has no executable CI results. Those checks still require an approved runner or local execution before declaring runtime readiness.

The PR description contains the upstream rationale and full reconciliation record.

xmarre commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne The November 12 upstream reconciliation for #10841 is published and ready for re-review.

Runtime validation is still outstanding. The isolated fork PR has no CI results. Fourteen upstream Actions workflows on this head stopped at action_required before jobs ran (CLA passed). No typecheck, Vitest, lint, build, E2E or native OS file-drag pass is claimed. The PR description contains detailed scope, reasoning, and exact evidence.

The upstream PR has not been merged.

Retain the latest Vue preview metadata and worker display-copy contracts,
properties-panel ownership, Cloud skipped-output errors and lazy startup.
Preserve explicit drop ownership, item/URI media handling and paste routing.

xmarre commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

@christian-byrne November 13 upstream reconciliation of #10841 is published for re-review.

Execution is not yet validated: there are no fork CI jobs; 14 upstream Actions workflows stop at action_required before any jobs run (CLA Assistant passed). Typecheck, lint, Vitest, build, browser E2E, and native external-file drag still need execution. The PR description documents the research, reconciliation, evidence, and limitations.

The PR remains open for upstream review; it has not been merged.

This branch was previously deployed

1 inactive (outdated) deployment
website-approval — 27c72f7b Deployed Oct 14, 2026 by xmarre via fast-lane #2117
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.

3 participants