From 75d22f618b22de6d26ed66bd9a15bf7a66e97af9 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 21 Aug 2026 13:13:23 +0200 Subject: feat(sender): paginate sent webmention details Load sent Webmentions with database-backed pagination instead of eagerly loading the full relationship for each source. Condense delivery, revision, and activity metadata in the source detail table and add pagination controls for large Webmention sets. --- webmentions_ssg/views.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'webmentions_ssg/views.py') diff --git a/webmentions_ssg/views.py b/webmentions_ssg/views.py index 2235735..543a44c 100644 --- a/webmentions_ssg/views.py +++ b/webmentions_ssg/views.py @@ -220,16 +220,19 @@ def sent_source(source_identifier: uuid.UUID) -> ResponseReturnValue: :return: Rendered source details page. """ source = db.session.scalar( - sa.select(Source) - .options(selectinload(Source.sent_webmentions)) - .where(Source.uuid == source_identifier) + sa.select(Source).where(Source.uuid == source_identifier) ) + if source is None: return abort(404) - webmentions = sorted( - source.sent_webmentions, key=lambda webmention: webmention.target + webmentions = db.paginate( + sa.select(SentWebmention) + .where(SentWebmention.source_id == source.uuid) + .order_by(SentWebmention.target, SentWebmention.uuid), + per_page=25, ) + return render_template( "sent_source.html", title="Sent Webmentions", -- cgit v1.3.1