From e2e5d5919705a8e1228d42c18301dfbd4edfda62 Mon Sep 17 00:00:00 2001 From: Gigi Date: Sat, 4 Oct 2025 21:52:22 +0100 Subject: [PATCH] debug: add detailed logging to highlight application useEffect - Log when useEffect is triggered - Log contentRef status, relevant highlights count, and html presence - Log specific reason when skipping highlight application - This will help identify why highlights aren't being applied to DOM --- src/components/ContentPanel.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/ContentPanel.tsx b/src/components/ContentPanel.tsx index f6295a92..71e611c0 100644 --- a/src/components/ContentPanel.tsx +++ b/src/components/ContentPanel.tsx @@ -85,7 +85,18 @@ const ContentPanel: React.FC = ({ // Apply highlights after DOM is rendered useEffect(() => { - if (!contentRef.current || relevantHighlights.length === 0) return + console.log('🔍 useEffect triggered:', { + hasContentRef: !!contentRef.current, + relevantHighlightsCount: relevantHighlights.length, + hasHtml: !!html + }) + + if (!contentRef.current || relevantHighlights.length === 0) { + console.log('⚠️ Skipping highlight application:', { + reason: !contentRef.current ? 'no contentRef' : 'no relevant highlights' + }) + return + } console.log('🔍 Applying highlights to rendered DOM:', { highlightsCount: relevantHighlights.length,