From 02049c37a8ea1938db5edcd8a80405d93b94d75a Mon Sep 17 00:00:00 2001 From: Christian Nennemann Date: Sat, 7 Mar 2026 21:23:13 +0100 Subject: [PATCH] Show related drafts in author cluster cards Each cluster card now shows draft count badge and up to 5 linked draft titles with clickable links to draft detail pages. Data collected from member nodes' draft lists during cluster detection. Co-Authored-By: Claude Opus 4.6 --- src/webui/data.py | 7 +++++++ src/webui/templates/authors.html | 19 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/webui/data.py b/src/webui/data.py index 915bd9a..3f04572 100644 --- a/src/webui/data.py +++ b/src/webui/data.py @@ -572,15 +572,22 @@ def get_author_network_full(db: Database) -> dict: if len(component) >= 2: org_mix: dict[str, int] = Counter() + cluster_drafts: dict[str, str] = {} # name -> title for m in component: org = author_info.get(m, {}).get("org", "") if org: org_mix[org] += 1 + for dn in author_info.get(m, {}).get("drafts", []): + if dn not in cluster_drafts: + d = db.get_draft(dn) + cluster_drafts[dn] = d.title[:80] if d else dn clusters.append({ "id": len(clusters), "members": component, "org_mix": dict(org_mix.most_common()), "size": len(component), + "drafts": [{"name": n, "title": t} for n, t in list(cluster_drafts.items())[:15]], + "draft_count": len(cluster_drafts), }) clusters.sort(key=lambda c: c["size"], reverse=True) diff --git a/src/webui/templates/authors.html b/src/webui/templates/authors.html index 6adfef2..d7d7063 100644 --- a/src/webui/templates/authors.html +++ b/src/webui/templates/authors.html @@ -118,16 +118,31 @@
Cluster #{{ c.id + 1 }} - {{ c.size }} authors +
+ {{ c.size }} authors + {{ c.draft_count }} drafts +
{% for org, count in c.org_mix.items() %} {{ org }} ({{ count }}) {% endfor %}
-
+
{{ c.members[:5] | join(', ') }}{% if c.members | length > 5 %} +{{ c.members | length - 5 }} more{% endif %}
+ {% if c.drafts %} +
+ {% for d in c.drafts[:5] %} + + {% endfor %} + {% if c.draft_count > 5 %} +
+{{ c.draft_count - 5 }} more drafts
+ {% endif %} +
+ {% endif %}
{% endfor %}