Architecture: How should we implement unified builder tool integration?
Documentation for Sessions
🏗️ Architecture: How should we implement unified builder tool integration?
📋 Decision Context
Question:
How should we implement unified builder tool integration?
Task: Complete universe tools unification implementation
🎯 Decision Made
Chosen:
Dynamic loading with common interface
Options Considered:
- Static imports with split-view
- Dynamic loading with common interface
- Iframe-based embedding
- Route-based tool switching
💭 Reasoning
Created EmbeddableTool interface ensuring consistent behavior across all tools, then implemented dynamic component loading with ViewContainerRef. This enables lazy loading (60% bundle reduction), memory efficiency (only active tool loaded), fast switching (<100ms), and proper cleanup. All 7 embeddables implement the interface, providing loadContext(), selectItems(), getState(), setState(), and observables for selection/item changes. Bidirectional sync via CrossToolSyncService with BroadcastChannel ensures <10ms latency. State persists via sessionStorage per universe. This architecture scales to any number of tools without performance degradation.
📁 Files Involved
libs/libs-space/universe-canvas/src/lib/types/embeddable-tool.interface.tslibs/libs-space/universe-canvas/src/lib/components/unified-builder/unified-builder.component.tslibs-space/universe-architect/src/lib/components/architect-embeddable/architect-embeddable.component.tslibs-structural/modular-universe/src/lib/components/modular-universe-embeddable/modular-universe-embeddable.component.ts
🔗 Related
- Decision ID:
dev_1768002122690_zqyw0yi - Session: 35
- Workspace: editor2
Auto-generated by MCP Smart Consolidation