Commit Graph
16 Commits
Author SHA1 Message Date
ksmithandClaude Sonnet 5 e760eeda1d Show each tag's total unread count and remember collapsed sections
Closes gitea#24: the sidebar's per-feed unread counts were already
computed by sidebar() (apps.core.context_processors); each tag group's
total is now the sum of its own feeds' counts (a feed can carry more
than one tag, so this reuses the same per-feed data rather than a
second query) and renders next to the tag name like a feed's own
count.

Closes gitea#25: each sidebar <details> section (one per tag, plus
"Untagged") now carries a stable data-sidebar-key, and
static/js/sidebar-state.js remembers which ones are collapsed in
localStorage — this isn't a SPA, so every click re-renders the sidebar
server-side, and previously every section reset back to expanded on
the next page load. Per-browser, same pattern as theme.js/theme-init.js,
not synced across devices/accounts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 12:34:57 -06:00
ksmithandClaude Sonnet 5 c316f411f8 Make the active-tag sidebar highlight as visible as the active-feed one
.sidebar-tag-link.active only changed text color, which is easy to miss
next to .sidebar-feed-link.active's background pill + bold weight. Give
the tag link the same background-pill treatment (padding/margin offset
so the box doesn't shift layout when inactive).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 09:17:45 -06:00
ksmithandClaude Sonnet 5 20dd61e938 Add the logo to login/setup pages and raise light-mode contrast
The brand logo only appeared in the sidebar, so unauthenticated pages
(login, first-run setup, create-user) had no branding at all. Added an
.auth-brand block to base.html's shared unauthenticated shell so all
three get it automatically, and generalized the theme-swapped logo
show/hide rules (previously scoped to .sidebar-brand) so the same
.brand-wordmark-dark/.brand-wordmark-light classes work in both places —
safe to de-scope since neither .sidebar-brand img nor .auth-brand img
touches `display`, so there's no repeat of the earlier specificity bug.

Raised light-mode contrast across the board (WCAG contrast vs white,
computed): --text-dim 3.64:1 -> 5.80:1 (was failing AA for normal text —
this is the timestamp/feed-name color, used constantly), --star 3.65:1 ->
5.0:1, --border 1.25:1 -> 1.58:1 (still a hairline by design, just more
visible), and widened the --bg/--bg-sidebar/--bg-row-hover/--bg-row-
selected tiers, which were previously all within a few points of white
and made the whole theme look flat.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 22:03:13 -06:00
ksmithandClaude Sonnet 5 1a8ae95db0 Fix logout 405 — Django's LogoutView only accepts POST
The sidebar's "Log out" was a plain <a href> GET link. Django 5's
LogoutView stopped accepting GET (CSRF hardening — a bare link or even an
<img> tag could otherwise log someone out), so clicking it 405'd instead
of logging out. Changed it to a POST form, matching every other
state-changing action in the sidebar/app (unsubscribe, delete tag, etc.).

Extended .sidebar-top-nav's styling to cover a <button> the same as an
<a>, so the form-submit button looks identical to the other nav items.

No existing test exercised logout at all — added one for the POST case
and one confirming GET now correctly 405s, then verified end-to-end
against the running dev server (login, POST /logout/, confirm the session
is gone).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 22:01:06 -06:00
ksmithandClaude Sonnet 5 b08a78e747 Fix double-logo bug and size up the sidebar brand image
.sidebar-brand img { display: block } (0,1,1 specificity) was beating
.brand-wordmark-light { display: none } (0,1,0), so both the light and
dark logo variants rendered stacked regardless of theme. Scoped the
show/hide rules to .sidebar-brand .brand-wordmark-{dark,light} (0,2,0) so
they correctly win, and moved display:block onto the dark variant's own
rule instead of the generic img selector.

Also sized the logo up 50% (64px -> 96px) per feedback, and regenerated
the source PNGs at 400px tall (previously 160px) so they stay crisp at
the larger size instead of upscaling a smaller source.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 21:59:29 -06:00
ksmithandClaude Sonnet 5 4af7860acd Apply the real brand logo and add a light/dark theme toggle
Replaces the generic placeholder PWA icons and plain "Evection" text in
the sidebar with the actual logo kit (static/img/brand-full-{dark,light}
.png — the icon+wordmark lockup, swapped by theme via CSS). The PWA icon
set (icon-192, icon-512, maskable, apple-touch-icon) is regenerated from
the icon artwork: cropped to its content bounding box, padded to a square,
and flattened onto a solid brand-navy (#0f2038) background — maskable
specifically uses a tighter ~62% safe-zone scale so OS masking never clips
the art. manifest.webmanifest and the theme-color meta now use that same
navy instead of the old placeholder #111111.

Refined the light/dark CSS palette (static/css/base.css) using colors
sampled directly from the logo: brand navy for light-mode text, a blue
pulled from the orbit ring for --accent, amber for --star (already close
to brand, left mostly as-is). Dark mode shifted from a neutral charcoal
background toward the same navy family for consistency with the mark.

Added an explicit Light/Dark/System toggle in the sidebar footer, on top
of the existing prefers-color-scheme support rather than replacing it:
static/js/theme-init.js runs undeferred in <head> (before first paint, to
avoid a flash of the wrong theme) and applies any saved localStorage
choice via a data-theme attribute; static/js/theme.js (deferred) wires the
three buttons. CSS resolves theme in this priority: explicit
[data-theme] attribute, else prefers-color-scheme, else dark (the
unconditional :root default). Both scripts are external files/CSP-safe —
verified no inline <script> crept in and the CSP header is still present
under config.settings.prod.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 21:55:35 -06:00
ksmithandClaude Sonnet 5 0e132e9ab9 Remove folders; feeds are organized by tags now
Folders are gone — organization is tags-only, via the SubscriptionTag
model added last commit. A migration converts every existing Folder into
a same-named Tag applied to its feeds, and every folder-scoped FilterRule
into an equivalent tag-scoped one, before the Folder table is dropped, so
upgrading an existing instance loses nothing (verified by seeding the
pre-removal schema directly and running the migration chain against it).

Unlike folders, a feed can carry more than one tag, so:
- apps.articles.tasks.apply_filter_rules_for_feed and apps.rules.tasks's
  backlog re-apply now scope by "does this feed carry tag X" rather than
  "does this feed belong to folder X".
- apps.feeds.opml: a feed's tags export as a comma-separated "category"
  attribute (the standard OPML way to represent multiple categories)
  instead of nesting under one folder outline. Import reads both that
  attribute and nested category outlines, turning each enclosing level
  into its own tag rather than collapsing to the nearest one.
- The sidebar groups feeds by tag instead of folder, so a feed with two
  tags now appears in both groups; untagged feeds fall into "Untagged".

AddFeedForm gained a comma-separated tag_names field for parity with the
old add-time folder picker. EditSubscriptionForm dropped its folder
field entirely — tagging a subscription happens through the tag editor
already on that page.

Verified end to end: the migration chain from empty, the data migration
against a seeded pre-removal schema (folder/subscription/rule all convert
correctly), and the running app's sidebar grouping, OPML export category
attributes, and tag editor.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 21:30:06 -06:00
ksmithandClaude Sonnet 5 3b58fdcb7e 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>
2026-10-30 21:20:37 -06:00
ksmithandClaude Sonnet 5 cfa64b5485 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>
2026-10-30 21:11:17 -06:00
ksmithandClaude Sonnet 5 3f6474ce94 Add hardening and deployment: admin dashboard, security headers, install docs
Adds an admin-only dashboard (apps/core) surfacing feeds that are failing to
fetch, with error messages, subscriber counts, and a one-click retry that
resets backoff and re-queues the fetch.

Hardens config/settings/prod.py with the remaining standard Django security
settings (HSTS preload, nosniff, referrer-policy, frame-options, SameSite
cookies) plus a Content-Security-Policy header via django-csp, as a second
layer behind nh3's HTML sanitization of feed content.

Adds docs/install.md (pip + gunicorn + systemd + nginx, SQLite and Postgres
both covered) plus the systemd units and nginx snippet it references,
LICENSE (AGPL-3.0-or-later, matching pyproject.toml), and an updated README.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 20:10:31 -06:00
ksmithandClaude Sonnet 5 ea214dd9ce Add OPML import/export and a subscriptions management page
Implements OPML parsing with defusedxml (untrusted upload, XXE risk)
and export with the stdlib's plain ElementTree (trusted, app-generated
output). Nesting deeper than one level flattens into its nearest
enclosing folder, matching the app's flat-folder model. Import reuses
existing Feed/Subscription rows via get_or_create, so re-importing the
same file is idempotent and cross-user Feed dedup is preserved.

Large imports (>50 entries) dispatch to a Celery task instead of
blocking the request; newly imported feeds aren't fetched immediately
since they have no last_fetched_at, so the next poll_due_feeds beat
cycle picks them up naturally.

Adds a Subscriptions page (replacing the standalone "Add feed" link in
nav) listing current subscriptions with unsubscribe, plus Import/
Export OPML actions.

Verified live: imported a 2-feed/1-folder OPML file against the
running dev server (via an authenticated session, since this browser
tool has no file-picker automation), confirmed the resulting
subscriptions and folder in the UI, exported and inspected the
resulting OPML structure, and unsubscribed from one feed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 16:41:18 -06:00
ksmithandClaude Sonnet 5 8653dbeaf9 Add full-text search with per-backend SQLite/Postgres implementations
Implements the backend-agnostic search interface from the plan,
selected at runtime by connection.vendor:

- SQLite: an FTS5 virtual table (external-content, mirroring
  Article.title/content_html) created via a vendor-conditional
  migration, kept in sync by insert/update/delete triggers. Queries
  wrap the whole user input as a single FTS5 phrase so punctuation in
  a search box can't break MATCH syntax. `reindex_search` management
  command rebuilds it after bulk imports.
- Postgres: computes the search vector on the fly per the plan's
  decision (title weighted above content, no stored/indexed column)
  rather than diverging the schema from SQLite.

Both backends scope results to the requesting user's own subscriptions
and share the stream/detail article-row template and read/star/save
actions via a new apps.articles.queries.with_user_state() helper,
extracted from apps.reader.views to avoid duplicating that annotation
logic for search results.

Verified live: the SQLite path end-to-end in-browser against the real
Hacker News subscription (search UI, phrase matching, no-match case),
and the Postgres path against a throwaway Postgres container (search,
feed-scoping, and title-vs-content ranking), torn down afterward — not
part of this project's own infrastructure.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 16:37:22 -06:00
ksmithandClaude Sonnet 5 5ed0499845 Add the filter/rules engine
Implements FilterRule (one condition -> action, scoped to a feed and/or
folder or global) with an evaluation engine applied at ingest time:
after the fetch pipeline commits new/updated articles, each affected
subscriber's enabled rules run in priority order against them, with
tag/star/mark_read actions stacking and hide short-circuiting further
evaluation for that article.

Adds rule management (create/edit/delete) and a "Re-apply" action that
re-evaluates a user's full ruleset against their unread backlog, scoped
by the triggering rule's own feed/folder — so a newly added rule can
retroactively affect already-ingested articles, not just future ones.

Verified live in-browser: created a "title contains 'Show HN' -> star"
rule scoped to the subscribed Hacker News feed, re-applied it against
the existing unread backlog, and confirmed both matching articles were
starred.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 16:31:33 -06:00
ksmithandClaude Sonnet 5 579696efc0 Add tags and tag-based stream filtering
Implements tag management (create/delete) and per-article tagging with
a freeform "add tag" input that creates the tag on first use instead
of requiring a separate create-then-assign flow. Tags render as pills
in the stream header; clicking one filters the stream to articles
carrying that tag, combinable with the existing read/starred/saved
filters.

The "Saved" filter already added in the reading-UI milestone functions
as the reading list, so this closes out the reading-list/tags
milestone without a separate dedicated view.

Verified live in-browser: creating a tag from an article, the pill
appearing in the stream nav, filtering by it, and deleting it from the
tag-management page, all via htmx without full page reloads.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 16:26:30 -06:00
ksmithandClaude Sonnet 5 69e3520e3b Add the reading UI: stream, article detail, htmx actions
Implements the main reader surface: a filterable stream (Unread/All/
Starred/Saved) built on the lazy UserArticleState query pattern, an
article detail view that marks articles read on open, and htmx-backed
read/star/save-for-later toggles that update in place without a full
page reload. Rule-hidden articles are excluded from every filter.

Vendors htmx locally rather than loading it from a CDN, and adds
mobile-first responsive CSS (verified at 375px width in-browser, plus
dark mode via prefers-color-scheme).

Verified live against the real Hacker News feed subscribed in the
previous milestone: ingestion, filter switching, read/star/save
toggles, and article detail all confirmed working in the browser, with
two UI bugs fixed along the way (low-contrast message banners in dark
mode, horizontal overflow from long URLs in article content).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 16:08:44 -06:00
ksmithandClaude Sonnet 5 c635cd9330 Scaffold Django project and add first-run auth flow
Sets up the Evection project structure: split settings supporting both
SQLite and PostgreSQL via DATABASE_URL, Celery+Redis wiring, and the
planned app layout (accounts, feeds, articles, rules, search, reader,
pwa, core). Implements multi-user auth with a FreshRSS-style first-run
setup wizard, login/logout, and admin-only user management, covered by
automated tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 15:56:58 -06:00