Bugfix: Why did Studio's welcome content not render despite context ...
Documentation for Sessions
🐛 Bugfix: Why did Studio's welcome content not render despite context ...
Date: 2026-03-06
Time: 15:50:38 UTC
Session: gspace1-182.8
Agent: angular
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Why did Studio's welcome content not render despite context being detected?
Task: Session 183: Fix Studio welcome content not rendering
🎯 Decision Made
Chosen:
Changed welcome component map keys from ChatContext values ('platform-builder') to SpaceContext values ('vitto-studio') to match what richContext().contextType actually contains.
Options Considered:
- Change map keys to SpaceContext values (chosen - matches what component reads)
- Make welcome component resolve through SPACE_TO_CHAT_CONTEXT mapping (rejected - adds indirection, maps exist in different service)
- Bridge AIPanelCoreStateService to VittoChatContextService (deferred to S184 - correct long-term fix but scope too large for S183)
💭 Reasoning
Root cause: Two type systems for context. SpaceContext ('vitto-studio', 'page-builder', etc.) is what detectContextFromUrl() returns and what gets stored in richContext.contextType via the auto-route-detection path. ChatContext ('platform-builder', 'module-builder', etc.) is a secondary mapping used by getWelcomeMessage() and getCapabilitiesForContext(). The welcome component reads richContext().contextType directly (SpaceContext) but the hardcoded maps used ChatContext keys. The SPACE_TO_CHAT_CONTEXT mapping exists but the welcome component never uses it. Fix: use SpaceContext keys in the maps since that's what the component actually reads. Early warning: any time you add context entries to the welcome component, verify whether the map key is SpaceContext or ChatContext by tracing richContext().contextType source.
📁 Files Involved
libs/libs-ai/vitto-chat/src/lib/components/shared/welcome-message/welcome-message.component.tslibs/libs-ai/vitto-chat/src/lib/services/vitto-chat-context.service.ts
🔗 Related
- Decision ID:
dev_1772812237980_ofxg951 - Session: 182
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation