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
This commit is contained in:
Gigi
2025-10-23 00:52:51 +02:00
parent 1729a5b066
commit c986b0d517
4 changed files with 19 additions and 1 deletions

View File

@@ -275,6 +275,9 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
if (settings?.syncReadingPosition === false) {
return
}
if (settings?.autoScrollToReadingPosition === false) {
return
}
if (!isTrackingEnabled) {
return
}
@@ -324,7 +327,7 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
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