Architecture: How should VfsSyncService detect whether to load modules fro...
Documentation for Sessions
🏗️ Architecture: How should VfsSyncService detect whether to load modules fro...
Date: 2026-03-10
Time: 21:12:57 UTC
Session: gspace1-200.8
Agent: angular
Confidence: 90%
Status: ✅ Documented
📋 Decision Context
Question:
How should VfsSyncService detect whether to load modules from GitLab or local disk?
Task: S200: VfsSyncService GitLab mode detection
🎯 Decision Made
Chosen:
Mode-aware pattern with setRepoContext(spaceSlug, universeSlug, branch). Shell components call setRepoContext() once from route params before hydration. All downstream operations (hydrate, refresh, edit-sync) auto-detect mode via repoContext presence.
Options Considered:
- No alternatives documented
💭 Reasoning
Two alternatives: (1) pass slugs through every method call — verbose, error-prone. (2) Global config/service — too broad, doesn't support per-project switching. The setRepoContext() pattern is clean: set once, read everywhere. The repoContext is private state that controls branching in hydrateModuleFiles(), syncChangeToBackend(), refreshAllModules(). Shell components are the natural entry point since they own route params. The fallback to disk mode when repoContext is null preserves backward compatibility.
📁 Files Involved
libs/libs-structural/vitto-studio/src/lib/services/vfs-sync.service.tslibs/libs-structural/vitto-studio/src/lib/components/studio-shell/studio-shell.component.tslibs/libs-structural/vitto-studio/src/lib/components/studio-dock-shell/studio-dock-shell.component.ts
🔗 Related
- Decision ID:
dev_1773177177675_v3p1ytc - Session: 200
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation