From c986b0d51700a8b1c6e40e335cd466069722744a Mon Sep 17 00:00:00 2001 From: Gigi Date: Thu, 23 Oct 2025 00:52:51 +0200 Subject: [PATCH] feat: add setting to control auto-scroll to reading position - Added autoScrollToReadingPosition setting (enabled by default) - Users can now disable auto-scroll while keeping position sync enabled - Setting appears in Layout & Behavior section of settings - Auto-scroll only happens when both syncReadingPosition and autoScrollToReadingPosition are enabled --- src/components/ContentPanel.tsx | 5 ++++- src/components/Settings.tsx | 1 + src/components/Settings/LayoutBehaviorSettings.tsx | 13 +++++++++++++ src/services/settingsService.ts | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/ContentPanel.tsx b/src/components/ContentPanel.tsx index 88116437..94f1cd45 100644 --- a/src/components/ContentPanel.tsx +++ b/src/components/ContentPanel.tsx @@ -275,6 +275,9 @@ const ContentPanel: React.FC = ({ if (settings?.syncReadingPosition === false) { return } + if (settings?.autoScrollToReadingPosition === false) { + return + } if (!isTrackingEnabled) { return } @@ -324,7 +327,7 @@ const ContentPanel: React.FC = ({ behavior: 'smooth' }) }, 500) // Give content time to render - }, [isTextContent, activeAccount, articleIdentifier, settings?.syncReadingPosition, selectedUrl, isTrackingEnabled, restoreKey]) + }, [isTextContent, activeAccount, articleIdentifier, settings?.syncReadingPosition, settings?.autoScrollToReadingPosition, selectedUrl, isTrackingEnabled, restoreKey]) // Note: We intentionally do NOT save on unmount because: // 1. Browser may scroll to top during back navigation, causing 0% saves diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index f9e5dc0b..e7707e06 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -44,6 +44,7 @@ const DEFAULT_SETTINGS: UserSettings = { fullWidthImages: true, renderVideoLinksAsEmbeds: true, syncReadingPosition: true, + autoScrollToReadingPosition: true, autoMarkAsReadOnCompletion: false, hideBookmarksWithoutCreationDate: true, ttsUseSystemLanguage: false, diff --git a/src/components/Settings/LayoutBehaviorSettings.tsx b/src/components/Settings/LayoutBehaviorSettings.tsx index db2eb7a5..3ca61457 100644 --- a/src/components/Settings/LayoutBehaviorSettings.tsx +++ b/src/components/Settings/LayoutBehaviorSettings.tsx @@ -118,6 +118,19 @@ const LayoutBehaviorSettings: React.FC = ({ setting +
+ +
+