Architecture: How should route context labels be detected — hardcoded maps...
Documentation for Sessions
🏗️ Architecture: How should route context labels be detected — hardcoded maps...
Date: 2026-03-04
Time: 18:54:54 UTC
Session: gspace1-175.11
Agent: angular
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
How should route context labels be detected — hardcoded maps or auto-detection from route metadata?
Task: Session 175: Auto-detect route labels, move banner, add sub-section detection
🎯 Decision Made
Chosen:
Auto-detect from Angular's Router ActivatedRouteSnapshot tree. On every NavigationEnd, walk the route tree collecting
titleproperties into a breadcrumb (e.g., 'Skill Studio > Skill Builder'). Exposed asrouteLabelsignal on VittoPageContextRegistry. Hardcoded areaLabels/subAreaLabels maps marked @deprecated as fallback for routes without titles.
Options Considered:
- Auto-detect from Router ActivatedRouteSnapshot
- Derive from sidebar navGroups
- Keep hardcoded maps
- Use route resolvers
💭 Reasoning
Routes in vitto-hub.routes.ts already have title properties. The sidebar navGroups also have labels. Maintaining a THIRD copy in hardcoded maps is triple-maintained data that drifts. Reading from the Router is the single source of truth — when you add a route with a title, Vitto automatically knows about it. Zero maintenance cost for new routes.
📁 Files Involved
libs/libs-ai/vitto-core/src/lib/services/vitto-page-context-registry.service.tslibs/libs-ai/vitto-chat/src/lib/services/vitto-chat-context.service.ts
🔗 Related
- Decision ID:
dev_1772650494587_ye9h9pj - Session: 175
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation