Mark articles read on scroll every time. Fixes bug where undo marked as unread, and we scrolled past again.

This commit is contained in:
Brent Simmons committed 2026-12-05 10:42:00 -08:00
1 parent 2f9fdd08b7
commit 0187681bb8
2 files changed
+2 -10

No files matched your search

@@ -37,8 +37,6 @@ final class MainTimelineViewController: UIViewController, UndoableCommandRunner
}
/// Rows under the navigation bar or above it at the last check. Rows past this count are newly scrolled past.
private var rowCountScrolledPast = 0
/// An article is marked read on scroll only once, so one the user marks unread again stays unread.
private var articlesMarkedReadOnScroll = Set<ArticleSpecifier>()
private var articlesPendingMarkReadOnScroll = [Article]()
/// Shown in the footer after the last row. Nil hides the footer’s button.
private var nextSidebarItemWithUnreadArticles: SidebarItem?
@@ -366,9 +364,6 @@ final class MainTimelineViewController: UIViewController, UndoableCommandRunner
guard isViewLoaded else {
return
}
if resetScroll {
articlesMarkedReadOnScroll.removeAll()
}
resetUI(resetScroll: resetScroll)
restoreSelectionIfNecessary(adjustScroll: false)
updateNextUnreadFooter()
@@ -1222,7 +1217,7 @@ private extension MainTimelineViewController {
guard let article = dataSource.itemIdentifier(for: IndexPath(item: item, section: 0)), !article.status.read else {
continue
}
if articlesMarkedReadOnScroll.insert(ArticleSpecifier(article: article)).inserted {
if !articlesPendingMarkReadOnScroll.contains(article) {
articlesPendingMarkReadOnScroll.append(article)
}
}