Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

feat(webv2): drag-in-flight affordances for image/video drop targets

Lincoln Steincbd948325b95
diff --git a/invokeai/frontend/webv2/performance/architecture-baseline.json b/invokeai/frontend/webv2/performance/architecture-baseline.json
index cde0ac43c4..0db6dfb20e 100644
--- a/invokeai/frontend/webv2/performance/architecture-baseline.json
+++ b/invokeai/frontend/webv2/performance/architecture-baseline.json
@@ -2,15 +2,15 @@
"build": {
"launchpad": {
"baseline": {
- "brotliBytes": 837352,
+ "brotliBytes": 837484,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 836249,
+ "gzipBytes": 836432,
"imageRawBytes": 156376,
- "initialRawBytes": 1946177,
+ "initialRawBytes": 1946768,
"largestAssetRawBytes": 746569,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 69051,
+ "ownedRawBytes": 69114,
"requestCount": 41,
"scriptRequestCount": 25,
"sourceOwners": [
@@ -198,6 +198,7 @@
"source:src/platform/ui/ColorPicker.tsx",
"source:src/platform/ui/Combobox.tsx",
"source:src/platform/ui/ConfirmDialog.tsx",
+ "source:src/platform/ui/DropTargetOverlay.tsx",
"source:src/platform/ui/DropZone.tsx",
"source:src/platform/ui/EmptyState.tsx",
"source:src/platform/ui/Field.tsx",
@@ -286,15 +287,15 @@
]
},
"limits": {
- "brotliBytes": 845726,
+ "brotliBytes": 845859,
"cssRawBytes": 2181,
"fontRawBytes": 221675,
- "gzipBytes": 844612,
+ "gzipBytes": 844797,
"imageRawBytes": 157940,
- "initialRawBytes": 1965639,
+ "initialRawBytes": 1966236,
"largestAssetRawBytes": 754035,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 69051,
+ "ownedRawBytes": 69114,
"requestCount": 41,
"scriptRequestCount": 25
},
@@ -304,17 +305,17 @@
},
"editor": {
"baseline": {
- "brotliBytes": 1047800,
+ "brotliBytes": 1049969,
"cssRawBytes": 2159,
"fontRawBytes": 219480,
- "gzipBytes": 1043595,
+ "gzipBytes": 1045557,
"imageRawBytes": 156376,
- "initialRawBytes": 2578275,
+ "initialRawBytes": 2582613,
"largestAssetRawBytes": 746569,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 113745,
- "requestCount": 93,
- "scriptRequestCount": 77,
+ "ownedRawBytes": 113836,
+ "requestCount": 95,
+ "scriptRequestCount": 79,
"sourceOwners": [
"package:@ark-ui/react",
"package:@chakra-ui/react",
@@ -454,8 +455,11 @@
"source:src/features/gallery/data/videoUrls.ts",
"source:src/features/gallery/queries.ts",
"source:src/features/gallery/react.ts",
+ "source:src/features/gallery/ui/GalleryDragCursor.tsx",
"source:src/features/gallery/ui/GalleryUiContext.tsx",
+ "source:src/features/gallery/ui/galleryDnd.ts",
"source:src/features/gallery/ui/galleryStateView.ts",
+ "source:src/features/gallery/utility.ts",
"source:src/features/generation/core/baseGenerationPolicies.ts",
"source:src/features/generation/core/batch.ts",
"source:src/features/generation/core/canvas/addControlLayers.ts",
@@ -645,6 +649,7 @@
"source:src/platform/ui/ColorPicker.tsx",
"source:src/platform/ui/Combobox.tsx",
"source:src/platform/ui/ConfirmDialog.tsx",
+ "source:src/platform/ui/DropTargetOverlay.tsx",
"source:src/platform/ui/DropZone.tsx",
"source:src/platform/ui/Field.tsx",
"source:src/platform/ui/Group.tsx",
@@ -860,17 +865,17 @@
]
},
"limits": {
- "brotliBytes": 1058278,
+ "brotliBytes": 1060469,
"cssRawBytes": 2181,
"fontRawBytes": 221675,
- "gzipBytes": 1054031,
+ "gzipBytes": 1056013,
"imageRawBytes": 157940,
- "initialRawBytes": 2604058,
+ "initialRawBytes": 2608440,
"largestAssetRawBytes": 754035,
"otherAssetRawBytes": 0,
- "ownedRawBytes": 113745,
- "requestCount": 93,
- "scriptRequestCount": 77
+ "ownedRawBytes": 113836,
+ "requestCount": 95,
+ "scriptRequestCount": 79
},
"owner": "workbench",
"remediationTicket": "deepen-widget-registry-loading",
diff --git a/invokeai/frontend/webv2/performance/browser-baseline.json b/invokeai/frontend/webv2/performance/browser-baseline.json
index 31b6c274b1..666708a691 100644
--- a/invokeai/frontend/webv2/performance/browser-baseline.json
+++ b/invokeai/frontend/webv2/performance/browser-baseline.json
@@ -1,6 +1,6 @@
{
"browserExecutable": "/home/lstein/.cache/ms-playwright/chromium-1234/chrome-linux64/chrome",
- "capturedAt": "2026-08-21",
+ "capturedAt": "2026-08-22",
"routes": [
{
"activatedResourceBaseline": {
@@ -25,12 +25,12 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 142.09999990463257,
+ "domContentLoadedMedianMs": 138.40000009536743,
"id": "launchpad",
"layoutAckMedianMs": 0,
"layoutReturnSwitchMedianMs": 0,
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 142.30000019073486,
+ "loadMedianMs": 138.59999990463257,
"longestTaskMaxMs": 75,
"owner": "app",
"projectSwitchMedianMs": 0,
@@ -41,24 +41,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 0,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 37,
- "scriptRawBytes": 1620612,
+ "scriptRawBytes": 1621546,
"scriptRequestCount": 33,
- "totalRawBytes": 1792213
+ "totalRawBytes": 1794089
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 0,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 37,
- "scriptRawBytes": 1636819,
+ "scriptRawBytes": 1637762,
"scriptRequestCount": 33,
- "totalRawBytes": 1810136
+ "totalRawBytes": 1812030
},
- "routeReadyMedianMs": 322.80000019073486,
+ "routeReadyMedianMs": 295.2000002861023,
"scriptSourceOwnerSet": "launchpad-static",
"stateProfile": "empty"
},
@@ -85,13 +85,13 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 170.40000009536743,
+ "domContentLoadedMedianMs": 140.09999990463257,
"id": "launchpad",
"layoutAckMedianMs": 0,
"layoutReturnSwitchMedianMs": 0,
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 170.59999990463257,
- "longestTaskMaxMs": 73,
+ "loadMedianMs": 140.19999980926514,
+ "longestTaskMaxMs": 74,
"owner": "app",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:launchpad",
@@ -101,24 +101,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 0,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 37,
- "scriptRawBytes": 1620612,
+ "scriptRawBytes": 1621546,
"scriptRequestCount": 33,
- "totalRawBytes": 1792213
+ "totalRawBytes": 1794089
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 0,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 37,
- "scriptRawBytes": 1636819,
+ "scriptRawBytes": 1637762,
"scriptRequestCount": 33,
- "totalRawBytes": 1810136
+ "totalRawBytes": 1812030
},
- "routeReadyMedianMs": 345.5,
+ "routeReadyMedianMs": 323.8999996185303,
"scriptSourceOwnerSet": "launchpad-static",
"stateProfile": "representative"
},
@@ -151,9 +151,9 @@
"layoutReturnSwitchMedianMs": 0,
"layoutSwitchMedianMs": 0,
"loadMedianMs": 139.69999980926514,
- "longestTaskMaxMs": 106,
+ "longestTaskMaxMs": 104,
"owner": "workbench",
- "projectSwitchMedianMs": 44.90000009536743,
+ "projectSwitchMedianMs": 45.09999990463257,
"readyMark": "invokeai:ready:widget:center:preview",
"remediationTicket": "deepen-widget-registry-loading",
"resourceBaseline": {
@@ -161,24 +161,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 114,
- "scriptRawBytes": 3129527,
+ "scriptRawBytes": 3135376,
"scriptRequestCount": 109,
- "totalRawBytes": 3457504
+ "totalRawBytes": 3464295
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 114,
- "scriptRawBytes": 3160823,
+ "scriptRawBytes": 3166730,
"scriptRequestCount": 109,
- "totalRawBytes": 3492080
+ "totalRawBytes": 3498938
},
- "routeReadyMedianMs": 717,
+ "routeReadyMedianMs": 726.5,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "empty"
},
@@ -205,15 +205,15 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 143,
+ "domContentLoadedMedianMs": 133,
"id": "editor-minimal",
"layoutAckMedianMs": 0,
"layoutReturnSwitchMedianMs": 0,
"layoutSwitchMedianMs": 0,
- "loadMedianMs": 143.09999990463257,
+ "loadMedianMs": 133.09999990463257,
"longestTaskMaxMs": 186,
"owner": "workbench",
- "projectSwitchMedianMs": 61.59999990463257,
+ "projectSwitchMedianMs": 57.40000009536743,
"readyMark": "invokeai:ready:widget:center:preview",
"remediationTicket": "deepen-widget-registry-loading",
"resourceBaseline": {
@@ -221,24 +221,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 114,
- "scriptRawBytes": 3129527,
+ "scriptRawBytes": 3135376,
"scriptRequestCount": 109,
- "totalRawBytes": 3457504
+ "totalRawBytes": 3464295
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 114,
- "scriptRawBytes": 3160823,
+ "scriptRawBytes": 3166730,
"scriptRequestCount": 109,
- "totalRawBytes": 3492080
+ "totalRawBytes": 3498938
},
- "routeReadyMedianMs": 515.5,
+ "routeReadyMedianMs": 511.80000019073486,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "representative"
},
@@ -250,9 +250,9 @@
"largestAssetRawBytes": 136446,
"otherRawBytes": 0,
"requestCount": 6,
- "scriptRawBytes": 288880,
+ "scriptRawBytes": 288879,
"scriptRequestCount": 6,
- "totalRawBytes": 288880
+ "totalRawBytes": 288879
},
"activatedResourceLimits": {
"cssRawBytes": 0,
@@ -261,17 +261,17 @@
"largestAssetRawBytes": 137811,
"otherRawBytes": 0,
"requestCount": 6,
- "scriptRawBytes": 291769,
+ "scriptRawBytes": 291768,
"scriptRequestCount": 6,
- "totalRawBytes": 291769
+ "totalRawBytes": 291768
},
- "domContentLoadedMedianMs": 143.59999990463257,
+ "domContentLoadedMedianMs": 140.19999980926514,
"id": "editor-canvas",
- "layoutAckMedianMs": 8.800000190734863,
- "layoutReturnSwitchMedianMs": 35,
- "layoutSwitchMedianMs": 79.09999990463257,
- "loadMedianMs": 143.69999980926514,
- "longestTaskMaxMs": 108,
+ "layoutAckMedianMs": 4,
+ "layoutReturnSwitchMedianMs": 38.299999713897705,
+ "layoutSwitchMedianMs": 76.69999980926514,
+ "loadMedianMs": 140.19999980926514,
+ "longestTaskMaxMs": 104,
"owner": "canvas",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:canvas",
@@ -281,24 +281,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 120,
- "scriptRawBytes": 3418407,
+ "scriptRawBytes": 3424255,
"scriptRequestCount": 115,
- "totalRawBytes": 3746384
+ "totalRawBytes": 3753174
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 120,
- "scriptRawBytes": 3452592,
+ "scriptRawBytes": 3458498,
"scriptRequestCount": 115,
- "totalRawBytes": 3783848
+ "totalRawBytes": 3790706
},
- "routeReadyMedianMs": 1161.9000000953674,
+ "routeReadyMedianMs": 1143.2999997138977,
"scriptSourceOwnerSet": "editor-canvas-static",
"stateProfile": "empty"
},
@@ -310,9 +310,9 @@
"largestAssetRawBytes": 136446,
"otherRawBytes": 0,
"requestCount": 6,
- "scriptRawBytes": 288880,
+ "scriptRawBytes": 288879,
"scriptRequestCount": 6,
- "totalRawBytes": 288880
+ "totalRawBytes": 288879
},
"activatedResourceLimits": {
"cssRawBytes": 0,
@@ -321,17 +321,17 @@
"largestAssetRawBytes": 137811,
"otherRawBytes": 0,
"requestCount": 6,
- "scriptRawBytes": 291769,
+ "scriptRawBytes": 291768,
"scriptRequestCount": 6,
- "totalRawBytes": 291769
+ "totalRawBytes": 291768
},
- "domContentLoadedMedianMs": 137.69999980926514,
+ "domContentLoadedMedianMs": 158.40000009536743,
"id": "editor-canvas",
- "layoutAckMedianMs": 3.4000000953674316,
- "layoutReturnSwitchMedianMs": 32.69999980926514,
- "layoutSwitchMedianMs": 193.19999980926514,
- "loadMedianMs": 137.90000009536743,
- "longestTaskMaxMs": 379,
+ "layoutAckMedianMs": 3.200000286102295,
+ "layoutReturnSwitchMedianMs": 33.89999961853027,
+ "layoutSwitchMedianMs": 193,
+ "loadMedianMs": 158.59999990463257,
+ "longestTaskMaxMs": 380,
"owner": "canvas",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:canvas",
@@ -341,24 +341,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 120,
- "scriptRawBytes": 3418407,
+ "scriptRawBytes": 3424255,
"scriptRequestCount": 115,
- "totalRawBytes": 3746384
+ "totalRawBytes": 3753174
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 120,
- "scriptRawBytes": 3452592,
+ "scriptRawBytes": 3458498,
"scriptRequestCount": 115,
- "totalRawBytes": 3783848
+ "totalRawBytes": 3790706
},
- "routeReadyMedianMs": 1347.3000001907349,
+ "routeReadyMedianMs": 1317.8000001907349,
"scriptSourceOwnerSet": "editor-canvas-static",
"stateProfile": "representative"
},
@@ -370,9 +370,9 @@
"largestAssetRawBytes": 173980,
"otherRawBytes": 0,
"requestCount": 7,
- "scriptRawBytes": 360790,
+ "scriptRawBytes": 364198,
"scriptRequestCount": 6,
- "totalRawBytes": 376203
+ "totalRawBytes": 379611
},
"activatedResourceLimits": {
"cssRawBytes": 15568,
@@ -381,17 +381,17 @@
"largestAssetRawBytes": 175720,
"otherRawBytes": 0,
"requestCount": 7,
- "scriptRawBytes": 364398,
+ "scriptRawBytes": 367840,
"scriptRequestCount": 6,
- "totalRawBytes": 379966
+ "totalRawBytes": 383408
},
- "domContentLoadedMedianMs": 135.7999997138977,
+ "domContentLoadedMedianMs": 141,
"id": "editor-workflow",
- "layoutAckMedianMs": 10,
- "layoutReturnSwitchMedianMs": 29.799999713897705,
- "layoutSwitchMedianMs": 101,
- "loadMedianMs": 136,
- "longestTaskMaxMs": 126,
+ "layoutAckMedianMs": 6.099999904632568,
+ "layoutReturnSwitchMedianMs": 31.300000190734863,
+ "layoutSwitchMedianMs": 106.60000038146973,
+ "loadMedianMs": 141.2000002861023,
+ "longestTaskMaxMs": 104,
"owner": "workflow",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:workflow",
@@ -401,24 +401,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 121,
- "scriptRawBytes": 3490317,
+ "scriptRawBytes": 3499574,
"scriptRequestCount": 115,
- "totalRawBytes": 3833707
+ "totalRawBytes": 3843906
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 121,
- "scriptRawBytes": 3525221,
+ "scriptRawBytes": 3534570,
"scriptRequestCount": 115,
- "totalRawBytes": 3872045
+ "totalRawBytes": 3882346
},
- "routeReadyMedianMs": 1202.5,
+ "routeReadyMedianMs": 1171.2000002861023,
"scriptSourceOwnerSet": "editor-workflow-static",
"stateProfile": "empty"
},
@@ -430,9 +430,9 @@
"largestAssetRawBytes": 173980,
"otherRawBytes": 0,
"requestCount": 7,
- "scriptRawBytes": 360790,
+ "scriptRawBytes": 364198,
"scriptRequestCount": 6,
- "totalRawBytes": 376203
+ "totalRawBytes": 379611
},
"activatedResourceLimits": {
"cssRawBytes": 15568,
@@ -441,17 +441,17 @@
"largestAssetRawBytes": 175720,
"otherRawBytes": 0,
"requestCount": 7,
- "scriptRawBytes": 364398,
+ "scriptRawBytes": 367840,
"scriptRequestCount": 6,
- "totalRawBytes": 379966
+ "totalRawBytes": 383408
},
- "domContentLoadedMedianMs": 143.90000009536743,
+ "domContentLoadedMedianMs": 140,
"id": "editor-workflow",
- "layoutAckMedianMs": 2.9000000953674316,
- "layoutReturnSwitchMedianMs": 42.30000019073486,
- "layoutSwitchMedianMs": 140.09999990463257,
- "loadMedianMs": 144.10000038146973,
- "longestTaskMaxMs": 364,
+ "layoutAckMedianMs": 3.200000286102295,
+ "layoutReturnSwitchMedianMs": 35,
+ "layoutSwitchMedianMs": 139.5,
+ "loadMedianMs": 140.09999990463257,
+ "longestTaskMaxMs": 374,
"owner": "workflow",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:workflow",
@@ -461,24 +461,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 121,
- "scriptRawBytes": 3490317,
+ "scriptRawBytes": 3499574,
"scriptRequestCount": 115,
- "totalRawBytes": 3833707
+ "totalRawBytes": 3843906
},
"resourceLimits": {
"cssRawBytes": 17748,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 121,
- "scriptRawBytes": 3525221,
+ "scriptRawBytes": 3534570,
"scriptRequestCount": 115,
- "totalRawBytes": 3872045
+ "totalRawBytes": 3882346
},
- "routeReadyMedianMs": 1307.1000003814697,
+ "routeReadyMedianMs": 1278.8000001907349,
"scriptSourceOwnerSet": "editor-workflow-static",
"stateProfile": "representative"
},
@@ -505,13 +505,13 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 151.69999980926514,
+ "domContentLoadedMedianMs": 149.90000009536743,
"id": "editor-gallery",
"layoutAckMedianMs": 0,
"layoutReturnSwitchMedianMs": 0,
- "layoutSwitchMedianMs": 32.09999990463257,
- "loadMedianMs": 152,
- "longestTaskMaxMs": 103,
+ "layoutSwitchMedianMs": 28.199999809265137,
+ "loadMedianMs": 150.09999990463257,
+ "longestTaskMaxMs": 104,
"owner": "gallery",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:gallery",
@@ -521,24 +521,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 114,
- "scriptRawBytes": 3129527,
+ "scriptRawBytes": 3135376,
"scriptRequestCount": 109,
- "totalRawBytes": 3457504
+ "totalRawBytes": 3464295
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 114,
- "scriptRawBytes": 3160823,
+ "scriptRawBytes": 3166730,
"scriptRequestCount": 109,
- "totalRawBytes": 3492080
+ "totalRawBytes": 3498938
},
- "routeReadyMedianMs": 1403.1999998092651,
+ "routeReadyMedianMs": 1401.6999998092651,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "empty"
},
@@ -565,13 +565,13 @@
"scriptRequestCount": 0,
"totalRawBytes": 0
},
- "domContentLoadedMedianMs": 143.19999980926514,
+ "domContentLoadedMedianMs": 156.7000002861023,
"id": "editor-gallery",
"layoutAckMedianMs": 0,
"layoutReturnSwitchMedianMs": 0,
- "layoutSwitchMedianMs": 98,
- "loadMedianMs": 143.2999997138977,
- "longestTaskMaxMs": 200,
+ "layoutSwitchMedianMs": 96.2000002861023,
+ "loadMedianMs": 156.90000009536743,
+ "longestTaskMaxMs": 194,
"owner": "gallery",
"projectSwitchMedianMs": 0,
"readyMark": "invokeai:ready:widget:center:gallery",
@@ -581,24 +581,24 @@
"fontRawBytes": 23664,
"imageRawBytes": 156376,
"largestAssetRawBytes": 746569,
- "otherRawBytes": 145778,
+ "otherRawBytes": 146720,
"requestCount": 114,
- "scriptRawBytes": 3129527,
+ "scriptRawBytes": 3135376,
"scriptRequestCount": 109,
- "totalRawBytes": 3457504
+ "totalRawBytes": 3464295
},
"resourceLimits": {
"cssRawBytes": 2181,
"fontRawBytes": 23901,
"imageRawBytes": 157940,
"largestAssetRawBytes": 754035,
- "otherRawBytes": 147236,
+ "otherRawBytes": 148188,
"requestCount": 114,
- "scriptRawBytes": 3160823,
+ "scriptRawBytes": 3166730,
"scriptRequestCount": 109,
- "totalRawBytes": 3492080
+ "totalRawBytes": 3498938
},
- "routeReadyMedianMs": 1593.5999999046326,
+ "routeReadyMedianMs": 1536.3000001907349,
"scriptSourceOwnerSet": "editor-minimal-static",
"stateProfile": "representative"
}
@@ -828,6 +828,7 @@
"source:src/platform/ui/ColorPicker.tsx",
"source:src/platform/ui/Combobox.tsx",
"source:src/platform/ui/ConfirmDialog.tsx",
+ "source:src/platform/ui/DropTargetOverlay.tsx",
"source:src/platform/ui/DropZone.tsx",
"source:src/platform/ui/EmptyState.tsx",
"source:src/platform/ui/Field.tsx",
@@ -1075,6 +1076,7 @@
"source:src/features/gallery/ui/GalleryBoardRowShell.tsx",
"source:src/features/gallery/ui/GalleryBoardSection.tsx",
"source:src/features/gallery/ui/GalleryBoardsPanel.tsx",
+ "source:src/features/gallery/ui/GalleryDragCursor.tsx",
"source:src/features/gallery/ui/GalleryImageGrid.tsx",
"source:src/features/gallery/ui/GalleryItemSearch.tsx",
"source:src/features/gallery/ui/GalleryItemSortMenu.tsx",
@@ -1399,6 +1401,7 @@
"source:src/platform/ui/ColorPicker.tsx",
"source:src/platform/ui/Combobox.tsx",
"source:src/platform/ui/ConfirmDialog.tsx",
+ "source:src/platform/ui/DropTargetOverlay.tsx",
"source:src/platform/ui/DropZone.tsx",
"source:src/platform/ui/EmptyState.tsx",
"source:src/platform/ui/Field.tsx",
@@ -1994,6 +1997,7 @@
"source:src/features/gallery/ui/GalleryBoardRowShell.tsx",
"source:src/features/gallery/ui/GalleryBoardSection.tsx",
"source:src/features/gallery/ui/GalleryBoardsPanel.tsx",
+ "source:src/features/gallery/ui/GalleryDragCursor.tsx",
"source:src/features/gallery/ui/GalleryImageGrid.tsx",
"source:src/features/gallery/ui/GalleryItemSearch.tsx",
"source:src/features/gallery/ui/GalleryItemSortMenu.tsx",
@@ -2321,6 +2325,7 @@
"source:src/platform/ui/ColorPicker.tsx",
"source:src/platform/ui/Combobox.tsx",
"source:src/platform/ui/ConfirmDialog.tsx",
+ "source:src/platform/ui/DropTargetOverlay.tsx",
"source:src/platform/ui/DropZone.tsx",
"source:src/platform/ui/EmptyState.tsx",
"source:src/platform/ui/Field.tsx",
@@ -3025,6 +3030,7 @@
"source:src/features/gallery/ui/GalleryBoardRowShell.tsx",
"source:src/features/gallery/ui/GalleryBoardSection.tsx",
"source:src/features/gallery/ui/GalleryBoardsPanel.tsx",
+ "source:src/features/gallery/ui/GalleryDragCursor.tsx",
"source:src/features/gallery/ui/GalleryImageGrid.tsx",
"source:src/features/gallery/ui/GalleryItemSearch.tsx",
"source:src/features/gallery/ui/GalleryItemSortMenu.tsx",
@@ -3413,6 +3419,7 @@
"source:src/platform/ui/ColorPicker.tsx",
"source:src/platform/ui/Combobox.tsx",
"source:src/platform/ui/ConfirmDialog.tsx",
+ "source:src/platform/ui/DropTargetOverlay.tsx",
"source:src/platform/ui/DropZone.tsx",
"source:src/platform/ui/EmptyState.tsx",
"source:src/platform/ui/Field.tsx",
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.json
index 205f9dea8d..2312e2d0f5 100644
--- a/invokeai/frontend/webv2/public/locales/en.json
+++ b/invokeai/frontend/webv2/public/locales/en.json
@@ -1529,6 +1529,7 @@
"disableConcept": "Disable {{name}}",
"disableReferenceImage": "Disable reference image",
"dropImageToPrompt": "Describe this image",
+ "dropReferenceImages": "Drop Reference Images",
"dynamicPrompts": {
"title": "Dynamic Prompts",
"showPrompts": "Show dynamic prompts",
@@ -1826,6 +1827,7 @@
"creativity": "Creativity",
"creativityHelp": "Higher values invent more detail and increase prompt influence.",
"detailGuidance": "Detail guidance",
+ "dropImage": "Drop Image",
"enableNegativePrompt": "Enable negative prompt",
"generation": "Generation",
"inputSize": "Input",
@@ -2991,6 +2993,9 @@
"derivedSize": "Output size: {{width}} × {{height}}",
"derivedSizeUnavailable": "Output size unavailable for the current settings.",
"dimensions": "Dimensions",
+ "dropFirstFrame": "Drop First Frame",
+ "dropInitialVideo": "Drop Initial Video",
+ "dropLastFrame": "Drop Last Frame",
"fixedFps": "This model generates at a fixed {{fps}} FPS.",
"fps": "FPS",
"frames": "Frames",
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/GalleryDragCursor.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryDragCursor.tsx
new file mode 100644
index 0000000000..486111e3eb
--- /dev/null
+++ b/invokeai/frontend/webv2/src/features/gallery/ui/GalleryDragCursor.tsx
@@ -0,0 +1,28 @@
+import { useDndContext } from '@dnd-kit/core';
+import { useEffect } from 'react';
+
+import { isGalleryItemDragData } from './galleryDnd';
+
+/**
+ * Marks `<body data-gallery-drag>` while any gallery-item drag is in flight;
+ * the theme's global rule turns the whole app's cursor into the closed hand
+ * for the duration (a body-level cursor alone would lose to every element
+ * that sets its own — buttons, textareas — flickering arrow/I-beam back as
+ * the pointer crosses them mid-drag). Mount once inside the DndContext.
+ */
+export const GalleryDragCursor = () => {
+ const { active } = useDndContext();
+ const isGalleryDrag = isGalleryItemDragData(active?.data.current);
+
+ useEffect(() => {
+ if (!isGalleryDrag) {
+ return;
+ }
+
+ document.body.setAttribute('data-gallery-drag', '');
+
+ return () => document.body.removeAttribute('data-gallery-drag');
+ }, [isGalleryDrag]);
+
+ return null;
+};
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/dropAffordances.browser.test.tsx b/invokeai/frontend/webv2/src/features/gallery/ui/dropAffordances.browser.test.tsx
new file mode 100644
index 0000000000..cce1eb0867
--- /dev/null
+++ b/invokeai/frontend/webv2/src/features/gallery/ui/dropAffordances.browser.test.tsx
@@ -0,0 +1,223 @@
+import type { GalleryItemRef } from '@features/gallery/core/items';
+
+import { ChakraProvider } from '@chakra-ui/react';
+/* oxlint-disable react-perf/jsx-no-new-function-as-prop, react-perf/jsx-no-new-object-as-prop */
+import { DndContext, PointerSensor, useDraggable, useSensor, useSensors } from '@dnd-kit/core';
+import { DropTargetOverlay } from '@platform/ui/DropTargetOverlay';
+import { system } from '@theme/system';
+import { widgetCollisionDetection } from '@workbench/widgetDnd';
+import { act } from 'react';
+import { createRoot, type Root } from 'react-dom/client';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+
+import {
+ getGalleryItemDragData,
+ getGalleryItemDragId,
+ isGalleryImageDragData,
+ isSingleGalleryImageDragData,
+ isSingleGalleryVideoDragData,
+ useGalleryItemDroppable,
+} from './galleryDnd';
+import { GalleryDragCursor } from './GalleryDragCursor';
+
+/**
+ * The drag-in-flight affordances: while a compatible gallery drag is active
+ * ANYWHERE, a target advertises itself (overlay + label) and the body carries
+ * the closed-hand cursor flag; incompatible payloads (wrong kind, multi-item
+ * on a single-item target, non-gallery drags) advertise nothing.
+ */
+
+let host: HTMLDivElement | null = null;
+let root: Root | null = null;
+(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
+
+const interact = (action: () => void): Promise<void> =>
+ act(async () => {
+ action();
+ await new Promise<void>((resolve) => {
+ globalThis.setTimeout(resolve, 50);
+ });
+ });
+
+const THUMB_STYLE = {
+ background: '#888',
+ height: 40,
+ position: 'fixed',
+ touchAction: 'none',
+ width: 40,
+} as const;
+
+const DraggableThumb = ({ data, id, left, testId }: { data: unknown; id: string; left: number; testId: string }) => {
+ const { listeners, setNodeRef } = useDraggable({ data: data as never, id });
+
+ return <div ref={setNodeRef} {...listeners} data-testid={testId} style={{ ...THUMB_STYLE, left, top: 10 }} />;
+};
+
+const Target = ({
+ accepts,
+ id,
+ label,
+ left,
+ shields,
+}: {
+ accepts: (data: unknown) => boolean;
+ id: string;
+ label: string;
+ left: number;
+ shields?: (data: unknown) => boolean;
+}) => {
+ const { acceptsActiveDrag, isOver, setNodeRef } = useGalleryItemDroppable(accepts, { id }, shields ?? accepts);
+
+ return (
+ <div ref={setNodeRef} data-testid={id} style={{ height: 120, left, position: 'fixed', top: 200, width: 160 }}>
+ <DropTargetOverlay isActive={acceptsActiveDrag} isOver={isOver} label={label} />
+ </div>
+ );
+};
+
+const IMAGE_REF: GalleryItemRef = { kind: 'image', name: 'frame.png' };
+const VIDEO_REF: GalleryItemRef = { kind: 'video', name: 'clip.mp4' };
+
+const renderHarness = async () => {
+ const onDragEnd = vi.fn();
+ const Harness = () => {
+ const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 6 } }));
+
+ return (
+ <DndContext collisionDetection={widgetCollisionDetection} sensors={sensors} onDragEnd={onDragEnd}>
+ <GalleryDragCursor />
+ <DraggableThumb
+ data={getGalleryItemDragData([IMAGE_REF])}
+ id={getGalleryItemDragId(IMAGE_REF, 'preview-frame')}
+ left={10}
+ testId="image-thumb"
+ />
+ <DraggableThumb
+ data={getGalleryItemDragData([VIDEO_REF])}
+ id={getGalleryItemDragId(VIDEO_REF, 'preview-frame')}
+ left={60}
+ testId="video-thumb"
+ />
+ <DraggableThumb
+ data={getGalleryItemDragData([IMAGE_REF, { kind: 'image', name: 'second.png' }])}
+ id="multi-image-drag"
+ left={110}
+ testId="multi-thumb"
+ />
+ <DraggableThumb data={{ kind: 'widget-instance' }} id="widget-drag" left={160} testId="widget-thumb" />
+ <Target
+ accepts={isSingleGalleryImageDragData}
+ id="frame-target"
+ label="Drop First Frame"
+ left={200}
+ shields={isGalleryImageDragData}
+ />
+ <Target accepts={isSingleGalleryVideoDragData} id="clip-target" label="Drop Initial Video" left={400} />
+ </DndContext>
+ );
+ };
+
+ host = document.createElement('div');
+ document.body.append(host);
+ root = createRoot(host);
+ await interact(() => {
+ root?.render(
+ <ChakraProvider value={system}>
+ <Harness />
+ </ChakraProvider>
+ );
+ });
+
+ return { onDragEnd };
+};
+
+afterEach(async () => {
+ await interact(() => root?.unmount());
+ host?.remove();
+ host = null;
+ root = null;
+});
+
+const pointer = (type: string, target: EventTarget, clientX: number, clientY: number): void => {
+ target.dispatchEvent(
+ new PointerEvent(type, { bubbles: true, button: 0, clientX, clientY, isPrimary: true, pointerId: 1 })
+ );
+};
+
+const dragFrom = async (testId: string): Promise<HTMLElement> => {
+ const thumb = document.querySelector<HTMLElement>(`[data-testid="${testId}"]`)!;
+ const rect = thumb.getBoundingClientRect();
+
+ await interact(() => pointer('pointerdown', thumb, rect.left + 20, rect.top + 20));
+ await interact(() => pointer('pointermove', thumb.ownerDocument, rect.left + 50, rect.top + 50));
+
+ return thumb;
+};
+
+const release = async (thumb: HTMLElement, clientX: number, clientY: number): Promise<void> => {
+ await interact(() => pointer('pointermove', thumb.ownerDocument, clientX, clientY));
+ await interact(() => pointer('pointerup', thumb.ownerDocument, clientX, clientY));
+};
+
+describe('drag-in-flight drop affordances', () => {
+ it('advertises only the kind-matched target during a drag, and flags the body cursor', async () => {
+ await renderHarness();
+
+ expect(document.body.textContent).not.toContain('Drop First Frame');
+ expect(document.body.hasAttribute('data-gallery-drag')).toBe(false);
+
+ // A single-image drag: the frame target advertises, the clip target does not.
+ const imageThumb = await dragFrom('image-thumb');
+
+ expect(document.body.textContent).toContain('Drop First Frame');
+ expect(document.body.textContent).not.toContain('Drop Initial Video');
+ expect(document.body.hasAttribute('data-gallery-drag')).toBe(true);
+
+ await release(imageThumb, 120, 400);
+
+ expect(document.body.textContent).not.toContain('Drop First Frame');
+ expect(document.body.hasAttribute('data-gallery-drag')).toBe(false);
+
+ // A single-video drag: the reverse.
+ const videoThumb = await dragFrom('video-thumb');
+
+ expect(document.body.textContent).toContain('Drop Initial Video');
+ expect(document.body.textContent).not.toContain('Drop First Frame');
+ expect(document.body.hasAttribute('data-gallery-drag')).toBe(true);
+
+ await release(videoThumb, 120, 400);
+
+ expect(document.body.hasAttribute('data-gallery-drag')).toBe(false);
+ });
+
+ it('offers a single-item target nothing for a multi-item drag, but still shields the release', async () => {
+ const { onDragEnd } = await renderHarness();
+
+ const multiThumb = await dragFrom('multi-thumb');
+
+ expect(document.body.textContent).not.toContain('Drop First Frame');
+ expect(document.body.textContent).not.toContain('Drop Initial Video');
+ // Still a gallery drag: the cursor flag applies even with no eligible target.
+ expect(document.body.hasAttribute('data-gallery-drag')).toBe(true);
+
+ // Released over the frame target: the droppable stays armed (a dead drop,
+ // matching pre-affordance behavior) rather than disappearing from the
+ // collision candidates and handing the release to whatever is underneath.
+ await release(multiThumb, 280, 260);
+
+ expect(onDragEnd).toHaveBeenCalled();
+ expect(onDragEnd.mock.calls.at(-1)?.[0]?.over?.id).toBe('frame-target');
+ });
+
+ it('ignores non-gallery drags entirely', async () => {
+ await renderHarness();
+
+ const widgetThumb = await dragFrom('widget-thumb');
+
+ expect(document.body.textContent).not.toContain('Drop First Frame');
+ expect(document.body.textContent).not.toContain('Drop Initial Video');
+ expect(document.body.hasAttribute('data-gallery-drag')).toBe(false);
+
+ await release(widgetThumb, 120, 400);
+ });
+});
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/galleryDnd.ts b/invokeai/frontend/webv2/src/features/gallery/ui/galleryDnd.ts
index de131ab965..7471d9271a 100644
--- a/invokeai/frontend/webv2/src/features/gallery/ui/galleryDnd.ts
+++ b/invokeai/frontend/webv2/src/features/gallery/ui/galleryDnd.ts
@@ -85,14 +85,46 @@ export const isGalleryItemDragData = (value: unknown): value is GalleryItemDragD
export const isGalleryImageDragData = (value: unknown): value is GalleryImageDragData =>
isGalleryItemDragData(value) && value.items.every((item): item is GalleryImageDragItem => item.kind === 'image');
-export const useGalleryImageDroppable = ({ disabled = false, ...args }: UseDroppableArguments) => {
+/** For targets that consume exactly one image (keyframes, the upscale input). */
+export const isSingleGalleryImageDragData = (value: unknown): value is GalleryImageDragData =>
+ isGalleryImageDragData(value) && value.items.length === 1;
+
+/** For targets that consume exactly one video (the initial-video clip). */
+export const isSingleGalleryVideoDragData = (value: unknown): value is GalleryItemDragData =>
+ isGalleryItemDragData(value) && value.items.length === 1 && value.items[0]?.kind === 'video';
+
+/**
+ * A droppable that only participates while a drag matching `shields` is in
+ * flight. `acceptsActiveDrag` is the "potential target" bit the drop
+ * affordances render from (a drag the field's handler would consume exists
+ * ANYWHERE — legacy dnd's `potential` state); `isOver` narrows it to
+ * "hovering this target". `accepts` must match what the drop handler
+ * actually consumes, or the affordance advertises a drop that would no-op.
+ *
+ * `shields` (default: `accepts`) keeps the droppable armed for a WIDER
+ * payload family the handler merely ignores: a single-image field stays a
+ * dead drop for multi-image drags, exactly as before the affordances —
+ * disabling it instead would hand the release to whatever droppable sits
+ * underneath (the collision pipeline is z-blind), e.g. a board row hidden
+ * under a floated widget.
+ */
+export const useGalleryItemDroppable = (
+ accepts: (data: unknown) => boolean,
+ { disabled = false, ...args }: UseDroppableArguments,
+ shields: (data: unknown) => boolean = accepts
+) => {
const { active } = useDndContext();
- const acceptsActiveDrag = isGalleryImageDragData(active?.data.current);
- const droppable = useDroppable({ ...args, disabled: disabled || !acceptsActiveDrag });
+ const activeData = active?.data.current;
+ const acceptsActiveDrag = !disabled && accepts(activeData);
+ const isShielding = !disabled && shields(activeData);
+ const droppable = useDroppable({ ...args, disabled: !isShielding });
- return { ...droppable, isOver: acceptsActiveDrag && droppable.isOver };
+ return { ...droppable, acceptsActiveDrag, isOver: acceptsActiveDrag && droppable.isOver };
};
+export const useGalleryImageDroppable = (args: UseDroppableArguments) =>
+ useGalleryItemDroppable(isGalleryImageDragData, args);
+
export const isGalleryBoardDropData = (value: unknown): value is GalleryBoardDropData =>
isRecord(value) &&
value.kind === 'gallery-board' &&
diff --git a/invokeai/frontend/webv2/src/features/gallery/utility.ts b/invokeai/frontend/webv2/src/features/gallery/utility.ts
index 951a94ef24..d731d919c6 100644
--- a/invokeai/frontend/webv2/src/features/gallery/utility.ts
+++ b/invokeai/frontend/webv2/src/features/gallery/utility.ts
@@ -7,8 +7,11 @@ export {
isGalleryBoardDropData,
isGalleryImageDragData,
isGalleryItemDragData,
+ isSingleGalleryImageDragData,
+ isSingleGalleryVideoDragData,
resolveGalleryBoardDrop,
useGalleryImageDroppable,
+ useGalleryItemDroppable,
type GalleryBoardDropData,
type GalleryBoardDropResolution,
type GalleryImageDragData,
@@ -18,6 +21,8 @@ export {
type GalleryItemDragSource,
} from './ui/galleryDnd';
+export { GalleryDragCursor } from './ui/GalleryDragCursor';
+
import { getGalleryImageFullUrl, getGalleryImageThumbnailUrl } from './data/imageUrls';
import { getGalleryVideoFullUrl, getGalleryVideoThumbnailUrl } from './data/videoUrls';
diff --git a/invokeai/frontend/webv2/src/features/generation/ui/reference-images/GenerateReferenceImagesSection.tsx b/invokeai/frontend/webv2/src/features/generation/ui/reference-images/GenerateReferenceImagesSection.tsx
index f742d126d2..a6362aaaee 100644
--- a/invokeai/frontend/webv2/src/features/generation/ui/reference-images/GenerateReferenceImagesSection.tsx
+++ b/invokeai/frontend/webv2/src/features/generation/ui/reference-images/GenerateReferenceImagesSection.tsx
@@ -28,7 +28,7 @@ import {
captureAccountScope,
isAccountScopeCurrent,
} from '@platform/state/accountLifecycle';
-import { Button, DropZone } from '@platform/ui';
+import { Button, DropTargetOverlay, DropZone } from '@platform/ui';
import { UploadIcon } from 'lucide-react';
import { useCallback, useMemo, useRef } from 'react';
import { useTranslation } from 'react-i18next';
@@ -59,7 +59,7 @@ export const GenerateReferenceImagesSection = ({
const isSupported = isReferenceImageSupported(selectedModel);
const maxReferenceImages = getMaxReferenceImages(selectedModel);
const canAdd = referenceImages.length < maxReferenceImages;
- const { isOver, setNodeRef } = useGalleryImageDroppable({
+ const { acceptsActiveDrag, isOver, setNodeRef } = useGalleryImageDroppable({
data: { kind: 'generate-reference-images' },
disabled: !canAdd,
id: 'generate-reference-images',
@@ -263,7 +263,14 @@ export const GenerateReferenceImagesSection = ({
badges={badges}
sectionId="reference-images"
>
- <Stack ref={setNodeRef} gap="2" p="2">
+ <Stack ref={setNodeRef} gap="2" p="2" position="relative">
+ {/* The droppable is the whole section (drops land anywhere on it), so
+ the in-flight affordance covers the same rect. */}
+ <DropTargetOverlay
+ isActive={acceptsActiveDrag}
+ isOver={isOver}
+ label={t('widgets.generate.dropReferenceImages')}
+ />
<HStack align="stretch" gap="2">
<DropZone
as="button"
diff --git a/invokeai/frontend/webv2/src/features/upscale/ui/UpscaleImageField.tsx b/invokeai/frontend/webv2/src/features/upscale/ui/UpscaleImageField.tsx
index c674b376ff..ae23ab39d6 100644
--- a/invokeai/frontend/webv2/src/features/upscale/ui/UpscaleImageField.tsx
+++ b/invokeai/frontend/webv2/src/features/upscale/ui/UpscaleImageField.tsx
@@ -5,13 +5,19 @@ import type { ChangeEvent } from 'react';
import { Box, HStack, Image, Input, Spinner, Stack, Text } from '@chakra-ui/react';
import { useDndMonitor } from '@dnd-kit/core';
import { galleryImages, galleryTransfers } from '@features/gallery';
-import { galleryImageUrls, isGalleryImageDragData, useGalleryImageDroppable } from '@features/gallery/utility';
+import {
+ galleryImageUrls,
+ isGalleryImageDragData,
+ isSingleGalleryImageDragData,
+ useGalleryItemDroppable,
+} from '@features/gallery/utility';
import {
assertAccountScopeCurrent,
captureAccountScope,
isAccountScopeCurrent,
} from '@platform/state/accountLifecycle';
import { Button } from '@platform/ui/Button';
+import { DropTargetOverlay } from '@platform/ui/DropTargetOverlay';
import { DropZone } from '@platform/ui/DropZone';
import { MiddleTruncate } from '@platform/ui/MiddleTruncate';
import { ImagePlusIcon, UploadIcon, XIcon } from 'lucide-react';
@@ -60,11 +66,14 @@ export const UpscaleImageField = memo(
const fileInputRef = useRef<HTMLInputElement | null>(null);
const [isLoading, setIsLoading] = useState(false);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
- const { isOver, setNodeRef } = useGalleryImageDroppable({
- data: { kind: DROP_ID },
- disabled: isLoading,
- id: DROP_ID,
- });
+ // Advertise single-image drags only (the drop handler below consumes
+ // exactly one), but stay armed for ANY image drag: a multi-image release
+ // here must remain a dead drop, not fall through to a target underneath.
+ const { acceptsActiveDrag, isOver, setNodeRef } = useGalleryItemDroppable(
+ isSingleGalleryImageDragData,
+ { data: { kind: DROP_ID }, disabled: isLoading, id: DROP_ID },
+ isGalleryImageDragData
+ );
const setGalleryImage = useCallback(
async (imageName: string) => {
@@ -206,6 +215,7 @@ export const UpscaleImageField = memo(
</Text>
</Stack>
)}
+ <DropTargetOverlay isActive={acceptsActiveDrag} isOver={isOver} label={t('widgets.upscale.dropImage')} />
</DropZone>
<HStack justify="end">
{inputImage ? (
diff --git a/invokeai/frontend/webv2/src/features/video/ui/VideoFrameImageField.tsx b/invokeai/frontend/webv2/src/features/video/ui/VideoFrameImageField.tsx
index a4ec6faaf2..6754c29b71 100644
--- a/invokeai/frontend/webv2/src/features/video/ui/VideoFrameImageField.tsx
+++ b/invokeai/frontend/webv2/src/features/video/ui/VideoFrameImageField.tsx
@@ -5,13 +5,19 @@ import type { ChangeEvent } from 'react';
import { Box, HStack, Image, Input, Spinner, Stack, Text } from '@chakra-ui/react';
import { useDndMonitor } from '@dnd-kit/core';
import { galleryImages, galleryTransfers } from '@features/gallery';
-import { galleryImageUrls, isGalleryImageDragData, useGalleryImageDroppable } from '@features/gallery/utility';
+import {
+ galleryImageUrls,
+ isGalleryImageDragData,
+ isSingleGalleryImageDragData,
+ useGalleryItemDroppable,
+} from '@features/gallery/utility';
import {
assertAccountScopeCurrent,
captureAccountScope,
isAccountScopeCurrent,
} from '@platform/state/accountLifecycle';
import { Button } from '@platform/ui/Button';
+import { DropTargetOverlay } from '@platform/ui/DropTargetOverlay';
import { DropZone } from '@platform/ui/DropZone';
import { MiddleTruncate } from '@platform/ui/MiddleTruncate';
import { ImagePlusIcon, XIcon } from 'lucide-react';
@@ -46,6 +52,7 @@ export const VideoFrameImageField = memo(
disabled = false,
disabledReason,
dropId,
+ dropLabel,
image,
onChange,
}: {
@@ -54,6 +61,8 @@ export const VideoFrameImageField = memo(
disabledReason?: string;
/** Unique droppable id — the first- and last-frame fields render side by side. */
dropId: string;
+ /** Call-to-action shown while a compatible drag is in flight ("Drop First Frame"). */
+ dropLabel: string;
image: ImageWithDims | null;
onChange: (image: ImageWithDims | null) => void;
}) {
@@ -63,11 +72,14 @@ export const VideoFrameImageField = memo(
const [isLoading, setIsLoading] = useState(false);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
const isInert = disabled || isLoading;
- const { isOver, setNodeRef } = useGalleryImageDroppable({
- data: { kind: dropId },
- disabled: isInert,
- id: dropId,
- });
+ // Advertise single-image drags only (the drop handler below consumes
+ // exactly one), but stay armed for ANY image drag: a multi-image release
+ // here must remain a dead drop, not fall through to a target underneath.
+ const { acceptsActiveDrag, isOver, setNodeRef } = useGalleryItemDroppable(
+ isSingleGalleryImageDragData,
+ { data: { kind: dropId }, disabled: isInert, id: dropId },
+ isGalleryImageDragData
+ );
const setGalleryImage = useCallback(
async (imageName: string) => {
@@ -213,6 +225,7 @@ export const VideoFrameImageField = memo(
</Text>
</Stack>
)}
+ <DropTargetOverlay isActive={acceptsActiveDrag} isOver={isOver} label={dropLabel} />
</DropZone>
<HStack justify="space-between">
{disabled && disabledReason && image ? (
@@ -251,5 +264,6 @@ export const VideoFrameImageField = memo(
previous.disabled === next.disabled &&
previous.disabledReason === next.disabledReason &&
previous.dropId === next.dropId &&
+ previous.dropLabel === next.dropLabel &&
areFrameImagesEquivalent(previous.image, next.image)
);
diff --git a/invokeai/frontend/webv2/src/features/video/ui/VideoSourceClipField.tsx b/invokeai/frontend/webv2/src/features/video/ui/VideoSourceClipField.tsx
index 77635ac6c5..3fa8294261 100644
--- a/invokeai/frontend/webv2/src/features/video/ui/VideoSourceClipField.tsx
+++ b/invokeai/frontend/webv2/src/features/video/ui/VideoSourceClipField.tsx
@@ -14,6 +14,7 @@ import {
} from '@platform/state/accountLifecycle';
import { Field } from '@platform/ui';
import { Button } from '@platform/ui/Button';
+import { DropTargetOverlay } from '@platform/ui/DropTargetOverlay';
import { DropZone } from '@platform/ui/DropZone';
import { MiddleTruncate } from '@platform/ui/MiddleTruncate';
import { SliderNumberField } from '@platform/ui/SliderNumberField';
@@ -356,6 +357,7 @@ export const VideoSourceClipField = memo(
</Text>
</Stack>
)}
+ <DropTargetOverlay isActive={acceptsActiveDrag} isOver={isOver} label={t('widgets.video.dropInitialVideo')} />
</DropZone>
{sourceVideo && previewSrc ? (
<HStack gap="2">
diff --git a/invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsx b/invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsx
index 515b968e53..f961dce97c 100644
--- a/invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsx
+++ b/invokeai/frontend/webv2/src/features/video/ui/VideoWidgetView.tsx
@@ -351,6 +351,7 @@ export const VideoWidgetView = () => {
disabled={Boolean(values.sourceVideo)}
disabledReason={values.sourceVideo ? t('widgets.video.firstFrameBlocked') : undefined}
dropId="video-first-frame"
+ dropLabel={t('widgets.video.dropFirstFrame')}
image={values.firstFrameImage}
onChange={setFirstFrame}
/>
@@ -363,7 +364,12 @@ export const VideoWidgetView = () => {
}
label={t('widgets.video.lastFrame')}
>
- <VideoFrameImageField dropId="video-last-frame" image={values.lastFrameImage} onChange={setLastFrame} />
+ <VideoFrameImageField
+ dropId="video-last-frame"
+ dropLabel={t('widgets.video.dropLastFrame')}
+ image={values.lastFrameImage}
+ onChange={setLastFrame}
+ />
</Field>
) : null}
</Stack>
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/fields/WorkflowFieldInput.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/fields/WorkflowFieldInput.tsx
index 9f332006e2..c154fd0f3f 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/fields/WorkflowFieldInput.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/fields/WorkflowFieldInput.tsx
@@ -52,7 +52,7 @@ import {
Button,
ColorPicker,
Combobox,
- DropZone,
+ DropTargetOverlay,
formatHexColor,
IconButton,
parseHexColor,
@@ -670,22 +670,7 @@ const MediaInput = ({ id, invalid, kind, onChange, value }: WorkflowFieldInputPr
</Text>
</Flex>
)}
- {acceptsActiveDrag ? (
- <DropZone
- alignItems="center"
- display="flex"
- inset="0"
- isOver={isOver}
- justifyContent="center"
- pointerEvents="none"
- position="absolute"
- variant="overlay"
- >
- <Text fontSize="xs" fontWeight="700">
- {`Drop ${config.noun}`}
- </Text>
- </DropZone>
- ) : null}
+ <DropTargetOverlay isActive={acceptsActiveDrag} isOver={isOver} label={`Drop ${config.noun}`} />
</Box>
<HStack gap="1.5" mt="1" w="full">
<Button
diff --git a/invokeai/frontend/webv2/src/platform/ui/DropTargetOverlay.tsx b/invokeai/frontend/webv2/src/platform/ui/DropTargetOverlay.tsx
new file mode 100644
index 0000000000..eb4932bdab
--- /dev/null
+++ b/invokeai/frontend/webv2/src/platform/ui/DropTargetOverlay.tsx
@@ -0,0 +1,46 @@
+import { Text } from '@chakra-ui/react';
+
+import { DropZone } from './DropZone';
+
+/**
+ * The drag-in-flight affordance every image/video drop target shares: renders
+ * nothing until a compatible drag is active anywhere, then floats the
+ * `DropZone` overlay treatment (dashed border over a surface tint, flipping
+ * to accent while hovered) above the target's own content with a centered
+ * call-to-action — the "potential target" / "over" pair of states.
+ *
+ * `pointerEvents` stays off — dnd-kit hit-tests the droppable's rect, not
+ * this overlay — and the absolute inset needs `position: relative` (or any
+ * containing block) on the target element.
+ */
+export const DropTargetOverlay = ({
+ isActive,
+ isOver,
+ label,
+}: {
+ /** A compatible drag is in flight somewhere; the overlay exists only then. */
+ isActive: boolean;
+ /** That drag is hovering this target right now. */
+ isOver?: boolean;
+ /** Centered call-to-action; omit for targets too small to carry text. */
+ label?: string;
+}) =>
+ isActive ? (
+ <DropZone
+ alignItems="center"
+ display="flex"
+ inset="0"
+ isOver={isOver}
+ justifyContent="center"
+ pointerEvents="none"
+ position="absolute"
+ variant="overlay"
+ zIndex="2"
+ >
+ {label ? (
+ <Text color="fg" fontSize="sm" fontWeight="700" px="2" textAlign="center" textWrap="pretty">
+ {label}
+ </Text>
+ ) : null}
+ </DropZone>
+ ) : null;
diff --git a/invokeai/frontend/webv2/src/platform/ui/index.ts b/invokeai/frontend/webv2/src/platform/ui/index.ts
index 9e0888766d..5695c907f4 100644
--- a/invokeai/frontend/webv2/src/platform/ui/index.ts
+++ b/invokeai/frontend/webv2/src/platform/ui/index.ts
@@ -3,6 +3,7 @@ export * from './color';
export * from './ColorPicker';
export * from './Combobox';
export * from './ConfirmDialog';
+export * from './DropTargetOverlay';
export * from './DropZone';
export * from './Field';
export * from './Group';
diff --git a/invokeai/frontend/webv2/src/platform/ui/theme/system.ts b/invokeai/frontend/webv2/src/platform/ui/theme/system.ts
index 8a4b8fe58e..756f342c3c 100644
--- a/invokeai/frontend/webv2/src/platform/ui/theme/system.ts
+++ b/invokeai/frontend/webv2/src/platform/ui/theme/system.ts
@@ -242,6 +242,13 @@ const config = defineConfig({
minWidth: '960px',
overflow: 'hidden',
},
+ // While a gallery-item drag is in flight (body flag set by
+ // GalleryDragCursor) the closed-hand cursor applies everywhere: without
+ // the descendant rule, every element that sets its own cursor (buttons,
+ // textareas, grab handles) would flicker it back mid-drag.
+ 'body[data-gallery-drag], body[data-gallery-drag] *': {
+ cursor: 'grabbing !important',
+ },
':root': {
'--wb-motion-duration-fast': '0.12s',
'--wb-motion-duration-medium': '0.15s',
diff --git a/invokeai/frontend/webv2/src/workbench/shell/WorkbenchShell.tsx b/invokeai/frontend/webv2/src/workbench/shell/WorkbenchShell.tsx
index 6580a5bbc5..e80c6c619a 100644
--- a/invokeai/frontend/webv2/src/workbench/shell/WorkbenchShell.tsx
+++ b/invokeai/frontend/webv2/src/workbench/shell/WorkbenchShell.tsx
@@ -11,6 +11,7 @@ import {
} from '@dnd-kit/core';
import { restrictToWindowEdges } from '@dnd-kit/modifiers';
import { sortableKeyboardCoordinates } from '@dnd-kit/sortable';
+import { GalleryDragCursor } from '@features/gallery/utility';
import { useMountEffect } from '@platform/react/useMountEffect';
import { FocusRegionProvider } from '@workbench/focusRegions';
import { WidgetIcon } from '@workbench/iconResolver';
@@ -289,6 +290,7 @@ export const WorkbenchShell = () => {
<StatusBar dropState={bottomDropState} />
</Flex>
<FloatingWidgetLayer />
+ <GalleryDragCursor />
<DragOverlay>{activeDrag ? <WidgetDragPreview activeDrag={activeDrag} /> : null}</DragOverlay>
</DndContext>
</FocusRegionProvider>