Found during adversarial review of #140.
The regional-guidance layer's reference-image drop target (workbench/widgets/layers/RegionalGuidanceSettings.tsx, droppable ~line 508, monitor ~line 303) renders inside LayerPropertiesPopover, which sits inside the nested DndContext that LayerGroupSection creates for layer reordering. The Chakra Portal moves DOM but React context follows the React tree, so the field's useGalleryImageDroppable/useDndMonitor bind to the layer-reorder context — while gallery-item drags live in WorkbenchShell's outer context. Its active is therefore always null for gallery drags: the droppable is permanently disabled and the monitor never sees a gallery drag-end.
Net effect: dragging a gallery image onto the regional-guidance reference thumbnail has never worked (the popover also closes on the outside pointerdown by default). Upload-via-click works fine.
Fix direction: bind the field to the outer context (e.g. hoist the droppable/monitor above the nested DndContext, or drop the nested context in favor of scoped ids on the shell context), keep the popover open during drags, then add the shared DropTargetOverlay affordance from #140 (it was deliberately left off this field there because it could never fire).
🤖 Generated with Claude Code
https://claude.ai/code/session_01LUjUcPHzQCoL7dqgsVzi63
Found during adversarial review of #140.
The regional-guidance layer's reference-image drop target (
workbench/widgets/layers/RegionalGuidanceSettings.tsx, droppable ~line 508, monitor ~line 303) renders insideLayerPropertiesPopover, which sits inside the nestedDndContextthatLayerGroupSectioncreates for layer reordering. The Chakra Portal moves DOM but React context follows the React tree, so the field'suseGalleryImageDroppable/useDndMonitorbind to the layer-reorder context — while gallery-item drags live inWorkbenchShell's outer context. Itsactiveis therefore always null for gallery drags: the droppable is permanently disabled and the monitor never sees a gallery drag-end.Net effect: dragging a gallery image onto the regional-guidance reference thumbnail has never worked (the popover also closes on the outside pointerdown by default). Upload-via-click works fine.
Fix direction: bind the field to the outer context (e.g. hoist the droppable/monitor above the nested
DndContext, or drop the nested context in favor of scoped ids on the shell context), keep the popover open during drags, then add the sharedDropTargetOverlayaffordance from #140 (it was deliberately left off this field there because it could never fire).🤖 Generated with Claude Code
https://claude.ai/code/session_01LUjUcPHzQCoL7dqgsVzi63