WIDGETS ROUTE CONFUSION FIX

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

🔧 Widgets Route Confusion - Fixed

Date: October 27, 2025
Issue: Widgets showing at wrong URL
Status: ✅ Fixed

Problem

Widgets were accessible at TWO locations:

  1. ❌ /editor/:universe/widgets (WRONG - universe-scoped)
  2. ✅ /space/widgets (CORRECT - space-scoped)

This violated our modular architecture where widgets should be space-level only.

Root Cause

The editor routes (libs/editor-web-lib/src/lib/editor.routes.ts) incorrectly had a widgets route:

// ❌ WRONG - This was in editor.routes.ts
{
  path: ':universeIdentifier/widgets',
  loadComponent: () => import('./components/widgets/widgets-panel.component')
}

Solution

Removed the widgets route from editor routes entirely.

File Changed

libs/editor-web-lib/src/lib/editor.routes.ts

Before:

{
  path: ':universeIdentifier/widgets',  // ❌ Universe-scoped
  loadComponent: () => WidgetsPanelComponent
}

After:

// Removed completely ✅

Correct Architecture

/space/widgets                  ← Space-scoped Widgets Manager ✅
  ↓
Manages widgets for ENTIRE space
  ↓
Reusable across ALL universes

/editor/:universe/workspace     ← Editor (uses widgets from space) ✅
  ↓
Uses widgets via Widget Library
  ↓
Creates instances on pages

URL Structure

✅ Correct URLs

/space/widgets                      → Widgets Manager Dashboard
/space/widgets/create               → Create New Widget
/space/widgets/edit/:widgetId       → Edit Widget

/editor/:universe/workspace         → Editor Workspace
/editor/:universe/pages             → Page Management

❌ Removed URLs

/editor/:universe/widgets           → REMOVED (was wrong scope)

Module System Compliance

Following @module-system-overview.md:

Module Base Route Scope
Editor /editor/:universe Universe-scoped ✅
Widgets Manager /space/widgets Space-scoped ✅
Space Map /space-map/:universe Universe-scoped ✅
Singularity /singularity/:universe Universe-scoped ✅

Testing

Verify Fix

  1. Navigate to: http://localhost:5200/editor/catuniverse-1/widgets

    • Expected: 404 or redirects to workspace ✅
  2. Navigate to: http://localhost:5200/space/widgets

    • Expected: Widgets Manager Dashboard ✅

Access Widgets

From anywhere in the app:

// Correct way to access widgets
router.navigate(['/space/widgets']);

Lesson Learned

Space-scoped vs Universe-scoped:

Always check route scope matches data scope! ✅


Related Files:

Status: ✅ Fixed
Last Updated: October 27, 2025