From efd909761da7899fde89bf6b6a99a49d90c928df Mon Sep 17 00:00:00 2001 From: ThreeFish Date: Sat, 4 Jul 2026 22:28:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(Graph):=20CI=20=E4=B8=8E=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E8=AF=A6=E6=83=85=20Tooltip=20=E5=AE=9A=E4=BD=8D=E6=9B=B4?= =?UTF-8?q?=E8=B4=B4=E8=BF=91=E5=85=89=E6=A0=87=EF=BC=88gap=2014=E2=86=928?= =?UTF-8?q?=20+=20=E7=BA=B5=E5=90=91=E7=BF=BB=E8=BD=AC=E9=92=B3=E5=88=B6?= =?UTF-8?q?=EF=BC=89;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户反馈 CI 状态详情浮层离鼠标偏远。核实:CI hover 已走 positionAtCursor(跟随光标), 但 CI 图标恒在行最右、光标 X 贴侧栏右沿,横向翻转 + gap=14 使浮层与光标间距偏大,观感不够「贴」。 修复(CI 与提交浮层共用 positionAtCursor,一并受益): - gap 14→8:浮层紧贴光标(右沿/底边距光标仅 8px)。 - 纵向翻转补 Math.max(pad, …) 钳制,避免上翻越出视口顶部。 - 横向沿用「右侧优先、越界翻左(右沿贴光标)」,窄侧栏下浮层右上角紧邻光标。 验证:check-types/lint/生产打包/349 单测通过;Chrome headless 截图确认 CI 浮层右上角紧贴 CI 图标 (光标)左下方,较 gap=14 明显更近。 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang --- src/adapter/webview/log-webview.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adapter/webview/log-webview.ts b/src/adapter/webview/log-webview.ts index fe18f17..31fe8d3 100644 --- a/src/adapter/webview/log-webview.ts +++ b/src/adapter/webview/log-webview.ts @@ -920,14 +920,14 @@ document.addEventListener('mousemove', function (e) { cursorX = e.clientX; curso function positionAtCursor(el) { el.style.display = 'flex'; const w = el.offsetWidth, h = el.offsetHeight; - const vw = window.innerWidth, vh = window.innerHeight, pad = 6, gap = 14; - // 横向:默认在光标右侧;越右沿翻到左侧;仍越界则收进视口。 + const vw = window.innerWidth, vh = window.innerHeight, pad = 6, gap = 8; + // 横向:默认贴光标右侧;越右沿则翻到光标左侧(右沿紧邻光标);仍越界收进视口。 let left = cursorX + gap; if (left + w > vw - pad) left = cursorX - gap - w; if (left < pad) left = Math.max(pad, vw - pad - w); - // 纵向:默认在光标下方;越下沿翻到上方;钳制视口。 + // 纵向:默认贴光标下方;越下沿则翻到光标上方(底边紧邻光标);钳制视口。 let top = cursorY + gap; - if (top + h > vh - pad) top = cursorY - gap - h; + if (top + h > vh - pad) top = Math.max(pad, cursorY - gap - h); if (top < pad) top = pad; el.style.left = left + 'px'; el.style.top = top + 'px';