🐛 make sure hovering does not overwrite sidebar feedback

This commit is contained in:
2026-03-02 10:38:21 +10:00
parent cc091d06ab
commit 1e48feb698

View File

@@ -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)
}
}
})