From 1e48feb698a4d8cdfdb8e34dc17a272dade68390 Mon Sep 17 00:00:00 2001 From: Alex Hernandez Date: Mon, 2 Mar 2026 10:38:21 +1000 Subject: [PATCH] :bug: make sure hovering does not overwrite sidebar feedback --- src/renderer/components/Editor/MarkdownEditor.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/Editor/MarkdownEditor.tsx b/src/renderer/components/Editor/MarkdownEditor.tsx index 483f887..409b1f5 100644 --- a/src/renderer/components/Editor/MarkdownEditor.tsx +++ b/src/renderer/components/Editor/MarkdownEditor.tsx @@ -130,7 +130,6 @@ export function analyseAnnotation( const text = accumulated || ann.message const suggestion = extractBlockquote(text) ?? ann.suggestion ?? null tooltipAnalysisCache.set(ann.id, { text, suggestion }) - window.dispatchEvent(new CustomEvent('annotation-cached', { detail: { id: ann.id } })) onUpdate(text, false, suggestion) }).catch(() => { if (!cancelled) onUpdate(ann.message, false, ann.suggestion ?? null) @@ -138,7 +137,6 @@ export function analyseAnnotation( } else { const suggestion = ann.suggestion ?? null tooltipAnalysisCache.set(ann.id, { text: ann.message, suggestion }) - window.dispatchEvent(new CustomEvent('annotation-cached', { detail: { id: ann.id } })) onUpdate(ann.message, false, suggestion) } @@ -248,8 +246,11 @@ const annotationHoverTooltip = hoverTooltip( const cancelAnalysis = analyseAnnotation(ann, (text, streaming, suggestion) => { showText(text, streaming) - if (!streaming && suggestion && !dom.querySelector('.annotation-tooltip-apply')) { - showApplyButton(suggestion) + if (!streaming) { + window.dispatchEvent(new CustomEvent('annotation-cached', { detail: { id: ann.id } })) + if (suggestion && !dom.querySelector('.annotation-tooltip-apply')) { + showApplyButton(suggestion) + } } })