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

+28
View File
@@ -116,6 +116,34 @@ def test_user_cannot_toggle_state_on_another_users_article(client, alice, bob, a
assert not UserArticleState.objects.filter(article=alices_article).exists()
@pytest.mark.django_db
def test_stream_remembers_last_selected_filter(client, alice, alices_article):
UserArticleState.objects.create(user=alice, article=alices_article, is_starred=True)
client.login(username="alice", password="pw-alice-123")
response = client.get(reverse("reader:stream"), {"filter": "starred"})
assert response.context["active_filter"] == "starred"
# No ?filter= this time — e.g. a sidebar feed/tag link, or just "/" —
# should fall back to "starred" rather than resetting to "unread".
response = client.get(reverse("reader:stream"))
assert response.context["active_filter"] == "starred"
@pytest.mark.django_db
def test_tag_filter_includes_articles_from_a_tagged_feed(client, alice, alices_article):
from apps.articles.models import SubscriptionTag, Tag
from apps.feeds.models import Subscription
client.login(username="alice", password="pw-alice-123")
tag = Tag.objects.create(user=alice, name="backend")
subscription = Subscription.objects.get(user=alice, feed=alices_article.feed)
SubscriptionTag.objects.create(user=alice, subscription=subscription, tag=tag)
response = client.get(reverse("reader:stream"), {"filter": "all", "tag": tag.pk})
assert alices_article.title in response.content.decode()
@pytest.mark.django_db
def test_saved_filter_only_shows_saved_articles(client, alice, alices_article):
client.login(username="alice", password="pw-alice-123")