debug: add logs to show why reading position saves are skipped

- Log when scheduleSave returns early (syncEnabled false, no onSave callback)
- Log when position is too low (<5%)
- Log when change is not significant enough (<1%)
- Log ContentPanel sync status (enabled, settings, requirements)
- This will help diagnose why no events are being created
This commit is contained in:
Gigi
2025-10-19 11:41:38 +02:00
parent 205879f948
commit 3a10ac8691
2 changed files with 30 additions and 4 deletions

View File

@@ -199,11 +199,24 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
onReadingComplete: () => {
// Auto-mark as read when reading is complete (if enabled in settings)
if (activeAccount && !isMarkedAsRead && settings?.autoMarkAsReadOnCompletion) {
console.log('📖 [ContentPanel] Auto-marking as read on completion')
console.log('[progress] 📖 Auto-marking as read on completion')
handleMarkAsRead()
}
}
})
// Log sync status when it changes
useEffect(() => {
console.log('[progress] 📊 ContentPanel reading position sync status:', {
enabled: isTextContent,
syncEnabled: settings?.syncReadingPosition,
hasAccount: !!activeAccount,
hasRelayPool: !!relayPool,
hasEventStore: !!eventStore,
hasArticleIdentifier: !!articleIdentifier,
currentProgress: progressPercentage + '%'
})
}, [isTextContent, settings?.syncReadingPosition, activeAccount, relayPool, eventStore, articleIdentifier, progressPercentage])
// Load saved reading position when article loads
useEffect(() => {