Add new-stories indicator pill for live story arrivals#2104
Open
samuelclay wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Floating "N new stories" pill appears while reading a feed or folder when new stories arrive on the 1-minute refresh poll. Clicking prepends the stories into the collection without disturbing infinite-scroll pagination. - Backend: UserSubscription.peek_new_story_hashes reads the top N ranked-story hashes from Redis (zF:, zU:, or river keys) without mutating the paging cache, then returns the diff against hashes the client already has. Wired through refresh_feeds so we don't need a second timer. - Frontend: NewStoriesIndicatorView renders a fixed-position pill above the story titles pane; reader.js builds the peek params based on the active view (skipped for starred/briefing/search/oldest-first) and prepends new stories via stories.prepend_new_stories + story_titles_view prepend path. Uses /reader/river_stories with h[] to rehydrate specific hashes. - Tests: peek_new_story_hashes returns unseen hashes in server order, handles missing cache, and never touches delete/zadd/expire on the paging keys. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UserSubscription.peek_new_story_hashes, which reads the top N ranked-story hashes from Redis (zF:,zU:, or river keys) without mutating the paging cache, then returns the diff against hashes the client already has. Piggybacks onrefresh_feedsto avoid a second timer.NewStoriesIndicatorView,stories.prepend_new_stories, and a prepend path instory_titles_view. Peek is skipped for starred/briefing/search/oldest-first views. Story bodies are rehydrated via/reader/river_storieswithh[].Test plan
docker exec -t newsblur_web_new-stories-indicator python manage.py test apps.reader.tests.Test_PeekNewStoryHashesGenerated with Claude Code