From 06b8509d8a4dc913d017d63d9ace6037343ce09e Mon Sep 17 00:00:00 2001 From: Ricardo Date: Fri, 20 Feb 2026 10:29:04 +0100 Subject: [PATCH] fix: refollow UI - progress bar, pause button, status endpoint Three issues fixed: 1. Progress bar invisible: used --color-accent (doesn't exist in Indiekit theme). Changed to --color-primary. 2. Pause/resume buttons non-functional: the /admin/refollow/status GET endpoint was intercepted by Fedify middleware (content negotiation routes) returning 404 before Express saw it. Added /admin path skip to content negotiation middleware. Also made buttons toggle dynamically via Alpine.js x-show instead of server-rendered {% if %}. 3. Status badge static: replaced Nunjucks badge macro with Alpine.js x-text bound to a computed statusLabel property. --- index.js | 2 ++ package.json | 2 +- views/activitypub-dashboard.njk | 53 +++++++++++++++++++-------------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/index.js b/index.js index 0e2fb19..c9c3c12 100644 --- a/index.js +++ b/index.js @@ -166,6 +166,8 @@ export default class ActivityPubEndpoint { router.use((req, res, next) => { if (!self._fedifyMiddleware) return next(); if (req.method !== "GET" && req.method !== "HEAD") return next(); + // Skip Fedify for admin routes — handled by authenticated router + if (req.path.startsWith("/admin")) return next(); return self._fedifyMiddleware(req, res, next); }); diff --git a/package.json b/package.json index edf9803..e94cd39 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "1.0.17", + "version": "1.0.18", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit", diff --git a/views/activitypub-dashboard.njk b/views/activitypub-dashboard.njk index 2554b47..6c12d4a 100644 --- a/views/activitypub-dashboard.njk +++ b/views/activitypub-dashboard.njk @@ -39,8 +39,8 @@ {# Progress bar #}
+ x-bind:style="'width:' + progress + '%; height: 100%; transition: width 0.5s ease; background: var(--color-primary);'" + style="width: {{ refollowStatus.progressPercent }}%; height: 100%; transition: width 0.5s ease; background: var(--color-primary);">
@@ -48,39 +48,42 @@
{{ refollowStatus.remaining }}
-
{{ __("activitypub.refollow.remaining") }}
+
{{ __("activitypub.refollow.remaining") }}
{{ refollowStatus.sent }}
-
{{ __("activitypub.refollow.awaitingAccept") }}
+
{{ __("activitypub.refollow.awaitingAccept") }}
{{ refollowStatus.federated }}
-
{{ __("activitypub.refollow.accepted") }}
+
{{ __("activitypub.refollow.accepted") }}
{{ refollowStatus.failed }}
-
{{ __("activitypub.refollow.failed") }}
+
{{ __("activitypub.refollow.failed") }}
{# Status + controls #}
- {{ badge({ text: __("activitypub.refollow.status." + refollowStatus.status) }) }} - {% if refollowStatus.status === "running" %} -
- -
- {% elif refollowStatus.status === "paused" %} -
- -
- {% endif %} + {{ __("activitypub.refollow.status." + refollowStatus.status) }} +
+ +
+
+ +