UNIVERSAL EDITOR ROUTES IMPLEMENTATION

Ecosistema completo para organización y gestión de contenido con interfaces espaciales

🎯 Universal Editor Routes Implementation

Date: November 5, 2025
Status: ✅ Completed
Priority: Critical - Architecture Improvement


🎯 What Changed

Implemented a universal editor route structure where ONE component (EditorWorkspaceComponent) handles ALL contexts through clean, RESTful routes:

New Route Structure:

/space/{space}/editor                           → Blank canvas (create new)
/space/{space}/editor/page/:pageId               → Edit existing page
/space/{space}/editor/universe/:universeId/page/:pageId  → Edit page in universe
/space/{space}/editor/module/:moduleId           → Create content for module
/space/{space}/editor/component/:componentId     → Build reusable component (future)
/space/{space}/editor/world/:worldId/page/:pageId → Edit world page (legacy support)

Benefits:

  1. ✅ One Component - Single EditorWorkspaceComponent handles all contexts
  2. ✅ Reactive Context Detection - Component detects context from route params
  3. ✅ Clean Routes - RESTful, readable, bookmarkable URLs
  4. ✅ Extensible - Easy to add new contexts (components, templates, etc.)
  5. ✅ Backward Compatible - Legacy routes redirect automatically

📝 Files Changed

1. Routes Configuration

2. Editor Component

3. Navigation Updates

Modularity:

Space Map:

Core Services:

Landing Page:

Manifest:


🔄 Context Detection

The EditorWorkspaceComponent now detects context reactively:

readonly context = computed(() => {
  if (moduleId()) return 'module-builder';
  if (componentId()) return 'component-builder';
  if (pageId() && universeId()) return 'edit-universe-page';
  if (pageId() && worldId()) return 'edit-world-page';
  if (pageId()) return 'edit-page';
  return 'blank-canvas';
});

🔄 Legacy Route Handling

Old routes automatically redirect:


⚠️ Known Issues / TODOs

  1. Editor Manifest Action (editor.manifest.ts)

    • openPage action needs spaceSlug for proper routing
    • Should be refactored to accept SpaceNavigationService or spaceSlug parameter
    • Currently uses placeholder temp-space (needs fix)
  2. Future Enhancements:

    • Add "Return to Module Builder" button when in module-builder context
    • Tag pages with moduleId metadata when created in module context
    • Auto-refresh page list in Modularity when returning from Editor

✅ Testing Checklist


🎉 Result

The Editor is now a universal content creation tool that adapts to any context through clean routes. No more confusion between module-building and universe-editing!