{# Shell-rendered panel controls, shared by the run and study pages so both
scopes describe a panel's interactivity identically. ``facets`` supplies the
dynamic choices (episodes, agents, probes, backends) and is none at study
scope, where facet-driven kinds have nothing to enumerate and are skipped.
An unknown kind degrades to a functional text input bound to the same param
('text' is the canonical spelling), so a custom kind is never silently inert. #}
{% macro render_controls(panel, facets) -%}
{% for control in panel.controls %}
{% if control.kind == 'episode_slider' %}{% if facets and facets.max_episode >= 0 %}{% endif %}
{% elif control.kind == 'agent_select' %}{% if facets %}{% endif %}
{% elif control.kind == 'probe_select' %}{% if facets %}{% endif %}
{% elif control.kind == 'backend_select' %}{% if facets and facets.backends|length > 1 %}{% endif %}
{% elif control.kind == 'select' %}
{% else %}{# 'text' and unknown control kinds: degrade to a functional text input so a custom kind is never silently inert. #}
{% endif %}
{% endfor %}
{%- endmacro %}