Rebuild the reader UI to match FreshRSS's two-column layout

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
<script> crept back in anywhere (would silently break under the CSP added
in the previous commit) and the CSP header is still present on every page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ksmithandClaude Sonnet 5 committed 2026-10-30 21:11:17 -06:00
1 parent 4c20558525
commit cfa64b5485
18 files changed
+860 -159

No files matched your search

+19 -23
View File
@@ -1,32 +1,28 @@
{% extends "base.html" %}
{% block title %}Stream — Evection{% endblock %}
{% block content %}
<header class="stream-header">
<h1>Evection</h1>
<nav class="top-nav">
<a href="{% url 'feeds:subscription_list' %}">Subscriptions</a>
<a href="{% url 'articles:tag_list' %}">Tags</a>
<a href="{% url 'rules:rule_list' %}">Rules</a>
<a href="{% url 'search:search' %}">Search</a>
{% if user.is_staff %}<a href="{% url 'core:dashboard' %}">Dashboard</a>{% endif %}
<a href="{% url 'accounts:logout' %}">Log out</a>
</nav>
</header>
<div class="stream-toolbar">
<h1 class="stream-scope-title">
{% if active_feed %}{{ active_feed.title|default:active_feed.feed_url }}
{% elif active_folder %}{{ active_folder.name }}
{% elif active_tag %}{{ active_tag.name }}
{% else %}All articles{% endif %}
</h1>
<nav class="filter-tabs">
{% for key, label in filters %}
<a href="?filter={{ key }}" class="{% if active_filter == key and not active_tag %}active{% endif %}">{{ label }}</a>
{% endfor %}
</nav>
{% if user_tags %}
<nav class="tag-tabs">
{% for tag in user_tags %}
<a href="?filter={{ active_filter }}&tag={{ tag.pk }}" class="tag-pill{% if active_tag.pk == tag.pk %} active{% endif %}"
{% if tag.color %}style="--tag-color: {{ tag.color }};"{% endif %}>{{ tag.name }}</a>
<nav class="filter-tabs">
{% for key, label in filters %}
<a href="?filter={{ key }}{% if active_tag %}&tag={{ active_tag.pk }}{% endif %}{% if active_feed %}&feed={{ active_feed.pk }}{% endif %}{% if active_folder %}&folder={{ active_folder.pk }}{% endif %}"
class="{% if active_filter == key %}active{% endif %}">{{ label }}</a>
{% endfor %}
</nav>
{% endif %}
<form method="post"
action="{% url 'reader:mark_all_read' %}?filter={{ active_filter }}{% if active_tag %}&tag={{ active_tag.pk }}{% endif %}{% if active_feed %}&feed={{ active_feed.pk }}{% endif %}{% if active_folder %}&folder={{ active_folder.pk }}{% endif %}"
class="inline-form">
{% csrf_token %}
<button type="submit">Mark all as read</button>
</form>
</div>
{% include "reader/_article_list.html" %}
{% endblock %}