{#- The /communities view: the persisted Louvain partition (written by `cairn communities`) with per-community member drill-down. One template, two render modes picked by the ``fragment`` context flag: the full page under base.html, or the #community-members region alone on the route's HX-Request branch — the Members links hx-get the same route and swap the region in place, and without htmx they navigate to the full page, which renders the region inline. Community rows are read rows-gated: a store without community rows renders the empty panel, never an error. -#} {% import "_links.html" as links with context %} {% import "_table.html" as tables with context %} {% macro members_region() -%}
{% if selected %}

{{ selected.label }}

{{ selected.size }} symbols, ranked by combined structural degree.

{% call tables.table(['Member', 'Path', 'Structural degree']) %} {% for m in selected.members %} {{ m.qualified_name }} {{ m.path }} {{ m.structural_degree }} {% endfor %} {% endcall %} {% elif community_id is not none %} {{ tables.empty_state('No community #' ~ community_id ~ ' in this store') }} {% else %}

Select a community to list its member symbols.

{% endif %}
{%- endmacro %} {% if fragment %} {{ members_region() }} {% else %} {% extends "base.html" %} {% block title %}Communities — Cairn Dashboard{% endblock %} {% block content %}

Communities

Louvain subsystems over the structural symbol graph — run cairn communities to (re)build this view.

{% if communities %} {% call tables.table(['Community', 'Size', 'Top hubs', 'Members']) %} {% for c in communities %} {{ c.label }} {{ c.size }} {%- for h in c.hubs -%} {{ h.qualified_name }}{% if not loop.last %}, {% endif %} {%- endfor -%} Members {% endfor %} {% endcall %} {% else %} {{ tables.empty_state('No communities persisted yet', "cairn communities") }} {% endif %} {{ members_region() }}
{% endblock %} {% endif %}