{# Shared shell for every UI page. Blocks a page may override: title - browser tab title (defaults to the pipeline name) profile_options - the profile ` drive a form it is not nested in. HTML form-owner association does the wiring, no JS required. That association is also why there is exactly one selector: a page that swapped in a selector of its own would leave Run posting no profile at all. Assets are vendored only. There are no CDN references anywhere in this UI: it has to work on a laptop with no network. #} {% block title %}{{ project.display_name }} - kptn{% endblock %}
{# One selector, every page, always bound to the run form below. It marks ``selected_profile``, which each route that accepts a ``?profile=`` passes after validating it -- so a profile carried here through the nav arrives visible, and is the one Run and Plan will use. #} {# One run per project is the store's rule -- ``POST /runs`` answers 409 to a second one -- so while a run holds the lock the three controls that would start or re-aim one are disabled, and the notice below says why and links to the run that is holding it. This is an affordance, not the guard: the route keeps its own check, because a lock can be taken between this render and the submit. ``data-run-control`` is the contract app.js toggles these by when the run ends under an open page. It toggles the *property* and never re-renders this group: a swap would wipe an unsubmitted profile choice out from under the reader every few seconds. #}
{# The form the selector above belongs to. POST, because it starts work. #}
{# Plan reads rather than starts, so it is a plain GET -- and a real ``
`` with a real ``
{# Why the controls are refused, and the way out: the active run's page is where Stop is. Rendered on every page and hidden when there is none, rather than built by app.js when it sees one -- the poller sets ``hidden`` and the href and nothing else, so this markup has exactly one home. #} a run is in progress {# The profile travels with the reader. The links carry ``selected_profile``, which each route that accepts a ``?profile=`` passes after validating it -- the run page's comes from the run row rather than the URL. So choosing a profile and clicking Plan shows the plan for *that* profile, with no JavaScript involved. Deliberately the route's value and not the request's query string: a page that *refused* a profile (the unknown-profile 400) must not hand it to the next page, or every link on that error page is another 400. A page that passes nothing gets a clean nav, which is the right answer for the run history and for every error shell. ``data-profile-link`` holds each link's bare path, and is the contract app.js rebuilds these hrefs from when the selector changes without a submit -- the one case no server render can know. The history link carries it. The history does not filter by profile, but it does carry one to the page after it, so a bare link here would break the chain at the click -- one step before anything server-side could help. Plan is not among them: it is a button in the controls above, and takes the profile in its own hidden input. The walkthrough is not linked here. ``/walkthrough`` still serves, and the plan page still links into its per-task pages; it is only off the bar. #} {% set profile_query = "?profile=" ~ (selected_profile | urlencode) if selected_profile else "" %}
{% block content %}{% endblock %}
{% block scripts %}{% endblock %}