Architecture: Session 184.5: Fix AI panel architecture — shouldInject dete...

Documentation for Sessions

🏗️ Architecture: Session 184.5: Fix AI panel architecture — shouldInject dete...

Date: 2026-03-06
Time: 19:23:39 UTC
Session: gspace1-184.6
Agent: angular
Confidence: 92%
Status: ✅ Documented


📋 Decision Context

Question:

Session 184.5: Fix AI panel architecture — shouldInject detection, module boundary, auth state, extension header

Task: Fix AI panel architecture across all platforms


🎯 Decision Made

Chosen:

4 fixes: (1) shouldInject() now checks all 6 root selectors + port convention to prevent double-panel on GoGrab apps. (2) Moved AiPanelTabsComponent from ai-panel-core to vitto-chat, re-exported from ai-panel-core for backward compat. (3) Added isSleeping computed signal for auth-aware panel state. (4) Enhanced extension header with profile pill + close, inner close hidden when embedded.

Options Considered:

  1. Make vitto-chat buildable (rejected: cascading deps)
  2. Move AiPanelTabsComponent to vitto-chat with re-export (chosen)
  3. Create new non-buildable lib for the component (over-engineering)

💭 Reasoning

Root cause: shouldInject() only knew about 2 of 6 app root selectors, causing iframe injection on top of native panels. Module boundary: ai-panel-core (buildable) importing from vitto-chat (non-buildable) violates NX build graph — moving the component is simpler than making vitto-chat buildable (would cascade into many deps). Auth state: embedded panels without auth show empty UI with failing API calls — isSleeping computed from AuthService + URL params provides clear feedback. Extension header: was just a floating close button — now an inline bar with profile pill matching the app's design language.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation