{# DASHBOARD center view (live) — the ALL-PROJECTS overview (cross-project fleet). This is the console's landing Dashboard: a KPI strip (fleet-wide totals) over a grid of cards, one per ACTIVE project, each showing REAL vitals (agents · active tasks · pending handoffs · events/24h from /state, fetched concurrently) + a health pill + a best-effort epic-progress strip. Cards are sorted attention- first (busiest pending queues lead) so it answers "who needs attention across the fleet" at a glance. Clicking a card SELECTS that project in the rail + scopes cols 2/4 (agents + workspace) to it — it reuses the rail's exact project-select flow (hx-get="/projects/{key}" → #scope-region). The center itself stays on this cross-project Dashboard (Dashboard is not project-scoped). Context (built server-side in main._fleet_context — templates do no logic): `fleet_cards` : sorted list of card views. Each: key, name, repo_root, pico, initial, agent_count, active_tasks, pending_handoffs, events_24h, health{state,label}, needs_attention, epic{...} `fleet_count` : number of active projects `fleet_kpis` : {projects, agents, active_tasks, pending_handoffs, events_24h, attention} `selected_key` : the operator's currently-scoped project (highlights its card) A None counter renders as '—' (graceful degrade when a project's /state was unreachable — that card's health pill reads 'no data'). #}

All projects

{{ fleet_kpis.projects }} project{{ '' if fleet_kpis.projects == 1 else 's' }} {{ fleet_kpis.agents }} agents {% if fleet_kpis.attention %} {{ fleet_kpis.attention }} need{{ '' if fleet_kpis.attention == 1 else 's' }} attention {% endif %}
live
{# ===== KPI strip — fleet-wide vitals (the zoom-out) ===== #}
Agents
{{ fleet_kpis.agents }}/ {{ fleet_kpis.projects }} project{{ '' if fleet_kpis.projects == 1 else 's' }}
Needs attention
{{ fleet_kpis.attention }}project{{ '' if fleet_kpis.attention == 1 else 's' }}
high pending queues, sorted first
Pending handoffs
{{ fleet_kpis.pending_handoffs }}fleet-wide
{{ fleet_kpis.active_tasks }} active task{{ '' if fleet_kpis.active_tasks == 1 else 's' }}
Events · 24h
{{ fleet_kpis.events_24h }}all projects
{# ===== Projects section — one card per active project ===== #}

Projects

{{ fleet_count }}
{% if fleet_cards %}
{% for c in fleet_cards %} {# The card has TWO actions (two sibling buttons inside a .pcard wrapper — valid HTML, no nested interactive elements): 1. .pc-main (the head + epic body) SCOPES the app to this project via the SAME flow the rail uses (GET /projects/{key} → #scope-region), re-rendering col-2 (agents) + col-4 (workspace). The center stays on this cross-project Dashboard. 2. .pc-drill (the footer "open ›" affordance) DRILLS IN — swaps the center to this project's detail view (GET /projects/{key}/detail → #center-region) with the full open-handoffs + tasks lists. .attn marks a needs-attention card; .is-selected marks the scoped one. #}
{# /.pc-main (scope) #} {# vitals footer — the real /state counters + the DRILL-IN affordance. Sits OUTSIDE .pc-main so the drill-in button is a valid sibling (no nested interactive elements). The footer's "open ›" button swaps the CENTER to this project's detail view (full handoffs + tasks lists). #}
{{ c.active_tasks if c.active_tasks is not none else '—' }} active {{ c.pending_handoffs if c.pending_handoffs is not none else '—' }} pending {{ c.events_24h if c.events_24h is not none else '—' }} events 24h
{# /.pcard #} {% endfor %}
{% else %}

No active projects returned by Cortex.

{% endif %}