🐛 make sure hovering does not overwrite sidebar feedback
This commit is contained in:
@@ -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,9 +246,12 @@ const annotationHoverTooltip = hoverTooltip(
|
||||
|
||||
const cancelAnalysis = analyseAnnotation(ann, (text, streaming, suggestion) => {
|
||||
showText(text, streaming)
|
||||
if (!streaming && suggestion && !dom.querySelector('.annotation-tooltip-apply')) {
|
||||
if (!streaming) {
|
||||
window.dispatchEvent(new CustomEvent('annotation-cached', { detail: { id: ann.id } }))
|
||||
if (suggestion && !dom.querySelector('.annotation-tooltip-apply')) {
|
||||
showApplyButton(suggestion)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return { dom, destroy() { cancelAnalysis() } }
|
||||
|
||||
Reference in New Issue
Block a user