Pattern: What is the correct pattern for loading files from GitLab in...
Documentation for Sessions
🎨 Pattern: What is the correct pattern for loading files from GitLab in...
Date: 2026-03-18
Time: 00:02:50 UTC
Session: gspace1-231.9
Agent: angular
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
What is the correct pattern for loading files from GitLab into the VFS for Vitto Studio's code editor and live preview?
Task: Establish correct pattern for VFS file loading from GitLab
🎯 Decision Made
Chosen:
Observable-returning file loaders with forkJoin completion tracking. Each module/app loader returns Observable
that completes when ALL file contents are written to VFS. The parent orchestrator uses forkJoin(loaders) and only signals 'loaded' after ALL observables complete. The VFS tree shows only code-relevant files (apps/, modules/, config/, docs/) — NOT raw JSON data blobs (pages, widgets, entities).
Options Considered:
- Fire-and-forget subscribe loops with timer delay (original, unreliable)
- forkJoin Observable completion tracking (chosen, guarantees readiness)
- Polling VFS for expected files (complex, unnecessary)
💭 Reasoning
The original pattern used fire-and-forget subscribe() loops — the 'loaded' signal fired after just getting the file list, not after content was fetched. This caused the preview to try compiling before VFS had any files. The forkJoin pattern guarantees all file contents are in VFS before any downstream consumer (preview compiler, file tree) reacts. The data file exclusion (pages/widgets/entities JSON) was a UX decision: these are database records managed by dedicated dock panels, not source code a developer edits. Showing them in the code editor confused intent.
📁 Files Involved
libs/libs-structural/vitto-studio/src/lib/services/vfs-sync.service.ts
🔗 Related
- Decision ID:
dev_1773792170466_2wb5x83 - Session: 231
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation