Refactor: How should the AI Panel component (3083 lines) be separated ...

Documentation for Sessions

♻️ Refactor: How should the AI Panel component (3083 lines) be separated ...

Date: 2026-02-17
Time: 21:31:57 UTC
Session: gspace1-112.3
Agent: angular
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

How should the AI Panel component (3083 lines) be separated from Vitto's command hub?

Task: Session 112: Extract AI Panel from vitto-hub into ai-panel-core


🎯 Decision Made

Chosen:

Extract AiPanelComponent + 5 sub-components + 4 services + 2 model files from @libs-ai/vitto-hub into @libs-ai/ai-panel-core. The ai-panel-core library already existed as a lightweight shell (trigger directive + core state + types). Expanded it to hold the full AI Panel.

Options Considered:


💭 Reasoning

The AiPanelComponent talks to 3 backends (backend-ai-api, backend-api, backend-vitto-api) and has 26 inject() calls. It's the universal interface for ALL AI interactions — not specific to Vitto. Keeping it in vitto-hub conflated the interface with the orchestrator. ai-panel-core already existed with an intentional design: lightweight types/triggers that any library can import without pulling heavy deps. We expanded it to also hold the heavy component, since the trigger/types remain importable separately via their existing export paths. No circular dependencies introduced because ai-panel-core doesn't import from vitto-hub.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation