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 title properties into a breadcrumb (e.g., 'Skill Studio > Skill Builder'). Exposed as routeLabel signal on VittoPageContextRegistry. Hardcoded areaLabels/subAreaLabels maps marked @deprecated as fallback for routes without titles.

Options Considered:

  1. Auto-detect from Router ActivatedRouteSnapshot
  2. Derive from sidebar navGroups
  3. Keep hardcoded maps
  4. 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


🔗 Related


Auto-generated by MCP Smart Consolidation