mirror of
https://github.com/dergigi/boris.git
synced 2026-01-30 12:14:35 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user