From 7a519313869e9e6c4034cec41d5c616b832ee84a Mon Sep 17 00:00:00 2001 From: haopengzhan Date: Mon, 24 Aug 2026 21:25:32 -0700 Subject: [PATCH] feat: add viewer preference for auto-marking articles as read and implement click/scroll-based read detection logic --- web/src/App.tsx | 12 +++- web/src/components/SettingsView.tsx | 63 ++++++++++++++++++++- web/src/components/ThreePaneView.tsx | 85 ++++++++++++---------------- web/src/components/WaterfallView.tsx | 74 ++---------------------- 4 files changed, 112 insertions(+), 122 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index 283c771..11200a6 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -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(() => { diff --git a/web/src/components/SettingsView.tsx b/web/src/components/SettingsView.tsx index d7744f1..3734253 100644 --- a/web/src/components/SettingsView.tsx +++ b/web/src/components/SettingsView.tsx @@ -19,6 +19,7 @@ import { X, Clock, Timer, + Eye, } from 'lucide-react'; interface SettingsViewProps { @@ -38,7 +39,10 @@ export const SettingsView: React.FC = ({ onRefreshData, onOpenAddFeed, }) => { - const [activeTab, setActiveTab] = useState<'feeds' | 'categories' | 'opml' | 'account'>('feeds'); + const [activeTab, setActiveTab] = useState<'feeds' | 'categories' | 'viewer' | 'opml' | 'account'>('feeds'); + const [autoReadBottom, setAutoReadBottom] = useState(() => { + return localStorage.getItem('rsspipe_auto_read_bottom') !== 'false'; + }); const [feedSearch, setFeedSearch] = useState(''); const [newCatTitle, setNewCatTitle] = useState(''); const [loading, setLoading] = useState(false); @@ -191,6 +195,14 @@ export const SettingsView: React.FC = ({ Categories ({categories.length}) + +