feat(reader): keep read items viewable while their feed stays listed - #128
Merged
Merged
Conversation
GitHub Notifications returns unread notifications only, so going back to a repository that was just marked read showed an empty feed even though it is still listed as recently visited. The reader now keeps the items it marked read in memory while their feed is among the recently visited ones, and adds them to reloads that lack them. Read state is still set on departure. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J7Sk49N296ejxiMDDfcnEp
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.
Requested by azu · project thread
Before: a GitHub repository marked read stayed in the feed list with
(0), but going back to it (aor a click) showed "No unread items in this feed.", because GitHub Notifications only returns unread notifications. Pressingmon a repository emptied the open view the same way.After: going back to a recently visited, read repository shows the notifications that were just marked read, styled as read. They stay viewable while the feed is listed as recently visited (the last 5 navigations) and are dropped from memory once it leaves the list. Marking read still happens when leaving a feed, as before.
How: the reader (not the GitHub source) remembers the items it marked read per feed in
ReaderModel.readItems.load()appends the ones a reload lacks,withReadItemsalso patches a reload that finished before the mark-read request, andopened()prunes entries for feeds that are no longer recently visited. Sources that return read items themselves (Inoreader) see no change because items are deduplicated by ID.RECENT_FEEDSmoved fromreader-view.tstoreader-model.tsso the list rule and the pruning share it.Tests: new unit tests in
reader-model.test.tsandreader.test.ts(an in-memory source option that drops read items, like GitHub); the GitHub Playwright tests now expect the read notifications afteraandm.vp check,vp test(179) andvp run test:e2e(35) pass locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01J7Sk49N296ejxiMDDfcnEp
Generated by Claude Code