Improving Universe Editing and Visuals

Plan to enhance universe visualization, editing tools, and user experience across all platform building interfaces.

Improving Universe Editing and Visuals

Executive Summary

Current universe editing and visualization tools are disconnected and provide poor visibility into platform structure. Users see their entire universe as a single node, making it impossible to understand, navigate, or modify their platform effectively. This plan addresses the visual hierarchy, tool integration, and overall editing experience.

Current State Analysis

Visual Representation Issues

Tool Issue Impact
Universe Architect Shows universe as single node Users can't see structure hierarchy
Canvas Builder Flat stacked sections No visual hierarchy, modules just stacked
Tree View Generic badges Shows "(MODULE)" instead of specific types
Route Viewer Disconnected from canvas Routes don't visually connect to modules

Screenshot Evidence (Session 33.1)

  1. Universe Architect View:

    • Single "Fitness Center" node with /fitness-center route
    • No child modules visible despite having entities
    • No visual hierarchy (expected: Universe Core → Galaxies → Worlds → Pages)
  2. Canvas Builder View:

    • "Fitness Center" shown as single MODULE section
    • No drill-down into module contents
    • "Drop here to add new section" - unclear what can be dropped

Tool Disconnection

Current Flow (Broken):
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│  AI Generator   │───▶│  Canvas Builder │───▶│ Universe Arch.  │
│  (Creates code) │    │  (Shows flat)   │    │  (Shows 1 node) │
└─────────────────┘    └─────────────────┘    └─────────────────┘
        │                      │                      │
        └──────────────────────┴──────────────────────┘
                     No sync / Different views

Type Consistency (Session 32.2 - Completed)

The following fixes were made in Session 32.2:

However, modules still display as "(MODULE)" because:

  1. Existing modules were created before the fix
  2. New modules need semantic type set during generation
  3. Backend may not be storing/returning semantic types

Root Cause Analysis

1. Universe Structure Not Loaded

File: libs/libs-space/universe-architect/src/lib/components/architect-canvas/architect-canvas.component.ts

Root Cause: Modules are generated as FILES but not persisted as UNIVERSE STRUCTURE

2. Module-to-Universe Structure Gap

When AI generates modules:

  1. Files written to modules/other/fitness-center/
  2. BUT modules NOT added to universe's modules[] array
  3. Universe architect sees empty structure

3. Canvas Builder Shows CanvasSection, Not Modules

4. Missing API Endpoints

Console errors show:

GET /api/spaces/.../universes/universe_... 404 (Not Found)
GET /api/catalog/modules 404 (Not Found)

These missing endpoints prevent:

Implementation Plan

Phase 1: Fix Universe Structure Persistence (Priority: Critical)

Objective: Ensure generated modules are added to universe structure

Tasks:

  1. After code generation, call universe module API to add modules

    // In vibe-coding-orchestrator after file generation:
    await this.universeModuleService.bulkCreate(universeId, generatedModules);
    
  2. Create proper module hierarchy:

    • Platform root (Universe Core)
    • Galaxy per feature area (Member Management, Class Scheduling, etc.)
    • World per entity domain
    • Page-Module per CRUD view
  3. Update BackendModuleGeneratorService to persist structure

Files to Modify:

Phase 2: Fix Missing API Endpoints (Priority: Critical)

Objective: Create missing endpoints for universe and catalog operations

Tasks:

  1. Create /api/catalog/modules endpoint

    @Controller('catalog')
    export class CatalogController {
      @Get('modules')
      async listModules(@Query() filter: ModuleFilter) {
        // Return available module templates
      }
    }
    
  2. Fix universe ID format consistency

    • Frontend uses universe_1767... format
    • Ensure backend accepts this format
    • Or standardize on MongoDB ObjectId
  3. Add universe structure endpoints:

    • GET /api/universes/:id/structure - Full hierarchy
    • PUT /api/universes/:id/structure - Update hierarchy
    • POST /api/universes/:id/modules - Add module to universe

Files to Create/Modify:

Phase 3: Enhance Universe Architect Visualization (Priority: High)

Objective: Show proper hierarchical visualization of universe structure

Tasks:

  1. Load ALL modules for universe, not just root

    • Query modules with universeId filter
    • Build parent-child relationships from parentId
  2. Implement hierarchical layout:

    Platform Root (center)
    ├── Galaxy: Member Management (orbit 1)
    │   ├── World: Members
    │   │   ├── Page: Member List
    │   │   ├── Page: Member Detail
    │   │   └── Page: Member Form
    └── Galaxy: Class Scheduling (orbit 2)
        └── World: Classes
            ├── Page: Class Calendar
            └── Page: Booking Form
    
  3. Add visual connections:

    • Orbital lines between parent-child
    • Route path visualization
    • Data flow arrows
  4. Enable drill-down interaction:

    • Click galaxy → zoom to show worlds
    • Click world → zoom to show pages
    • Double-click → edit module

Files to Modify:

Phase 4: Improve Canvas Builder Integration (Priority: High)

Objective: Make canvas builder actually useful for universe editing

Tasks:

  1. Show module hierarchy in tree view

    • Expand/collapse galaxies, worlds, pages
    • Show proper type badges (Galaxy, World, Page Module)
  2. Add module editing capabilities:

    • Click module → show properties panel
    • Edit route, name, description
    • Configure module settings
  3. Enable drag-drop module organization:

    • Reorder modules within parent
    • Move modules between parents
    • Visual feedback during drag
  4. Sync canvas with architect:

    • Changes in canvas reflect in architect
    • Changes in architect reflect in canvas
    • Real-time sync via signals

Files to Modify:

Phase 5: Unified Editing Experience (Priority: Medium)

Objective: Create seamless editing across all tools

Tasks:

  1. Create unified module editor panel

    • Works in both Canvas Builder and Universe Architect
    • Edit all module properties
    • Preview changes before saving
  2. Implement undo/redo across tools

    • Shared history stack
    • Cross-tool undo (change in architect, undo in canvas)
  3. Add real-time collaboration foundation

    • Module lock indicators
    • Conflict resolution
    • User presence
  4. Create unified save/deploy flow:

    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐
    │    Edit     │───▶│   Review    │───▶│   Deploy    │
    │  (Canvas/   │    │  (Preview)  │    │  (Publish)  │
    │  Architect) │    │             │    │             │
    └─────────────┘    └─────────────┘    └─────────────┘
    

Files to Create/Modify:

Phase 6: Visual Polish (Priority: Low)

Objective: Make the tools visually appealing and intuitive

Tasks:

  1. Improve node styling in architect

    • Domain-specific icons (already started in Session 32)
    • Color coding by module type
    • Visual status indicators
  2. Add minimap for large universes

    • Overview of entire structure
    • Quick navigation
  3. Implement smooth animations

    • Node transitions
    • Zoom/pan effects
    • Connection animations
  4. Dark/light theme support

    • Consistent with platform theme system
    • User preference persistence

Success Criteria

Metric Current Target
Visible hierarchy levels 1 (root only) 4+ (root → galaxy → world → page)
Tool synchronization None Real-time
Module editing capability None Full CRUD
API endpoint coverage ~60% 100%
User understanding score Low High (measurable via user testing)

Visual Mockup (Expected State)

Universe Architect (After Fix)

                    ┌──────────────────┐
                    │  🌟 Fitness     │
                    │    Center       │
                    │  (Universe Core)│
                    └────────┬────────┘
                             │
        ┌────────────────────┼────────────────────┐
        │                    │                    │
┌───────▼───────┐   ┌───────▼───────┐   ┌───────▼───────┐
│ 🌌 Member     │   │ 🌌 Class      │   │ 🌌 Trainer    │
│  Management   │   │  Scheduling   │   │  Profiles     │
│   (Galaxy)    │   │   (Galaxy)    │   │   (Galaxy)    │
└───────┬───────┘   └───────┬───────┘   └───────────────┘
        │                   │
   ┌────┴────┐         ┌────┴────┐
   │         │         │         │
┌──▼──┐  ┌──▼──┐   ┌──▼──┐  ┌──▼──┐
│List │  │Form │   │Cal- │  │Book │
│Page │  │Page │   │endar│  │Form │
└─────┘  └─────┘   └─────┘  └─────┘

Canvas Builder Tree (After Fix)

📁 Fitness Center (Universe)
├── 🌌 Member Management (Galaxy)
│   ├── 🌍 Members (World)
│   │   ├── 📄 Member List (Page Module)
│   │   ├── 📄 Member Detail (Page Module)
│   │   └── 📄 Member Form (Page Module)
├── 🌌 Class Scheduling (Galaxy)
│   └── 🌍 Classes (World)
│       ├── 📄 Class Calendar (Page Module)
│       └── 📄 Booking Form (Page Module)
└── 🌌 Trainer Profiles (Galaxy)
    └── 🌍 Trainers (World)
        └── 📄 Trainer List (Page Module)

Dependencies

Risks

Risk Probability Impact Mitigation
Performance with large universes Medium Medium Virtualization, lazy loading
State sync conflicts High Medium Optimistic updates with conflict resolution
Breaking existing saved universes Medium High Migration script, backward compat

Related Documentation

References