Everything is stored and server-rendered in UTC (config.settings.base's
TIME_ZONE), so article times, the article detail header, and the
dashboard's "last fetched" column were always showing UTC regardless of
where the viewer actually is.
Article/feed timestamps now render as <time datetime="..."> elements
carrying the UTC instant plus a UTC-formatted fallback as their initial
text; static/js/localize-times.js reformats them using the browser's
own timezone via toLocaleString(), both on page load and after every
htmx swap (pagination, the inline article expand, the dashboard's retry
action all inject new <time> elements without a full page load).
No server-side change needed — this doesn't touch the (currently
unused) per-user timezone field, and works correctly even if the
viewer travels or changes their system timezone, with no settings page
required. Verified live in the browser against a UTC-stored timestamp
rendering correctly shifted to the sandbox's local zone.
Known related issue, out of scope here: the stream's "Received
today/yesterday" date-group headers (apps.reader.views._group_by_date)
are still computed server-side via timezone.localdate(), which is also
effectively UTC — an article just before/after UTC midnight could land
in a date group that doesn't match its now-correctly-localized
time-of-day. Flagged for the user rather than fixed, since correcting
it properly would mean moving date-grouping to the client too.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>
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>
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>
script-src 'self' blocks any inline <script> block outright, which would
have silently broken the service-worker registration snippet in base.html
in production — the exact feature this whole project exists to support.
Moved it to static/js/register-sw.js, loaded via <script src>, so script-src
can stay strict with no 'unsafe-inline' exception. style-src needed
'unsafe-inline' regardless, since tag pills set a per-tag color via a
dynamic inline style attribute.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>