fix: mark as read when entry scrolls OFF screen, not on appear
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s

Uses .onDisappear instead of .onAppear — entries are marked as read
only when they scroll past the top of the viewport, not when the
list first renders. Same behavior as proper RSS readers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-03 20:19:06 -05:00
parent 8cc58c23a0
commit da44ee8b73

View File

@@ -42,6 +42,12 @@ struct EntryListView: View {
} }
.buttonStyle(.plain) .buttonStyle(.plain)
.contentShape(Rectangle()) .contentShape(Rectangle())
.onDisappear {
// Mark as read when card scrolls off the top
if !entry.isRead {
Task { await vm.markAsRead(entry) }
}
}
.contextMenu { .contextMenu {
entryContextMenu(entry: entry, vm: vm) entryContextMenu(entry: entry, vm: vm)
} }
@@ -65,7 +71,7 @@ struct EntryListView: View {
} }
.buttonStyle(.plain) .buttonStyle(.plain)
.contentShape(Rectangle()) .contentShape(Rectangle())
.onAppear { .onDisappear {
if !entry.isRead { if !entry.isRead {
Task { await vm.markAsRead(entry) } Task { await vm.markAsRead(entry) }
} }