# Agent Health Page — Progressive Filtering ## Context The Cameleer3 sidebar now has an "Agents" section with a tree of applications and their running instances. Clicking the "Agents" section header should navigate to a full Agent Health page showing all applications and their instances. Clicking an app in the tree narrows to that app's instances. Clicking an instance narrows to that single instance with charts. The page follows the mockup at `ui-mocks/mock-v3-agent-health.html`: stat strip at top, application group cards in a 2-column grid, instance rows within each card, and an EventFeed at the bottom. ### Domain Model - **Application** (e.g., "order-service") = logical grouping for exchange executions - **Agent** = the application's running binary code (synonymous with "application") - **Instance** (e.g., "prod-1") = a running copy of the agent on a specific server ## Routing One page component handles three URL levels: | URL | Scope | What shows | |-----|-------|-----------| | `/agents` | All | All applications, all instances | | `/agents/:appId` | App | One application's instances (full-width card) | | `/agents/:appId/:instanceId` | Instance | Single instance with expanded charts | React Router config: replace both `/agents` and `/agents/:id` routes with a single `} />`. Remove the `AgentDetail` import and route (the AgentHealth page now handles all `/agents/*` paths). The `AgentDetail.tsx` stub page becomes dead code and should be deleted. **URL parsing in the component:** ```ts const { '*': rest } = useParams() const segments = rest?.split('/').filter(Boolean) ?? [] // segments.length === 0 → all // segments.length === 1 → appId = segments[0] // segments.length === 2 → appId = segments[0], instanceId = segments[1] ``` ## Sidebar Changes ### Section header split The "Agents" section header becomes both a navigation link and a collapse toggle: - The text "Agents" is a `` (proper anchor semantics for right-click, screen readers) - The chevron (right side) is a `