{#- Reason overflow (ADR-0024): a node's reasons clamped to a *line budget*. The block shows at most ``cap`` lines (settings.yaml ``reason_cap``: short reasons ⇒ that many reasons, a wrapped reason uses more of the budget); the overflow stays in the DOM, clipped by CSS (never cut mid-HTML, ADR-0018) and faded. A header chevron (reasons.js) reveals it in place and survives the ~10s fragment swap — ▼ when clipped, ▲ when open. The leaf detail page (check.html) stays full; the JSON envelope is untouched. -#} {#- Each line also carries the ``reason.actions`` slot (ADR-0034) — the place a dependent package hangs a local interaction off *this* reason, e.g. "raise a ticket for it". The slot is offered on every reason of every node and the filler decides where it applies; core passes the **unshortened** reason, since the 400-character clamp is a display budget and an action wants the whole text. Rendered server-side like the rest, so it survives the ~10s fragment swap. -#} {#- Reasons are keyed entries (ADR-0036), so a line can be pinned on its own. A quiet line is **shown**, in the maintenance tint (ADR-0032 rule 5) — hiding it would be the suppression covering its own tracks — and the node states how many are quiet, because the clamp above can put the pinned line below the fold and the count is then the only thing that always shows. -#} {#- What is being silenced (ADR-0032 rule 5: a transformed contribution is visible and attributable). A card that says only "maintenance" hides the transform — *we are silencing an error* is the thing worth knowing, and before the keystone it was not merely hidden but destroyed. Shown wherever a node's own status has been derived away from a countable reading, by a node pin or by every member being pinned; a check that reported ``MAINTENANCE`` itself has nothing to add. ``word`` includes the status word for surfaces that do not already print it. -#} {% macro reported_suffix(node, word=False) -%} {%- if node.own_code.name == 'MAINTENANCE' and node.reported_code.name not in ('MAINTENANCE', 'UNDEFINED') %} {% if word %}maintenance {% endif %}· {{ node.reported_code.name.lower() }}{% endif -%} {%- endmacro %} {#- Why the node is blue: who pinned it, until when, and their explanation. It sits **above** the reason block and outside the ``reason_cap`` clamp, so the reason for the colour can never be the thing that gets clipped — the placement rule the quiet count already follows. Paints its own maintenance tint, like every other maintenance surface, so it does not depend on the card fill under it. -#} {% macro pin_banner(node) -%} {%- if node.maintenance_entry %}
Silenced by {{ node.maintenance_entry.set_by or 'an admin' }} until {{ node.maintenance_entry.expires_at | localtime }}{% if node.maintenance_entry.reason and node.maintenance_entry.reason != 'maintenance' %} — {{ node.maintenance_entry.reason | markdown_inline }}{% endif %}
{% endif -%} {%- endmacro %} {#- The **viewed** node's own state, above its children. A subtree page is a dashboard *of the children*, which left the one node you actually navigated to as the only one on the page that never said anything about itself. A pin on it surfaced solely through the maintenance card at the foot of the page — in different words, with the reason tucked inside a form field, and `{% if is_admin %}`, so a viewer got nothing at all. `depth=0` already drew the viewed node as a card; this is the same thing at every other depth, which also ends the page disagreeing with itself as the depth control moves. Silent when the node has nothing of its own to add: a container with no reading, no reasons and no pin is exactly the page that should open with its children. It reports **own** status, not the roll-up — the children are directly below and say that themselves. Rendered as a `status-node` so it takes the same fill and ink as any box, and kept **inside `#status-grid`** so it refreshes on the ~10s poll; the maintenance card stays outside, deliberately, because it holds an open form. -#} {% macro viewed_head(node, reason_cap) -%} {%- if node.maintenance_entry or node.reason or node.stale or node.own_code.name != 'UNDEFINED' %}
{{ status_cue(node.own_code) }}{{ node.name }} {%- if node.stale %} stale{% if not node.children %} · {{ node.age_seconds | round | int | duration }} ago{% endif %}{% endif %} {#- The head is the topmost visible node of this view, so the observation time shows here and the cards below suppress an identical one (ADR-0044): seven aspect cards repeating one check's run time invite a reader to think the seven were checked separately. -#} {{ card_time(node) }}{{ node.own_code.name.lower() }}{{ reported_suffix(node) }} {{ pin_banner(node) }}{{ reason_block(node, reason_cap) }}
{%- endif -%} {%- endmacro %} {#- A coded line (ADR-0042) carries the entry's **own** claim: its state class, a small labeled cue (a line has no status word, so the cue is its accessible name), and its state's own tint — every coded line paints one, because a mixed list sits on a *vivid* card fill, where a surfaceless passed line would read as more of the problem (the is-quiet lesson: ink-on-whatever fails the bar). A quiet (pinned) line keeps the maintenance tint whatever its code says: suppression is the louder fact. `is-running` marks work in flight — italic, display only; the line's words still say it, so no meaning rides on the italic alone. -#} {% macro reason_block(node, cap) -%} {%- if node.reasons -%} {%- set total = node.reasons | length -%}
{%- for line in node.reasons %}
{{ slot('reason.actions', node=node, reason=line.text, index=loop.index0, surface='grid') }}{% if line.code %}{{ status_cue(line.code, labeled=true) }}{% endif %}{{ line.text | shorten(400) | markdown }}
{%- endfor %}
{#- Under a **node** pin everything here is silenced already, so this count is not the reason the card is blue — the banner is. It says what will still be quiet once the node pin is cleared, which is the one thing the banner cannot. -#} {%- if node.quiet_reasons %}
{{ node.quiet_reasons }} of {{ total }} {% if node.maintenance %}also pinned individually{% else %}in maintenance{% endif %}
{% endif -%} {%- endif -%} {%- endmacro %} {#- The shape cue lives in its own partial (_status_cue.html) so the leaf detail page can import it without executing this template's body; the rationale and the labeling rule are documented there. -#} {% from '_status_cue.html' import status_cue %} {% from '_next_update.html' import next_update %} {#- Maintenance pip: a click-to-open marker on a card whose subtree holds a pinned node but which is not itself pinned — a glance at any depth shows where to drill, and a click opens a popover (maintenance.js) listing that card's pins as links. A real