🐛 tooltip hovering
This commit is contained in:
@@ -173,6 +173,7 @@
|
||||
}
|
||||
|
||||
.annotation-tooltip {
|
||||
position: relative;
|
||||
background: var(--message-bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
@@ -184,6 +185,20 @@
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
/* Invisible bridge that extends CodeMirror's isInTooltip() hit-area into the
|
||||
gap between the card and the annotation text, preventing the card from
|
||||
dismissing while the mouse travels between them. */
|
||||
.annotation-tooltip > .cm-tooltip-arrow {
|
||||
position: absolute;
|
||||
bottom: -12px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 12px;
|
||||
pointer-events: none;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.annotation-tooltip-divider {
|
||||
height: 1px;
|
||||
background: var(--border);
|
||||
|
||||
@@ -209,7 +209,8 @@ const annotationHoverTooltip = hoverTooltip(
|
||||
// User comments: show static tooltip with the comment text — no AI streaming
|
||||
if (ann.type === 'user_comment') {
|
||||
return {
|
||||
pos,
|
||||
pos: ann.from,
|
||||
end: ann.to,
|
||||
above: true,
|
||||
create() {
|
||||
const dom = document.createElement('div')
|
||||
@@ -234,13 +235,17 @@ const annotationHoverTooltip = hoverTooltip(
|
||||
body.className = 'annotation-tooltip-body'
|
||||
body.textContent = ann.comment ?? ann.message
|
||||
dom.appendChild(body)
|
||||
const bridge = document.createElement('div')
|
||||
bridge.className = 'cm-tooltip-arrow'
|
||||
dom.appendChild(bridge)
|
||||
return { dom, destroy() {} }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
pos,
|
||||
pos: ann.from,
|
||||
end: ann.to,
|
||||
above: true,
|
||||
create() {
|
||||
const dom = document.createElement('div')
|
||||
@@ -302,6 +307,10 @@ const annotationHoverTooltip = hoverTooltip(
|
||||
}
|
||||
})
|
||||
|
||||
const bridge = document.createElement('div')
|
||||
bridge.className = 'cm-tooltip-arrow'
|
||||
dom.appendChild(bridge)
|
||||
|
||||
return { dom, destroy() { cancelAnalysis() } }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user