debug(reading-position): add logging to track isTextContent changes

Added detailed logging to understand why isTextContent is changing
and causing tracking to toggle on/off.
This commit is contained in:
Gigi
2025-10-23 00:42:29 +02:00
parent 039b988869
commit d0f043fb5a

View File

@@ -153,10 +153,20 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
// Reading position tracking - only for text content that's loaded and long enough
// Wait for content to load, check it's not a video, and verify it's long enough to track
const isTextContent = useMemo(() => {
const result = {
loading,
hasMarkdown: !!markdown,
hasHtml: !!html,
isVideo: selectedUrl?.includes('youtube') || selectedUrl?.includes('vimeo'),
longEnough: shouldTrackReadingProgress(html, markdown)
}
if (loading) return false
if (!markdown && !html) return false
if (selectedUrl?.includes('youtube') || selectedUrl?.includes('vimeo')) return false
if (!shouldTrackReadingProgress(html, markdown)) return false
console.log('[reading-position] 📊 isTextContent check:', result, '→', true)
return true
}, [loading, markdown, html, selectedUrl])