From cfa64b54859c26baca9edcda5df1fc09ebc7b6c5 Mon Sep 17 00:00:00 2001 From: Keith Smith Date: Fri, 30 Oct 2026 21:11:17 -0600 Subject: [PATCH] Rebuild the reader UI to match FreshRSS's two-column layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous UI was plain unstyled lists. Rebuilt around what FreshRSS actually looks like (per reference screenshots): a persistent left sidebar (folders/feeds with unread counts, favourites, tags) and a single main column with a date-grouped article list, where clicking a title expands the full article inline in place rather than navigating to a separate page. - apps/core/context_processors.py: feeds the sidebar's folder/feed tree, tags, and starred count to every authenticated page in one shared query set, so base.html can render it without each view wiring it up. - apps/reader/views.py: date-grouped stream (itertools.groupby over the already-ordered queryset), ?feed=/?folder= scoping alongside the existing ?tag=, a bulk mark-all-read endpoint (bulk_create/update, not one UserArticleState per article), and article_inline — the htmx endpoint behind the inline expand, sharing its mark-read logic with the full article_detail view via _load_article_and_mark_read. - templates/reader/_article_inline.html returns the article content plus an out-of-band swap of _article_actions.html, so the row's read/star icons update immediately when an article is expanded and marked read. - static/js/stream.js: the accordion toggle (one article open at a time), calling htmx.ajax() directly rather than hx-* attributes so a second click on an already-open row can collapse it without re-fetching. - static/css/base.css: full FreshRSS-like dark theme (with a light variant under prefers-color-scheme) replacing the previous unstyled pass — sidebar, topbar search, row/icon states, inline-expand styling. Verified end to end against a running dev server: folder/feed/tag scoping, mark-all-read, the inline-expand mark-read side effect and its icon update, and — against config.settings.prod specifically — that no inline diff --git a/templates/core/_sidebar.html b/templates/core/_sidebar.html new file mode 100644 index 0000000..c7d932e --- /dev/null +++ b/templates/core/_sidebar.html @@ -0,0 +1,88 @@ + diff --git a/templates/reader/_article_actions.html b/templates/reader/_article_actions.html index 644d894..a969158 100644 --- a/templates/reader/_article_actions.html +++ b/templates/reader/_article_actions.html @@ -1,20 +1,26 @@ -
+
+ class="icon-btn icon-btn-read{% if not article.is_read %} is-unread{% endif %}" + title="{% if article.is_read %}Mark unread{% else %}Mark read{% endif %}"> + + + class="icon-btn icon-btn-star{% if article.is_starred %} active{% endif %}" + title="{% if article.is_starred %}Remove star{% else %}Star{% endif %}"> + + + class="icon-btn icon-btn-saved{% if article.is_saved_for_later %} active{% endif %}" + title="{% if article.is_saved_for_later %}Remove from saved{% else %}Save for later{% endif %}"> + +
diff --git a/templates/reader/_article_content.html b/templates/reader/_article_content.html new file mode 100644 index 0000000..62f55fa --- /dev/null +++ b/templates/reader/_article_content.html @@ -0,0 +1,19 @@ +
+

{{ article.title|default:"(untitled)" }}

+ + +
+
+ +
+ {{ article.content_html|safe }} +
diff --git a/templates/reader/_article_inline.html b/templates/reader/_article_inline.html new file mode 100644 index 0000000..8fac175 --- /dev/null +++ b/templates/reader/_article_inline.html @@ -0,0 +1,2 @@ +{% include "reader/_article_content.html" %} +{% include "reader/_article_actions.html" with oob=True %} diff --git a/templates/reader/_article_list.html b/templates/reader/_article_list.html index 954055c..be9f896 100644 --- a/templates/reader/_article_list.html +++ b/templates/reader/_article_list.html @@ -1,6 +1,9 @@