Private
Public Access
Mark the browser tab with a red dot when new articles arrive (#31)
The in-page "new articles" banner is invisible from a background tab. Every authenticated page now polls a small JSON endpoint (reader:new_since, every 30s) and redraws the tab's favicon with a red dot when unread, non-hidden articles from the user's feeds have appeared since the page loaded. A reload (which is what clicking the banner does) resets the baseline and the icon. The endpoint is deliberately not scoped to the stream's current filter/tag/feed, so the tab lights up for anything new whichever page is open. Scope is the dot only: no desktop notifications, per the request. Verified in a dev server enforcing the production CSP: the icon swapped to the dotted version after a new article arrived and reset on reload. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fd494a9c08
commit
0975a7634b
5 files changed
+162
-1
No files matched your search
@@ -58,6 +58,7 @@
|
||||
{% if user.is_authenticated %}
|
||||
<script src="{% static 'js/theme.js' %}" defer></script>
|
||||
<script src="{% static 'js/sidebar-state.js' %}" defer></script>
|
||||
<script src="{% static 'js/tab-badge.js' %}" data-url="{% url 'reader:new_since' %}" defer></script>
|
||||
{% endif %}
|
||||
<script src="{% static 'js/register-sw.js' %}" defer></script>
|
||||
</body>
|
||||
|
||||
Reference in new issue
Block a user