{#- The card shows only what is needed at a glance; the task dialog has everything else. -#}
{{ t.key }}
{% if t.tracker_ref or t.tracker_logged or (require_tracker_log and t.stage.value == "done") %}{% include "_tracker.html" %}{% endif %}
{% if t.session_link %}
{%- set status_text = (" (" ~ t.session_status ~ ")") if t.session_status else "" %}
{% if t.session_status %}{% endif %}
{% endif %}
{#- Shown only in compact mode; app.js keeps its state per browser, the server never knows. #}
{#- The keyboard and phone way of what a drag does (board.js); a stage move lands on top. #}
{% for s in stages if s != t.stage %}{% endfor %}
{% if t.stage.value == "done" %}{% if task_archived(t) %}{% else %}{% endif %}{% endif %}
{#- Who, not what: agents often append the step after a colon; the title keeps the full text. #}
{% if t.waiting_on and is_open %}waiting on {{ t.waiting_on.split(":", 1)[0].strip() or t.waiting_on }}{% endif %}
{% if t.branch %}{{ t.branch }}{% endif %}
{% endif %}
{%- set c = code.get(t.id) if code else None %}
{% if c and c.shown %}
{% with branch = None %}{% include "_code_row.html" %}{% endwith %}{{ c.summary }}
{% endif %}
{% if t.next_step and is_open %}
Next: {{ t.next_step }}{% if t.next_step_stale %} stale{% endif %}