From 55cdfc8fab6ddd1052593f8fd53dbb5bf730cc63 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 22 Aug 2026 01:13:30 +0000 Subject: Keep a just-read article visible (and Previous-reachable) until the next fetch The Unread/Older views are live Room Flow queries filtered on isRead = 0, so marking an article read (which only happens on Next/Previous, not on open) makes it vanish from the list the instant Room re-emits -- mid-scroll, or from underneath the reader's own Previous button, which re-queries this same flow to find its neighbors. Concretely: Next from C to D marks C read and prunes it from the live list; Previous from D then can't find C anymore, and jumps past it to whatever was unread before C. A misclick or the in-flight prune could cost you the article you meant to keep reading. Adds ArticleEntity.readAt (set whenever isRead flips true, cleared on explicit "mark unread"); observeUnread/observeOlderUnread now match "isRead = 0 OR readAt >= sinceFetch", where sinceFetch is Settings.lastFetchAt -- the same durable signal the new-articles snackbar already uses. A read article now lingers (shown dimmed via the existing showReadState styling) until the next real fetch actually completes, not the next DB write, and Previous/Next read from the same still-inclusive query so stepping back to what you just read finds it right where it was. --- app/src/main/java/org/terst/feedreader/data/Entities.kt | 1 + 1 file changed, 1 insertion(+) (limited to 'app/src/main/java/org/terst/feedreader/data/Entities.kt') diff --git a/app/src/main/java/org/terst/feedreader/data/Entities.kt b/app/src/main/java/org/terst/feedreader/data/Entities.kt index 5f6a28c..58c9f79 100644 --- a/app/src/main/java/org/terst/feedreader/data/Entities.kt +++ b/app/src/main/java/org/terst/feedreader/data/Entities.kt @@ -31,6 +31,7 @@ data class ArticleEntity( val extractedContent: String? = null, // Readability-extracted full text, filled in on first read if feedContentHtml was thin val imageUrl: String? = null, // thumbnail, from media:thumbnail/enclosure or the first in the feed content -- see FeedParser val isRead: Boolean = false, + val readAt: Long? = null, // when isRead flipped true; null while unread or after an explicit "mark unread". Lets a just-read article linger in the Unread view until the next fetch instead of vanishing the instant it's read -- see observeUnread/observeOlderUnread. val isSaved: Boolean = false, // explicitly kept (independent of read state) -- triggers a Stash save val stashArtifactId: String? = null, // set once successfully archived to Stash; null means not yet saved or save failed val createdAt: Long -- cgit v1.2.3