diff --git a/ios/Platform/Platform/Features/Reader/Views/EntryListView.swift b/ios/Platform/Platform/Features/Reader/Views/EntryListView.swift index e1f0a40..ba3a8af 100644 --- a/ios/Platform/Platform/Features/Reader/Views/EntryListView.swift +++ b/ios/Platform/Platform/Features/Reader/Views/EntryListView.swift @@ -3,12 +3,11 @@ import SwiftUI struct EntryListView: View { @Bindable var vm: ReaderViewModel var isCardView: Bool = true - @State private var visibleEntryIDs: Set = [] - @State private var readByScrollIDs: Set = [] var body: some View { if vm.isLoading && vm.entries.isEmpty { LoadingView() + .frame(maxWidth: .infinity, maxHeight: .infinity) } else if vm.entries.isEmpty { EmptyStateView( icon: "newspaper", @@ -17,6 +16,7 @@ struct EntryListView: View { ? "Star articles to save them here" : "All caught up!" ) + .frame(maxWidth: .infinity, maxHeight: .infinity) } else { ScrollView { if isCardView { @@ -44,8 +44,6 @@ struct EntryListView: View { } .buttonStyle(.plain) .contentShape(Rectangle()) - .onAppear { visibleEntryIDs.insert(entry.id) } - .onDisappear { markReadIfScrolled(entry) } .contextMenu { entryContextMenu(entry: entry, vm: vm) } @@ -69,8 +67,6 @@ struct EntryListView: View { } .buttonStyle(.plain) .contentShape(Rectangle()) - .onAppear { visibleEntryIDs.insert(entry.id) } - .onDisappear { markReadIfScrolled(entry) } .contextMenu { entryContextMenu(entry: entry, vm: vm) } @@ -85,24 +81,6 @@ struct EntryListView: View { } } - // MARK: - Mark as read on scroll - - /// Only mark as read if the entry was visible before AND has scrolled off - /// while other entries are still visible (i.e. user is scrolling, not navigating away) - private func markReadIfScrolled(_ entry: ReaderEntry) { - // Remove from visible set - visibleEntryIDs.remove(entry.id) - - // If there are still visible entries, user is scrolling (not navigating) - // and this entry scrolled off → mark as read - guard !visibleEntryIDs.isEmpty else { return } - guard !entry.isRead else { return } - guard !readByScrollIDs.contains(entry.id) else { return } - - readByScrollIDs.insert(entry.id) - Task { await vm.markAsRead(entry) } - } - private var loadMoreTrigger: some View { Group { if vm.isLoadingMore {