Bugfix: Why doesn't click-to-Vitto PE element context work for users...
Documentation for Sessions
🐛 Bugfix: Why doesn't click-to-Vitto PE element context work for users...
Date: 2026-03-26
Time: 18:06:59 UTC
Session: gspace1-274.5
Agent: angular
Confidence: 97%
Status: ✅ Documented
📋 Decision Context
Question:
Why doesn't click-to-Vitto PE element context work for users running Studio from gograb-space (port 6200)?
Task: S274: Wire PE_ELEMENT_CONTEXT_SIGNAL in gograb-space (S270 Gap D)
🎯 Decision Made
Chosen:
Wired PE_ELEMENT_CONTEXT_SIGNAL provider in gograb-space/app.config.ts with identical factory to gograb-dev — injects PreviewBridgeService + PreviewService, computes enriched element context with entity field diffing for missing fields detection
Options Considered:
- Wire only in gograb-space (chosen — copies gograb-dev pattern)
- Create a shared provider function to DRY up across all apps
- Wire at the library level in vitto-chat instead of per-app
💭 Reasoning
Root cause: S270 only wired PE_ELEMENT_CONTEXT_SIGNAL in gograb-dev/app.config.ts. Users run Studio from gograb-space (port 6200), not gograb-dev (port 6300). The InjectionToken pattern crosses module boundaries (vitto-chat cannot import platform-preview), so the provider MUST be at the app level. A shared provider function would violate the module boundary — the factory needs to inject PreviewBridgeService (platform-preview) and PreviewService (vitto-studio), which are structural libs that vitto-chat/vitto-hub can't depend on. Per-app wiring is the architecturally correct approach. What could make this wrong: if a third app (gograb-ai, gograb-admin) also renders Studio panels, it would need the same wiring. Early warning: check if AiPanelTabsComponent is rendered in other apps.
📁 Files Involved
apps/gograb-space/src/app/app.config.tsapps/gograb-dev/src/app/app.config.tslibs/libs-ai/vitto-chat/src/lib/components/ai-panel-tabs/ai-panel-tabs.component.ts
🔗 Related
- Decision ID:
dev_1774548419035_2hm18la - Session: 274
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation