{# The app chrome — the kit's .mgf-console shell (mgf/console.html, M1 P4.2)
   with ProofWarden's chrome in its blocks: the global run pill + CI/print
   actions in the top bar; the project nav + the authority legend in the rail.
   The shell markup/CSS live in mgf-brand-web (one source of truth); only
   test-web content lives here. #}
{% extends "mgf/console.html" %}

{% block title %}ProofWarden — testing &amp; CI authority{% endblock %}
{% block mark_title %}ProofWarden{% endblock %}
{% block mark_sub %}testing &amp; CI authority{% endblock %}

{% block topbar %}
    <span class="mgf-console__pill" title="Global run state across every project">
      <span class="status-indicator{% if chrome.pill.state in ['running', 'idle', 'down'] %} status-indicator--{{ chrome.pill.state }}{% endif %}"></span>
      <span class="mgf-console__pill-label">{{ chrome.pill.label }}</span>
      {% if chrome.pill.counts %}<span class="mgf-console__pill-counts mono">{{ chrome.pill.counts }}</span>{% endif %}
    </span>
    {% if chrome.ci_slug %}<a class="button button-secondary button-sm" href="/p/{{ chrome.ci_slug }}/ci">Open CI</a>{% endif %}
    <button class="button button-secondary button-sm" type="button" onclick="window.print()">Print / Export</button>
{% endblock %}

{% block rail_label %}Projects{% endblock %}
{% block rail %}
      <div class="mgf-console__rail-h">Projects</div>
      {% for p in chrome.projects %}
      <a class="mgf-console__nav {% if chrome.active == p.slug %}mgf-console__nav--on{% endif %}" href="/p/{{ p.slug }}">
        <span class="status-indicator{% if p.state in ['running', 'queued', 'down'] %} status-indicator--{{ p.state }}{% endif %}"></span>
        <span class="mgf-console__nav-main">
          <span class="mgf-console__nav-name">{{ p.name }}{% if p.live %} <span class="live-dot"></span>{% endif %}</span>
          <span class="mgf-console__nav-kind">{% if p.kind %}{{ p.kind }} · {% endif %}{{ p.label }}</span>
        </span>
      </a>
      {% else %}
      <p class="mgf-console__rail-empty mono">no projects discovered</p>
      {% endfor %}

      <section class="mgf-console__legend" aria-label="State language">
        <div class="mgf-console__legend-h">Authority &amp; status</div>
        {% for state, desc in chrome.legend %}
        <div class="mgf-console__legend-row">
          <span class="status-indicator{% if state in ['running', 'queued', 'down'] %} status-indicator--{{ state }}{% endif %}"></span>
          {{ desc }}
        </div>
        {% endfor %}
        <p class="mgf-console__legend-note">
          The <b>warden</b> is the sole executor — the console submits run <i>requests</i>,
          it never runs a test. A second launch of a running test is <b>coalesced</b>, not
          double-run. Live logs are <span class="telemetry-marker">telemetry</span>; the
          run-record is the durable truth.
        </p>
      </section>
{% endblock %}
