DRAG DROP TESTING
Ecosistema completo para organización y gestión de contenido con interfaces espaciales
🧪 DRAG & DROP TESTING CHECKLIST
Date: November 10, 2025
Feature: Module Drag & Drop from Library to Canvas
✅ Code Verification - COMPLETE
Module Library Browser ✅
- ✅
draggable="true"on module type cards - ✅
onModuleTypeDragStart()sets drag data - ✅ JSON data includes
{ type: 'module-type', moduleType: string } - ✅ Both
application/jsonandtext/plaindata set - ✅ Console logging for debugging
Universal Canvas ✅
- ✅
onCanvasDragOver()prevents default & sets dropEffect - ✅
onCanvasDrop()reads JSON data and callscreateModuleAtPosition() - ✅
createModuleAtPosition()usesmoduleService.install() - ✅ Module position saved to storage
- ✅ Drag handlers on both container and canvas-content
Template Bindings ✅
- ✅
(dragover)="onCanvasDragOver($event)"on container - ✅
(drop)="onCanvasDrop($event)"on container - ✅
(dragleave)="onCanvasDragLeave($event)"on container - ✅ Same handlers duplicated on
.canvas-content
🧪 Manual Testing Steps
Test 1: Basic Drag & Drop
- ✅ Open universe:
http://localhost:4200/space/{space-slug}/universe-map - ⏳ Verify module library sidebar is visible on the left
- ⏳ Drag a "Galaxy" module type card
- ⏳ Drop it onto the canvas
- ⏳ Expected: New galaxy module appears at drop position
- ⏳ Check console for logs:
📦 Setting drag data,🎯 Canvas Drop Event,✅ Module created
Test 2: Multiple Module Types
- ⏳ Drag "World" module → drop on canvas
- ⏳ Drag "Widget" module → drop on canvas
- ⏳ Drag "Navigation" module → drop on canvas
- ⏳ Expected: All modules created and visible
Test 3: Module Positioning
- ⏳ Drop module at different canvas positions
- ⏳ Expected: Module appears where dropped (accounting for card centering)
- ⏳ Refresh page
- ⏳ Expected: Module positions persist (flash storage)
Test 4: Visual Feedback
- ⏳ Drag module over canvas
- ⏳ Expected: Canvas highlights (
.drag-overclass adds purple border) - ⏳ Drop module
- ⏳ Expected: Highlight disappears, module appears
Test 5: Move Mode
- ⏳ Toggle "Move Mode" OFF (default)
- ⏳ Try to drag existing module card
- ⏳ Expected: Module doesn't move (move mode disabled)
- ⏳ Toggle "Move Mode" ON
- ⏳ Drag existing module card
- ⏳ Expected: Module moves smoothly
Test 6: Layout Zones (if layout module exists)
- ⏳ Create a "Layout" module first
- ⏳ Expected: Canvas switches to zone mode (zones visible)
- ⏳ Drag module over a zone
- ⏳ Expected: Zone highlights purple
- ⏳ Drop module in zone
- ⏳ Expected: Module created with
config.layoutZoneset
🐛 Known Issues to Check
Issue 1: No Universe Context
- Symptom: Console shows "Cannot create module: no universe ID"
- Fix: Ensure you're in a valid universe route
- URL Format:
/space/{space-slug}/universe-map
Issue 2: CORS / Backend Connection
- Symptom: Module creation fails with network error
- Fix: Verify backend is running on correct port
- Check: Backend API should be accessible at configured URL
Issue 3: Module Service Not Found
- Symptom: TypeScript error or null reference
- Fix: Verify
UniversalModuleServiceis properly injected - Check: Service should be provided in root or component
Issue 4: Drag Data Not Set
- Symptom: Drop event has no data
- Fix: Check browser console for "Setting drag data" log
- Check: Ensure
dataTransferobject exists
Issue 5: Canvas Not Receiving Drops
- Symptom: Drop event never fires
- Fix: Ensure
dragoverprevents default - Check:
event.preventDefault()inonCanvasDragOver()
📊 Console Log Markers
Look for these console logs during testing:
Drag Start (Module Library):
📦 Setting drag data: { type: 'module-type', moduleType: 'galaxy' }
📄 JSON string: {"type":"module-type","moduleType":"galaxy"}
✅ Drag data set successfully!
Drag Over (Canvas):
📦 Drag over canvas: { types: [...], clientX: X, clientY: Y }
Drop (Canvas):
🎯 Canvas Drop Event: DragEvent { ... }
📦 DataTransfer types: ['application/json', 'text/plain']
📄 JSON Data: {"type":"module-type","moduleType":"galaxy"}
📍 Creating module at position: { x: 123, y: 456 }
Module Creation:
✅ Module created: { id: 'mod_...', name: 'galaxy-1234567890', type: 'galaxy' }
📍 Module positioned at: { x: 123, y: 456, isManuallyPositioned: true }
🚨 If Drag & Drop Still Not Working
Debugging Steps:
Open Browser DevTools (F12)
Go to Console tab
Try dragging a module
Check for:
- ✅ "Setting drag data" log (library component)
- ✅ "Drag over canvas" log (canvas component)
- ✅ "Canvas Drop Event" log (drop handler)
- ❌ Any error messages
If no logs appear:
- Check if module library is rendering
- Check if canvas is rendering
- Inspect DOM to verify event handlers are bound
If logs appear but module doesn't create:
- Check "Cannot create module" warnings
- Verify
universeIdis set - Check backend API response
- Verify module service is working
🎯 Success Criteria
✅ Drag & drop is working when:
- Module card follows cursor during drag
- Canvas highlights when dragging over it
- Module appears on canvas at drop position
- Console shows all expected logs
- New module visible in DOM
- Page refresh preserves module position
🔧 Quick Fixes
If nothing works:
# Clear browser cache (Hard Refresh)
Ctrl + Shift + R (or Cmd + Shift + R on Mac)
# Clear NX cache
nx reset
# Restart dev server
# Kill process (Ctrl+C) then:
nx serve gograb-space
If module library not visible:
- Check
universe-management.component.html - Verify
lib-module-library-browseris in template - Check CSS for
display: noneorvisibility: hidden
If canvas not accepting drops:
- Verify
.universal-canvas-containerhas drag handlers - Check if parent element is blocking events
- Ensure
z-indexis correct
📝 Test Results (Fill in during testing)
| Test | Status | Notes |
|---|---|---|
| Basic Drag & Drop | ⏳ | |
| Multiple Module Types | ⏳ | |
| Module Positioning | ⏳ | |
| Visual Feedback | ⏳ | |
| Move Mode | ⏳ | |
| Layout Zones | ⏳ |
Ready to test! Open the app and start dragging modules! 🚀