Add subscription editing, feed-level tags, and a remembered stream filter

Subscription editing was a real gap: there was no way to rename a feed's
display title, move it between folders, or create a folder at all outside
OPML import. Added an edit page (apps/feeds/views.py:edit_subscription,
EditSubscriptionForm) reachable from the subscriptions list.

Added feed-level tagging via a new SubscriptionTag model (apps/articles/
models.py), mirroring the existing ArticleTag — tag a whole feed on its
edit page, and every one of its articles surfaces under that tag in the
stream alongside individually-tagged articles (apps.reader.views._apply_
scope now matches either). Renamed AddTagToArticleForm to AddTagForm
since it's shared by both now.

The stream also now remembers the last filter (unread/all/starred/saved)
in the session instead of always defaulting to "unread" when a sidebar
feed/folder/tag link omits ?filter= — sidebar links no longer force
?filter=all, letting the remembered choice apply.

Verified end to end against a running dev server: editing a subscription's
title/folder, creating a folder inline, tagging a feed and seeing its
articles appear under that tag, and the remembered-filter behavior across
requests with no ?filter= param.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ksmithandClaude Sonnet 5 committed 2026-10-30 21:20:37 -06:00
1 parent cfa64b5485
commit 3b58fdcb7e
15 files changed
+376 -23

No files matched your search

+4 -4
View File
@@ -32,7 +32,7 @@
<ul class="sidebar-item-list">
{% for tag in sidebar_tags %}
<li>
<a href="{% url 'reader:stream' %}?filter=all&tag={{ tag.pk }}"
<a href="{% url 'reader:stream' %}?tag={{ tag.pk }}"
class="{% if request.GET.tag == tag.pk|stringformat:'s' %}active{% endif %}">{{ tag.name }}</a>
</li>
{% endfor %}
@@ -43,13 +43,13 @@
{% for entry in sidebar_folders %}
<details class="sidebar-section" open>
<summary>
<a href="{% url 'reader:stream' %}?filter=all&folder={{ entry.folder.pk }}"
<a href="{% url 'reader:stream' %}?folder={{ entry.folder.pk }}"
class="sidebar-folder-link{% if request.GET.folder == entry.folder.pk|stringformat:'s' %} active{% endif %}">{{ entry.folder.name }}</a>
</summary>
<ul class="sidebar-item-list">
{% for subscription in entry.subscriptions %}
<li>
<a href="{% url 'reader:stream' %}?filter=all&feed={{ subscription.feed_id }}"
<a href="{% url 'reader:stream' %}?feed={{ subscription.feed_id }}"
class="sidebar-feed-link{% if request.GET.feed == subscription.feed_id|stringformat:'s' %} active{% endif %}">
{% if subscription.feed.favicon_url %}<img src="{{ subscription.feed.favicon_url }}" alt="" class="feed-favicon">{% endif %}
<span>{{ subscription.display_title }}</span>
@@ -67,7 +67,7 @@
<ul class="sidebar-item-list">
{% for subscription in sidebar_unfoldered %}
<li>
<a href="{% url 'reader:stream' %}?filter=all&feed={{ subscription.feed_id }}"
<a href="{% url 'reader:stream' %}?feed={{ subscription.feed_id }}"
class="sidebar-feed-link{% if request.GET.feed == subscription.feed_id|stringformat:'s' %} active{% endif %}">
{% if subscription.feed.favicon_url %}<img src="{{ subscription.feed.favicon_url }}" alt="" class="feed-favicon">{% endif %}
<span>{{ subscription.display_title }}</span>
+26
View File
@@ -0,0 +1,26 @@
<div id="subscription-tags-{{ subscription.pk }}" class="article-tags">
{% for tag in tags %}
<span class="tag-pill" {% if tag.color %}style="--tag-color: {{ tag.color }};"{% endif %}>
{{ tag.name }}
<button
hx-post="{% url 'feeds:remove_tag_from_subscription' subscription.pk tag.pk %}"
hx-target="#subscription-tags-{{ subscription.pk }}"
hx-swap="outerHTML"
class="tag-remove" title="Remove tag">&times;</button>
</span>
{% endfor %}
<form
hx-post="{% url 'feeds:add_tag_to_subscription' subscription.pk %}"
hx-target="#subscription-tags-{{ subscription.pk }}"
hx-swap="outerHTML"
class="add-tag-form">
<input type="text" name="tag_name" placeholder="Add tag" list="subscription-user-tags-{{ subscription.pk }}" maxlength="100">
<button type="submit" class="icon-btn">Add</button>
</form>
<datalist id="subscription-user-tags-{{ subscription.pk }}">
{% for tag in all_user_tags %}
<option value="{{ tag.name }}">
{% endfor %}
</datalist>
</div>
+20
View File
@@ -0,0 +1,20 @@
{% extends "base.html" %}
{% block title %}Edit {{ subscription.display_title }} — Evection{% endblock %}
{% block content %}
<p><a href="{% url 'feeds:subscription_list' %}">&larr; Back to subscriptions</a></p>
<h1>Edit subscription</h1>
<p class="rule-summary">{{ subscription.feed.feed_url }}</p>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Save</button>
</form>
<h2>Tags</h2>
<div
id="subscription-tags-{{ subscription.pk }}"
hx-get="{% url 'feeds:subscription_tags_partial' subscription.pk %}"
hx-trigger="load"
hx-swap="outerHTML"></div>
{% endblock %}
+7 -4
View File
@@ -17,10 +17,13 @@
<strong>{{ subscription.display_title }}</strong>
{% if subscription.folder %}<span class="rule-summary">{{ subscription.folder.name }}</span>{% endif %}
</div>
<form method="post" action="{% url 'feeds:unsubscribe' subscription.pk %}" class="inline-form">
{% csrf_token %}
<button type="submit" class="icon-btn">Unsubscribe</button>
</form>
<div class="rule-actions">
<a href="{% url 'feeds:edit_subscription' subscription.pk %}" class="icon-btn">Edit</a>
<form method="post" action="{% url 'feeds:unsubscribe' subscription.pk %}" class="inline-form">
{% csrf_token %}
<button type="submit" class="icon-btn">Unsubscribe</button>
</form>
</div>
</li>
{% empty %}
<li class="empty-state">No subscriptions yet.</li>