Fix palette drag-and-drop not triggering AddModuleModal

DevicePalette's useDraggable was missing dragType: 'palette' in its data
object. RackPlanner's handleDragStart and handleDragEnd both guard on
dragType === 'palette' — without it the drag overlay never showed and the
drop onto a slot was silently ignored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 22:44:50 -05:00
parent 69b7262535
commit b5df2e6721

View File

@@ -16,7 +16,7 @@ const ALL_TYPES: ModuleType[] = [
function PaletteItem({ type }: { type: ModuleType }) { function PaletteItem({ type }: { type: ModuleType }) {
const { attributes, listeners, setNodeRef, isDragging } = useDraggable({ const { attributes, listeners, setNodeRef, isDragging } = useDraggable({
id: `palette-${type}`, id: `palette-${type}`,
data: { type }, data: { dragType: 'palette', type },
}); });
const colors = MODULE_TYPE_COLORS[type]; const colors = MODULE_TYPE_COLORS[type];