Architecture: How to implement cross-app drag-and-drop between separate NX...

Documentation for Sessions

🏗️ Architecture: How to implement cross-app drag-and-drop between separate NX...

Date: 2026-02-27
Time: 00:22:34 UTC
Session: gspace1-149.5
Agent: angular
Confidence: 85%
Status: ✅ Documented


📋 Decision Context

Question:

How to implement cross-app drag-and-drop between separate NX apps without relying on Chrome extension?

Task: Session 149: Phase 4 - Cross-app drag-and-drop


🎯 Decision Made

Chosen:

Created CrossAppDragService in embeddable-bridge using BroadcastChannel (same-origin) + WebSocket relay via command-center gateway (cross-origin). Enhanced existing EmbeddableDragSourceDirective with crossApp input. Added drag:event handler to command-center.gateway.ts that broadcasts to all clients except sender. Created CrossAppDragIndicatorComponent for visual feedback.

Options Considered:


💭 Reasoning

Cannot rely on Chrome extension for transport (user's constraint). BroadcastChannel handles same-origin tabs instantly. For cross-origin (different NX apps on different ports), the backend WebSocket (command-center gateway already connected by all apps) relays drag events. This reuses existing infrastructure — no new WebSocket connections needed. The existing EmbeddableDragSourceDirective was extended rather than replaced, maintaining backward compatibility.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation