From 7558feb80a95dbb1793aac8d43851002a2201f77 Mon Sep 17 00:00:00 2001 From: ThreeFish Date: Sat, 4 Jul 2026 22:07:16 +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=E4=BA=92=E6=96=A5=20+=20?= =?UTF-8?q?=E6=B5=AE=E5=B1=82=E5=86=85=E5=BC=95=E7=94=A8=E8=83=B6=E5=9B=8A?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E4=B8=8D=E6=88=AA=E6=96=AD;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题1(两浮层叠加):鼠标在 CI 图标上时,CI 详情浮层与提交详情浮层同时显示、后者覆盖前者。 根因:commit 的 mouseover 命中 CI 图标时仅 return,未隐藏已显示/在途的提交浮层;CI 的 mouseover 显示 CI 浮层时也未隐藏提交浮层。 修复(二者严格互斥): - commit mouseover 命中 CI 图标 → 即时 hideCommitTip()(含取消在途 400ms 定时器)再 return; - CI mouseover → 先 hideCommitTip() 再 scheduleShow(CI); - CI mouseout 回落到同行行体(非 CI 区)→ scheduleShowCommit 切回提交浮层。 经 Playwright 模拟 hover 序列验证:行体→仅提交浮层;CI 图标→仅 CI 浮层;移回行体→仅提交浮层。 问题2(引用胶囊截断):提交浮层内 Branches/Tags 等胶囊沿用行内 .chip 的 max-width:160px + 省略号,长名被截断(…)。 修复:#commit-tip 内覆盖为 max-width:none + chip-nm 换行不截断(overflow visible / word-break), 浮层空间充足,refs 区已 flex-wrap 换行承载。 验证:check-types/lint/生产打包/349 单测通过;Playwright 动态验证互斥;harness 核实胶囊完整显示。 🤖 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/adapter/webview/log-webview.ts b/src/adapter/webview/log-webview.ts index fb0affc..fe18f17 100644 --- a/src/adapter/webview/log-webview.ts +++ b/src/adapter/webview/log-webview.ts @@ -558,6 +558,9 @@ body { margin: 0; font-family: var(--vscode-font-family); font-size: var(--vscod #commit-tip .ct-sec .ct-k { flex: 0 0 66px; color: var(--vscode-descriptionForeground); font-size: 10px; text-transform: uppercase; letter-spacing: .3px; } #commit-tip .ct-sec .ct-v { flex: 1 1 auto; min-width: 0; word-break: break-word; } #commit-tip .ct-refs { display: flex; flex-wrap: wrap; gap: 4px; } +/* 浮层内引用胶囊完整显示(覆盖行内 .chip 的 max-width/省略号截断):换行不截断,空间由浮层承载。 */ +#commit-tip .chip { max-width: none; } +#commit-tip .chip .chip-nm { overflow: visible; text-overflow: clip; white-space: normal; word-break: break-all; } #commit-tip .ct-dim { color: var(--vscode-descriptionForeground); } #commit-tip .ct-stat { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--vscode-editorHoverWidget-border, rgba(128,128,128,.2)); border-bottom: 1px solid var(--vscode-editorHoverWidget-border, rgba(128,128,128,.2)); font-size: 12px; font-variant-numeric: tabular-nums; } #commit-tip .ct-stat .files { color: var(--vscode-descriptionForeground); } @@ -1000,6 +1003,7 @@ rowsEl.addEventListener('mouseover', function (e) { const icon = e.target.closest && e.target.closest('.ci'); if (!icon || icon.classList.contains('ci-empty')) return; overIcon = true; + hideCommitTip(); // 进入 CI 图标:立即隐藏提交浮层并取消在途,二者互斥。 scheduleShow(icon.getAttribute('data-ci'), icon); }); rowsEl.addEventListener('mouseout', function (e) { @@ -1007,6 +1011,10 @@ rowsEl.addEventListener('mouseout', function (e) { if (!icon) return; overIcon = false; scheduleHide(); + // 离开 CI 图标但仍在同一行内(移回行体):切回提交详情浮层。 + const to = e.relatedTarget; + const r = to && to.closest && to.closest('.row'); + if (r && !(to.closest && to.closest('.ci'))) scheduleShowCommit(r.getAttribute('data-hash')); }); rowsEl.addEventListener('keydown', function (e) { const icon = e.target.closest && e.target.closest('.ci'); @@ -1207,7 +1215,7 @@ function scheduleHideCommit() { } rowsEl.addEventListener('mouseover', function (e) { const ci = e.target.closest && e.target.closest('.ci'); - if (ci && !ci.classList.contains('ci-empty')) return; // CI 图标区归 CI 浮层。 + if (ci && !ci.classList.contains('ci-empty')) { hideCommitTip(); return; } // 进入 CI 图标区:即时隐藏提交浮层并取消在途,二者互斥。 const r = e.target.closest && e.target.closest('.row'); if (!r) return; scheduleShowCommit(r.getAttribute('data-hash'));