Unifying Universe Tools

Comprehensive plan to consolidate all universe-level tools into a single, beautiful unified builder experience while preserving independent tool access.

Unifying Universe Tools

Executive Summary

The editor2 platform contains a rich ecosystem of 15+ specialized tools for building digital universes. Currently, these tools exist as separate routes with varying levels of integration. This plan consolidates ALL universe-level tools into a single unified builder experience at /builder, making it the default landing route while preserving the ability to access each tool independently.

Current State Analysis

The Problem

When a user navigates to a universe, they land at:

/space/:spaceSlug/universe/:universeSlug/canvas

This immediately drops them into a single-purpose tool (Canvas Builder) without showing them the full capabilities available. Users must:

What We Have Today

Unified Builder (Partial Unification)

Location: libs/libs-space/universe-canvas/src/lib/components/unified-builder/

The current Unified Builder combines two tools in a split-view:

┌─────────────────────────────────────────────────────────────────┐
│                        UNIFIED BUILDER                          │
├───────────────────────────┬─────────────────────────────────────┤
│                           │                                     │
│    VIBE AI GENERATOR      │        CANVAS BUILDER               │
│    (Left Panel)           │        (Right Panel)                │
│                           │                                     │
│  ┌───────────────────┐    │  ┌───────────────────────────┐     │
│  │ Natural Language  │    │  │    Visual Preview         │     │
│  │ Input + Templates │    │  │    + Drag/Drop            │     │
│  └───────────────────┘    │  └───────────────────────────┘     │
│                           │                                     │
├───────────────────────────┼─────────────────────────────────────┤
│        Draggable Divider (resizable)                            │
└─────────────────────────────────────────────────────────────────┘

How It Works:

  1. Split-View Layout: Resizable panels with draggable divider
  2. Mode Presets:
    • ai-heavy (70-30) - Focus on AI generation
    • balanced (50-50) - Equal emphasis
    • canvas-heavy (30-70) - Focus on visual editing
  3. Module Handoff: AI generates → Canvas receives via ToolOrchestrationService
  4. State Persistence: Panel ratios and preferences saved per universe

Key Services:

Service Purpose
ToolOrchestrationService Coordinates tool navigation and module handoff
UnifiedBuilderStateService Persists UI state per universe
UniverseModuleService Manages module lifecycle

All Available Tools

libs-space Tools (Space/Universe Level)

Library Tool Route Purpose
universe-canvas Canvas Builder /canvas Visual drag-drop builder
universe-canvas Unified Builder /builder Split-view AI + Canvas
universe-canvas Universe Hub / Overview and quick actions
universe-architect Universe Architect /architect Node-based immersive builder
theme-designer Theme Designer Space-level Global theme configuration
data-browser Data Browser Space-level Data exploration tools
deployment-engine-lib Deployment Engine Various Deployment infrastructure

libs-structural Tools (Platform Building)

Library Tool Route Purpose
vibe-universe Vibe Generator /vibe AI-powered platform generation
universe-map Universe Map Space-level Module architecture view (NEW)
modular-universe Modular Universe Space-level Grid-based visual builder
modularity-lib Module Workbench Space-level Module creation step-by-step
page-builder Page Builder Space-level Visual page composition
singularity-lib Singularity Space-level Logic and flow builder
launch-station-lib Launch Station Space-level Deployment hub
deployment-system Deployment System Various Universe deployment
structure-management Structure Manager Service-level Hierarchy management

Target State: The Ultimate Unified Builder

Vision

One unified interface where users can:

Default Landing Route Change

Before:

/space/:spaceSlug/universe/:universeSlug → redirects to /canvas

After:

/space/:spaceSlug/universe/:universeSlug → redirects to /builder

New Unified Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│                           UNIFIED UNIVERSE BUILDER                          │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  [AI] [Canvas] [Architect] [Pages] [Logic] [Deploy] │ ⚙️ Settings   │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌─────────────────┐  ┌─────────────────────────────────────────────────┐  │
│  │                 │  │                                                 │  │
│  │   TOOL PANEL    │  │              MAIN WORKSPACE                     │  │
│  │   (Collapsible) │  │              (Active Tool)                      │  │
│  │                 │  │                                                 │  │
│  │  ┌───────────┐  │  │  ┌─────────────────────────────────────────┐   │  │
│  │  │ Tree View │  │  │  │                                         │   │  │
│  │  │ / Module  │  │  │  │   Canvas / Architect / Page Builder     │   │  │
│  │  │ Browser   │  │  │  │   (Swappable via tabs)                  │   │  │
│  │  └───────────┘  │  │  │                                         │   │  │
│  │                 │  │  └─────────────────────────────────────────┘   │  │
│  │  ┌───────────┐  │  │                                                 │  │
│  │  │Properties │  │  │  ┌─────────────────────────────────────────┐   │  │
│  │  │  Panel    │  │  │  │         SECONDARY WORKSPACE              │   │  │
│  │  └───────────┘  │  │  │    (Preview / Code / JSON / Tests)       │   │  │
│  │                 │  │  └─────────────────────────────────────────┘   │  │
│  └─────────────────┘  └─────────────────────────────────────────────────┘  │
│                                                                             │
├─────────────────────────────────────────────────────────────────────────────┤
│  [Status Bar: Universe Name | Module Count | Deploy Status | Last Saved]   │
└─────────────────────────────────────────────────────────────────────────────┘

Implementation Plan

Phase 1: Route Restructuring (Priority: Critical)

Objective: Make /builder the default landing route for universes.

Tasks:

  1. Update app.routes.ts to redirect empty universe path to /builder

    // apps/gograb-space/src/app/app.routes.ts
    {
      path: 'space/:spaceSlug/universe/:universeSlug',
      children: [
        { path: '', redirectTo: 'builder', pathMatch: 'full' }, // CHANGED from 'canvas'
        { path: 'builder', loadComponent: () => ... },
        { path: 'canvas', loadComponent: () => ... },  // Still accessible
        { path: 'architect', loadComponent: () => ... },
        { path: 'vibe', loadComponent: () => ... },
      ]
    }
    
  2. Update any hardcoded navigation that assumes /canvas default

  3. Add URL migration for bookmarked links

Files to Modify:

Phase 2: Tool Tab System (Priority: Critical)

Objective: Add tool switching tabs to unified builder header.

Tasks:

  1. Create UnifiedToolbarComponent with tool tabs

    interface ToolTab {
      id: ToolType;
      label: string;
      icon: string;
      shortcut?: string;
      badge?: string;  // For notifications
    }
    
    const TOOL_TABS: ToolTab[] = [
      { id: 'vibe-universe', label: 'AI', icon: 'fa-magic', shortcut: '⌘1' },
      { id: 'universe-canvas', label: 'Canvas', icon: 'fa-th-large', shortcut: '⌘2' },
      { id: 'universe-architect', label: 'Architect', icon: 'fa-project-diagram', shortcut: '⌘3' },
      { id: 'page-builder', label: 'Pages', icon: 'fa-file-alt', shortcut: '⌘4' },
      { id: 'singularity', label: 'Logic', icon: 'fa-code-branch', shortcut: '⌘5' },
      { id: 'deployment', label: 'Deploy', icon: 'fa-rocket', shortcut: '⌘6' },
    ];
    
  2. Implement tab switching with keyboard shortcuts

  3. Add tab badge system for notifications (e.g., "3 pending modules")

Files to Create:

Phase 3: Architect Integration (Priority: High)

Objective: Embed Universe Architect as a swappable workspace view.

Current Architect Features to Preserve:

Tasks:

  1. Create ArchitectEmbeddableComponent wrapper

    • Strip standalone routing shell
    • Accept universe context via inputs
    • Emit events for tool orchestration
  2. Add Architect as workspace option

    workspaceViews: WorkspaceView[] = [
      { id: 'canvas', component: UniverseCanvasBuilderComponent },
      { id: 'architect', component: ArchitectEmbeddableComponent },
      { id: 'pages', component: PageBuilderEmbeddableComponent },
    ];
    
  3. Sync selection state across Canvas ↔ Architect

    • Select module in Canvas → highlights node in Architect
    • Select node in Architect → highlights section in Canvas

Files to Modify:

Phase 4: Page Builder Integration (Priority: High)

Objective: Embed Page Builder for editing individual page content.

Integration Flow:

Universe Builder (hierarchy)
    │
    ├── Click "Edit Page" on page-module
    │         │
    │         ▼
    │   Page Builder opens in workspace
    │   (maintains universe context)
    │         │
    │         ▼
    │   Save → Updates universe structure
    │
    └── Return to hierarchy view

Tasks:

  1. Create PageBuilderEmbeddableComponent wrapper
  2. Add "Edit Page" action to module context menus
  3. Implement breadcrumb navigation (Universe → Galaxy → World → Page)
  4. Sync page changes back to universe structure

Files to Modify:

Phase 5: Logic Builder (Singularity) Integration (Priority: Medium)

Objective: Embed Singularity for action/flow editing.

Integration Flow:

Module Action List
    │
    ├── Click "Edit Flow" on action
    │         │
    │         ▼
    │   Singularity opens in workspace
    │   (shows action's flow diagram)
    │         │
    │         ▼
    │   Save → Updates action definition
    │
    └── Return to module view

Tasks:

  1. Create SingularityEmbeddableComponent wrapper
  2. Add "Edit Flow" action to action items
  3. Pass action context to Singularity
  4. Sync flow changes back to module

Files to Modify:

Phase 6: Deployment Integration (Priority: Medium)

Objective: Add deployment panel/modal within unified builder.

Tasks:

  1. Create DeploymentPanelComponent for sidebar
  2. Show deployment status in status bar
  3. Add quick deploy button to toolbar
  4. Integrate LaunchStationComponent as modal/panel

Files to Modify:

Phase 7: Universe Map Integration (Priority: Medium)

Objective: Add Universe Map as module browser/tree panel.

Tasks:

  1. Replace current tree view with ModuleTreeViewComponent from universe-map
  2. Add ModuleLibraryBrowserComponent as panel option
  3. Integrate ModuleCreationWizardComponent for adding modules

Files to Modify:

Phase 8: Modular Universe Grid Integration (Priority: Low)

Objective: Add grid-based layout as optional workspace view.

Tasks:

  1. Create ModularUniverseEmbeddableComponent wrapper
  2. Add "Grid View" option to workspace tabs
  3. Sync grid changes with canvas/architect

Files to Modify:

Phase 9: Enhanced Tool Orchestration (Priority: High)

Objective: Upgrade ToolOrchestrationService to handle all tools.

Current Tool Orchestration:

// libs/libs-structural/vibe-universe/src/lib/services/tool-orchestration.service.ts
export type ToolType =
  | 'vibe-universe'
  | 'modular-universe'
  | 'module-workbench'
  | 'page-builder'
  | 'widget-builder'
  | 'universe-canvas'
  | 'universe-architect';

Enhanced Orchestration:

  1. Add missing tool types:

    export type ToolType =
      | 'vibe-universe'        // AI Generator
      | 'universe-canvas'      // Canvas Builder
      | 'universe-architect'   // Node-based Builder
      | 'page-builder'         // Page Composer
      | 'singularity'          // Logic Builder
      | 'modular-universe'     // Grid Builder
      | 'module-workbench'     // Module Creator
      | 'widget-builder'       // Widget Creator
      | 'deployment'           // Deployment
      | 'theme-designer';      // Theme Configuration
    
  2. Add bi-directional sync events:

    interface SyncEvent {
      source: ToolType;
      target: ToolType | 'all';
      type: 'selection' | 'create' | 'update' | 'delete';
      payload: unknown;
    }
    
  3. Implement undo/redo across tools

  4. Add conflict resolution for concurrent edits

Files to Modify:

Phase 10: Unified State Management (Priority: High)

Objective: Single source of truth for all tools.

Tasks:

  1. Create UnifiedUniverseStateService:

    interface UnifiedUniverseState {
      universe: Universe;
      modules: Map<string, UniversalModule>;
      pages: Map<string, Page>;
      actions: Map<string, Action>;
      selectedIds: Set<string>;
      clipboard: ClipboardState;
      history: HistoryState;
    }
    
  2. Implement optimistic updates with rollback

  3. Add conflict detection and resolution

  4. Persist state with automatic recovery

Files to Create:

Phase 11: Visual Polish (Priority: Low)

Objective: Beautiful, cohesive visual design.

Tasks:

  1. Design unified color scheme for all tools
  2. Create consistent icon system
  3. Add smooth transitions between tools
  4. Implement dark/light mode across all embedded tools
  5. Add tool-specific color accents for visual distinction

Component Architecture

New Unified Builder Structure

unified-builder/
├── unified-builder.component.ts          # Main container
├── unified-builder.component.html
├── unified-builder.component.scss
├── unified-toolbar/
│   ├── unified-toolbar.component.ts      # Tool tabs + actions
│   └── tool-tab.component.ts             # Individual tab
├── unified-sidebar/
│   ├── unified-sidebar.component.ts      # Collapsible sidebar
│   ├── tree-panel/                       # Module tree
│   ├── properties-panel/                 # Property editor
│   └── library-panel/                    # Module library
├── unified-workspace/
│   ├── unified-workspace.component.ts    # Workspace container
│   ├── workspace-tabs.component.ts       # Secondary tabs
│   └── embeddables/
│       ├── canvas-embeddable.component.ts
│       ├── architect-embeddable.component.ts
│       ├── page-builder-embeddable.component.ts
│       ├── singularity-embeddable.component.ts
│       └── modular-universe-embeddable.component.ts
├── unified-status-bar/
│   └── unified-status-bar.component.ts   # Bottom status bar
└── services/
    ├── unified-builder-state.service.ts  # UI state
    ├── unified-universe-state.service.ts # Data state
    └── unified-keyboard.service.ts       # Keyboard shortcuts

Tool Embeddable Pattern

Each tool should expose an embeddable version:

// Example: ArchitectEmbeddableComponent
@Component({
  selector: 'lib-architect-embeddable',
  standalone: true,
  template: `
    <lib-architect-canvas
      [universeId]="universeId()"
      [spaceSlug]="spaceSlug()"
      [embedded]="true"
      (nodeSelected)="onNodeSelected($event)"
      (nodeCreated)="onNodeCreated($event)">
    </lib-architect-canvas>
  `
})
export class ArchitectEmbeddableComponent {
  universeId = input.required<string>();
  spaceSlug = input.required<string>();

  nodeSelected = output<string>();
  nodeCreated = output<UniversalModule>();

  // Methods for external control
  selectNode(nodeId: string): void { ... }
  zoomToNode(nodeId: string): void { ... }
  refreshFromModules(modules: UniversalModule[]): void { ... }
}

Tool-to-Tool Synchronization

Selection Sync

When user selects in one tool, all tools reflect:

┌──────────────────────────────────────────────────────────────┐
│                     SELECTION SYNC                           │
├──────────────────────────────────────────────────────────────┤
│                                                              │
│   Canvas (select section) ──────► Architect (highlight node) │
│           │                              │                   │
│           ▼                              ▼                   │
│   Properties Panel updates      Mini-map centers on node     │
│                                                              │
│   Architect (select node) ──────► Canvas (scroll to section) │
│           │                              │                   │
│           ▼                              ▼                   │
│   Tree View highlights          Properties Panel updates     │
│                                                              │
└──────────────────────────────────────────────────────────────┘

Creation Sync

When AI generates modules:

┌──────────────────────────────────────────────────────────────┐
│                     CREATION SYNC                            │
├──────────────────────────────────────────────────────────────┤
│                                                              │
│   AI Generator                                               │
│        │                                                     │
│        ▼                                                     │
│   Creates UniversalModule[]                                  │
│        │                                                     │
│        ├──────► Canvas: forceRefreshFromModules()            │
│        │                                                     │
│        ├──────► Architect: rebuildNodes()                    │
│        │                                                     │
│        ├──────► Tree View: updateTree()                      │
│        │                                                     │
│        └──────► Status Bar: "4 modules created"              │
│                                                              │
└──────────────────────────────────────────────────────────────┘

Keyboard Shortcuts

Shortcut Action
⌘1 Switch to AI Generator
⌘2 Switch to Canvas
⌘3 Switch to Architect
⌘4 Switch to Pages
⌘5 Switch to Logic
⌘6 Switch to Deploy
⌘B Toggle sidebar
⌘\ Toggle secondary workspace
⌘S Save universe
⌘Z Undo (across tools)
⌘⇧Z Redo (across tools)
⌘K Command palette
Space Pan mode (in Canvas/Architect)

Success Criteria

Metric Current Target
Default route /canvas /builder
Tools in unified view 2 6+
Tool switch time Route navigation Instant tab switch
Cross-tool sync Partial Full bi-directional
State persistence Per-tool Unified
Keyboard shortcuts Limited Comprehensive

Migration Strategy

Phase 1: Non-Breaking Changes

Phase 2: Default Change

Phase 3: Cleanup


Visual Mockup: Final State

┌─────────────────────────────────────────────────────────────────────────────────────┐
│ 🌌 Fitness Center Universe                               [Save] [Preview] [Deploy]  │
├─────────────────────────────────────────────────────────────────────────────────────┤
│ [✨ AI] [🎨 Canvas] [🔮 Architect] [📄 Pages] [⚡ Logic] [🚀 Deploy]   │ ⚙️ │ 👤 │
├───────────────────────┬─────────────────────────────────────────────────────────────┤
│                       │                                                             │
│  📁 STRUCTURE         │                  MAIN WORKSPACE                             │
│  ─────────────        │                                                             │
│  ▼ 🌌 Fitness Admin   │   ┌─────────────────────────────────────────────────────┐  │
│    ▼ 🌍 Members       │   │                                                     │  │
│      📄 List          │   │              ARCHITECT VIEW (Active)                │  │
│      📄 Detail        │   │                                                     │  │
│      📄 Form          │   │      ┌─────────┐      ┌─────────┐                   │  │
│    ▼ 🌍 Classes       │   │      │ Galaxy  │──────│ Galaxy  │                   │  │
│      📄 Calendar      │   │      │ Members │      │ Classes │                   │  │
│      📄 Booking       │   │      └────┬────┘      └────┬────┘                   │  │
│                       │   │           │                │                        │  │
│  ─────────────        │   │      ┌────┴────┐      ┌────┴────┐                   │  │
│  📋 PROPERTIES        │   │      │  World  │      │  World  │                   │  │
│  ─────────────        │   │      │ Member  │      │ Classes │                   │  │
│  Name: Member List    │   │      └─────────┘      └─────────┘                   │  │
│  Route: /members      │   │                                                     │  │
│  Type: Page Module    │   └─────────────────────────────────────────────────────┘  │
│                       │                                                             │
│  ⚡ ACTIONS           │   ┌──────────┬──────────┬──────────┬──────────┐            │
│  ─────────────        │   │ Preview  │  Code    │  JSON    │  Tests   │            │
│  • getMemberById      │   └──────────┴──────────┴──────────┴──────────┘            │
│  • createMember       │   ┌─────────────────────────────────────────────────────┐  │
│  • updateMember       │   │  <lib-fitness-center-member-list                    │  │
│  • deleteMember       │   │    [members]="membersState.items()"                 │  │
│                       │   │    (memberSelected)="onSelect($event)">             │  │
│                       │   │  </lib-fitness-center-member-list>                  │  │
│                       │   └─────────────────────────────────────────────────────┘  │
│                       │                                                             │
├───────────────────────┴─────────────────────────────────────────────────────────────┤
│  ✓ Saved 2 min ago │ 12 Modules │ 4 Pages │ Draft │ Last deployed: Never          │
└─────────────────────────────────────────────────────────────────────────────────────┘

Dependencies

Risks

Risk Probability Impact Mitigation
Performance with all tools loaded Medium High Lazy load embeddables
State conflicts between tools High Medium Single source of truth
Breaking existing workflows Medium High Keep independent routes
Complex keyboard shortcut conflicts Low Low Configurable shortcuts

Related Documentation

References

libs-space Libraries

libs-structural Libraries