Universe Canvas Builder
Documentation hub for the GoGrab Space Universe Canvas Builder with nested template system
๐จ Universe Canvas Builder - Documentation Hub
๐ Quick Start
๐ START HERE: Nested Template System Guide - Complete working implementation, architecture, and solutions to all known issues.
๐ Core Documentation
๐๏ธ System Architecture
- Nested Template System โญ MASTER GUIDE
- Complete architecture overview
- Region-based template system
- Common issues & solutions
- Testing guide
- AI training considerations
๐ Planning & Strategy
- Platform Agnostic Layouts - Web-to-Flutter mapping
- Implementation Roadmap - Phase-by-phase plan
- Template Module Pattern - Module creation guide
- Simplified Philosophy - User-centric design approach
โ Implementation Reports
- Template Modules Complete - All 6 templates implemented
- Session Complete Summary - Historical work summary
- Integration Status - Current integration state
๐ง Integration Guides
- Quick Start Integration - How to integrate templates
- Integration Test Plan - Testing strategy
- Current Status Ready to Test - Latest status
๐ฏ What's Working (November 24, 2025)
โ Fully Functional
- Template Rendering - CSS Grid layouts with visual regions
- Click Selection - Both canvas and tree view
- Configuration Panel - Dynamic tabs and form fields
- Position Operations - Move up/down/out/into for nested sections
- Add Operations - Add inside/after/before in regions
- Delete Operation - Recursive deletion from regions
- Tree View - Shows complete hierarchy including regions
- Infinite Nesting - Templates within templates
๐ Recently Fixed Issues
All documented in Nested Template System Guide:
- โ Can't select nested template in tree
- โ Can't click template background
- โ Position operations don't work on nested sections
- โ Tree view doesn't show nested templates
- โ Nested templates not filling space
๐ Available Templates
Production-Ready Templates (6)
- Split Sidebar - Fixed sidebar + flexible main region
- Two-Column Equal - 2 equal columns (50/50)
- Three-Column Equal - 3 equal columns (33/33/33)
- Header-Content-Footer - Classic 3-row layout
- Dashboard - 4-quadrant grid layout
- Custom - User-defined grid structure
All templates:
- โ Support infinite nesting
- โ Configurable via manifest schema
- โ CSS Grid for web, Row/Column for Flutter
- โ Auto-responsive
- โ AI-trainable
๐ค For AI Agents
Key Architecture Decisions
Region-Based vs. Flat Structure: We chose region-based architecture
Why Regions?
- โ Semantic understanding ("sidebar", "main", "header")
- โ Natural language aligned ("Add to sidebar")
- โ Self-validating (check if region exists)
- โ Industry patterns (Vue slots, React children)
- โ Scalable (region-specific constraints)
Critical Pattern:
// For templates: Use regions
if (section.layout === 'template') {
const region = section.regions.find(r => r.name === 'sidebar');
region.children.push(newSection);
}
// For regular sections: Use children
else {
section.children.push(newSection);
}
10 Critical Methods
All these methods in canvas-builder.component.ts must handle BOTH section.children AND section.regions[].children:
getSelectedSection()- Find by IDdeleteSection()- Remove sectionupdateSection()- Update propertiesmoveSectionUp()- Reorder siblingsmoveSectionDown()- Reorder siblingsmoveSectionOut()- Ungroup from parentmoveSectionInto()- Nest into siblingaddSectionInside()- Add childaddSectionAfter()- Add sibling afteraddSectionBefore()- Add sibling before
Failure Mode: If any method only searches section.children, it will fail for sections nested in template regions!
๐ File Structure
libs/libs-structural/modular-universe/src/lib/universe-canvas-v3/
โโโ components/
โ โโโ canvas-builder/ # Master component (10 critical methods)
โ โโโ canvas-section/ # Recursive section renderer
โ โโโ template-renderer/ # CSS Grid template renderer
โ โโโ tree-node/ # Hierarchical tree view
โ โโโ config-panel/ # Dynamic configuration panel
โ โโโ layout-selector/ # Template selection UI
โ โโโ module-palette/ # Drag-drop source
โโโ models/
โ โโโ canvas.types.ts # Core data structures
โโโ tests/
โโโ canvas-builder.test.ts # Unit tests
โโโ template-modules.test.ts # Template contract tests
๐งช Testing Status
Unit Tests
- โ Canvas builder logic
- โ Template module contracts
- โ ๏ธ TODO: Region operation tests
Integration Tests
- โ ๏ธ TODO: End-to-end template integration
- โ ๏ธ TODO: Nested template scenarios
- โ ๏ธ TODO: Performance with deep nesting
Manual Testing
- โ Template rendering
- โ Click selection
- โ Configuration panel
- โ Position operations
- โ Add/delete operations
๐ Learning Resources
For Developers
- NESTED-TEMPLATE-SYSTEM.md - Master guide
- TEMPLATE_MODULE_PATTERN.md - How to create templates
- PLATFORM_AGNOSTIC_LAYOUTS.md - Cross-platform design
For AI Training
- NESTED-TEMPLATE-SYSTEM.md#ai-training-considerations
- Region-based architecture rationale
- Helper methods for hierarchical traversal
๐ Support
- Issues: Document in NESTED-TEMPLATE-SYSTEM.md Common Issues section
- Questions: Refer to master guide first
- New Templates: Follow TEMPLATE_MODULE_PATTERN.md
Last Updated: November 24, 2025 - 11:35 PM EST
Session ID: 11.25.2.4
Status: โ
All Core Features Working