From 895cc6ddfaf4757a251506e5a81142fb5c9acfed Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 5 Jun 2026 23:43:45 +0100 Subject: [PATCH] Split RSS bots into their own category MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New RSS_TYPES category with a /rss-bots page, sidebar entry, homepage tile, and an explanation that RSS bots post a feed to a channel — share the channel link, not the user. Remove rss from the Bots page (types table + create dropdown); the RSS Bots page has a '+ New RSS Bot' button that only creates rss bots, with feed URL + per hour/day/week fields shown directly (no bot-type select). Co-Authored-By: Claude Opus 4.8 --- manager/main.py | 15 +++++++++- manager/profiles.py | 5 ++-- manager/templates/base.html | 1 + manager/templates/home.html | 4 +++ manager/templates/list.html | 57 ++++++++++++++++++++----------------- 5 files changed, 53 insertions(+), 29 deletions(-) diff --git a/manager/main.py b/manager/main.py index 0fdf084..acb7678 100644 --- a/manager/main.py +++ b/manager/main.py @@ -71,9 +71,11 @@ def _enrich(profiles: list[dict]) -> list[dict]: def _category(bot_type: str) -> str: - """Which sidebar category a profile belongs to: users / businesses / bots.""" + """Which sidebar category a profile belongs to: users / businesses / rss-bots / bots.""" if bot_type in pm.BUSINESS_TYPES: return "businesses" + if bot_type in pm.RSS_TYPES: + return "rss-bots" if bot_type in pm.USER_TYPES: return "users" return "bots" @@ -144,6 +146,17 @@ async def bots_page(request: Request): }) +@app.get("/rss-bots", response_class=HTMLResponse) +async def rss_bots_page(request: Request): + if redir := _redirect_if_unauth(request): + return redir + items = _enrich([p for p in db.list_profiles() if p["bot_type"] in pm.RSS_TYPES]) + return TEMPLATES.TemplateResponse(request, "list.html", { + "tab": "rss-bots", "items": items, "create_types": pm.RSS_TYPES, + "nav_active": "rss-bots", + }) + + RELAY_KINDS = {"chat": "Chat Relay", "file": "File Relay", "message": "Message Relay"} diff --git a/manager/profiles.py b/manager/profiles.py index b6ab083..84a9b9c 100644 --- a/manager/profiles.py +++ b/manager/profiles.py @@ -139,10 +139,11 @@ def group_member_count(g: dict) -> int: return g.get("groupSummary", {}).get("currentMembers", 0) -BOT_TYPES = ["echo", "llm", "rss", "crypto", "broadcast", "support", "directory", "deadmans"] +BOT_TYPES = ["echo", "llm", "crypto", "broadcast", "support", "directory", "deadmans"] USER_TYPES = ["user"] BUSINESS_TYPES = ["business"] # cli accounts with a business address (per-customer group chats) -ALL_TYPES = BOT_TYPES + USER_TYPES + BUSINESS_TYPES +RSS_TYPES = ["rss"] # feed bots that post to a channel (their own category) +ALL_TYPES = BOT_TYPES + USER_TYPES + BUSINESS_TYPES + RSS_TYPES @dataclass diff --git a/manager/templates/base.html b/manager/templates/base.html index 607b2ae..76f4d66 100644 --- a/manager/templates/base.html +++ b/manager/templates/base.html @@ -311,6 +311,7 @@ Users Bots + RSS Bots Business Groups File Upload diff --git a/manager/templates/home.html b/manager/templates/home.html index b3c41c3..93fd514 100644 --- a/manager/templates/home.html +++ b/manager/templates/home.html @@ -40,6 +40,10 @@ Bots + + + RSS Bots + Business Groups diff --git a/manager/templates/list.html b/manager/templates/list.html index d8f6f89..b574e07 100644 --- a/manager/templates/list.html +++ b/manager/templates/list.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% import "_macros.html" as ui %} -{% block title %}{{ 'Business Groups' if tab == 'businesses' else tab | title }} — SimpleX Manager{% endblock %} +{% block title %}{{ 'Business Groups' if tab == 'businesses' else ('RSS Bots' if tab == 'rss-bots' else tab | title) }} — SimpleX Manager{% endblock %} {% block head %}