feat: add viewer preference for auto-marking articles as read and implement click/scroll-based read detection logic

This commit is contained in:
2026-08-24 21:25:32 -07:00
parent 3742dbdce4
commit 7a51931386
4 changed files with 112 additions and 122 deletions
+10 -2
View File
@@ -121,11 +121,19 @@ export const App: React.FC = () => {
search: filter.search,
limit: 100,
});
setEntries(res.entries);
setEntries((prev) => {
if (filter.view === 'inbox' && selectedEntryId) {
const currentActive = prev.find((e) => e.id === selectedEntryId);
if (currentActive && !res.entries.some((e) => e.id === selectedEntryId)) {
return [currentActive, ...res.entries];
}
}
return res.entries;
});
} catch (err) {
console.error('Failed to load entries:', err);
}
}, [currentUser, filter]);
}, [currentUser, filter, selectedEntryId]);
// Initial load
useEffect(() => {