{% comment %} The rules list. Drag to reorder, with up/down buttons doing the same thing for anybody not using a pointer — both post to inbox:rule_reorder, so the two affordances cannot disagree about what happened. The drag handler lives in rule_settings.html's {% templatetag openblock %} block alpine_components {% templatetag closeblock %}, because this partial is re-fetched on every change and a script inside it would be re-evaluated each time. That handler moves these
  • elements directly, so the
  • must stay a direct child of [data-rule-list] and the hidden `rule` input must stay inside it — the form's hidden inputs ARE the order. Every string here comes from RuleSummary, which is assembled server-side from this workspace's own label, member and platform names — the stored condition json never reaches the page. An id that no longer resolves prints "(deleted)" rather than vanishing: a rule quietly describing itself as doing less than it does is how somebody ends up debugging automation that is not in front of them. Five equal buttons per row became two arrows, one named action and a "…". The arrows stay visible because they are the drag handle's keyboard twin, and hiding a keyboard path behind a menu is not the same trade as hiding a twice-a-year action. {% endcomment %}
    {% if rules %}
      {% for rule in rules %}
    1. {{ rule.name }} {% if not rule.enabled %}Disabled{% endif %}
        {% for clause in rule.conditions %}
      • {{ clause }}
      • {% endfor %} {% if not rule.conditions %}
      • No conditions
      • {% endif %}
        {% for action in rule.actions %}
      • {{ action }}
      • {% endfor %} {% if not rule.actions %}
      • No actions
      • {% endif %}
      {% comment %} The keyboard path. `formaction` is deliberately not used — these submit the same form to the same endpoint, and the JS reorders the hidden inputs before submitting, so a browser with no JS still posts the current order unchanged rather than a mangled one. {% endcomment %}
    2. {% endfor %}
    {% else %}

    No rules yet

    A rule reads an inbound message and files, assigns or closes the conversation it belongs to, before any flow replies.

    {% endif %}