Refactor: How should ai-panel-core be cleaned up to remove dead code f...

Documentation for Sessions

♻️ Refactor: How should ai-panel-core be cleaned up to remove dead code f...

Date: 2026-03-04
Time: 17:41:31 UTC
Session: gspace1-175.9
Agent: angular
Confidence: 97%
Status: ✅ Documented


📋 Decision Context

Question:

How should ai-panel-core be cleaned up to remove dead code from the Session 171 migration?

Task: Session 175: Clean up ai-panel-core dead code


🎯 Decision Made

Chosen:

Deleted ~4000 lines of dead code: AIPanelComponent (3000+ lines), AIPanelImageComponent, AIPanelVideoComponent, AIPanelWidgetComponent, AIErrorBoundaryComponent, SpaceAgentsService, and the deprecated ExtensionPanelComponent. Moved AIChatMessage/AIPanelConfig types to types file before deletion. Cleaned up index.ts and services barrel. Verified builds for gograb-ai AND gograb-space pass.

Options Considered:

  1. Delete dead code now
  2. Mark deprecated and delete later
  3. Move to separate legacy library

💭 Reasoning

Session 171 replaced AIPanelComponent with UnifiedChatShellComponent in AiPanelTabsComponent. The generation panels (Image/Video/Widget) were only used inside the now-deleted AIPanelComponent — zero external consumers. ExtensionPanelComponent was the last consumer of AIPanelComponent and is not loaded by any route (replaced by VittoChatPanelComponent in Session 149). Dead code adds confusion (as the user noted), increases bundle size, and makes the library boundary unclear. The alive parts — AIPanelStateService, AIPanelCoreStateService, AiPanelTabsComponent, AiPanelTriggerDirective, types — remain untouched.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation