fix(web): connect git commit graph rails seamlessly across rows #601
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.52) × (1 − Review Confidence (0.54)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 75% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #601"
general
weight: 0.35
mzdluo123
Summary
修复 Git 工作台历史视图(
/git->历史)中提交拓扑线段在行与行之间断成独立短竖线、合并分叉行出现悬空短竖线以及根提交缺少入轨的问题(受影响用户故事:US-J21,故事 ID 与总数不变)。Root Cause
1. DOM 行高与固定高度 SVG 不一致:
GitLogCommitRow.svelte将固定height={28}的<svg>放在ListButton variant="compact-row"常规文本流内。由于ListButton自带上下py-1(4px+4px)、移动端紧凑触控最小高度min-h-(--control-touch-compact)(36px)以及引用徽章/长标题flex-wrap多行折行,相邻提交行<svg>上下存在8px–39px的空白间隙。2. 跨行轨道推导启发式缺陷:
computeGitGraphLayout原先依赖prevActive与row.activeLanes猜测上下轨道,导致:- 合并提交新分叉车道被误判为
!continuesFromPrev而额外画出悬空下半截竖线(midY -> height);- 根提交(后端
activeLanes: [])缺少承接上方子提交的入轨(0 -> midY);- 分支收口行(
fromLane !== toLane)在下一行立即复用同一车道编号时泄漏虚假的入轨;- 分页边界边(
edge.kind === "boundary")在追加加载下一页父提交后仍维持"2 2"虚线。Changes
web/src/components/workspace/GitLogCommitRow.svelte:保留等宽流内占位<span class="w-(--graph-width) shrink-0">,将拓扑<svg>改为绝对定位贴合ListButton全高(inset-y-0 left-2 h-full);竖直轨道使用百分比纵坐标(0%/50%/100%),曲线段置于嵌套preserveAspectRatio="none"+vector-effect="non-scaling-stroke"视口,提交圆点保留在外层1:1像素坐标系以在单行、触控高行与多行折行下始终保持正圆且跨行0px间隙。web/src/domains/workspace/git-graph-layout.ts:改为按跨行openLanes集合确定性推导每条车道的上半截入轨、下半截出轨与贯通轨道,并在目标父提交已加载至当前列表时将跨页boundary边升级为连续实线direct边。-
web/test/git-workbench.test.ts:补充合并提交无悬空竖轨、过路贯通轨、跨页追加加载实线闭合、根提交入轨与收口车道不串轨单测;-
web/test/browser/GitWorkbench.test.ts:补充真实 Chromium 下桌面(1280×900)与手机(390×844)视口相邻提交行<svg>纵坐标零间隙(< 0.5px)及节点正圆几何断言;- 更新
docs/user-stories/code-and-worktrees/worktrees/git-workbench/core.md(US-J21)与docs/user-stories/verification-log-2026-11-git-workbench.md(并将core.md第 134 行超宽引用拆分为左侧筛选引用与中间提交列表两子项,零信息删减)。UI Screenshots (Before / After)
以下全部截图均采集自本地隔离临时 Git 演示仓库(
webmux-demo:包含线性提交、feat/graph-lanes分支合并、v0.9.0/v1.0.0标签及链接工作树feat/worktree-preview)与隔离 WebMux 实例。本次为静态 SVG 布局与拓扑连线修复,无新增过渡动画或交互状态机变更。Desktop (
1280×900) — Dark & Light| Before (
b664ee82) | After (837fd9e2) || --- | --- |
| Desktop
1280×900· Dark<br>!Before Desktop Dark | Desktop1280×900· Dark<br>!After Desktop Dark || Desktop
1280×900· Light<br>!Before Desktop Light | Desktop1280×900· Light<br>!After Desktop Light |Tablet (
768×800) — Dark & Light| Before (
b664ee82) | After (837fd9e2) || --- | --- |
| Tablet
768×800· Dark<br>!Before Tablet Dark | Tablet768×800· Dark<br>!After Tablet Dark || Tablet
768×800· Light<br>!Before Tablet Light | Tablet768×800· Light<br>!After Tablet Light |Phone (
390×844) — Dark & Light| Before (
b664ee82) | After (837fd9e2) || --- | --- |
| Phone
390×844· Dark<br>!Before Phone Dark | Phone390×844· Dark<br>!After Phone Dark || Phone
390×844· Light<br>!Before Phone Light | Phone390×844· Light<br>!After Phone Light |Verification
make check(含pnpm --dir web build、oxfmt --check、make docs-check、make persistence-check、internal/archtest、pnpm --dir web check:arch、pnpm --dir web lint、go vet、golangci-lint)pnpm --dir web exec vitest run --config vitest.config.ts test/git-workbench.test.ts test/git-log-controller.test.ts(8 passed)pnpm --dir web exec vitest run --config vitest.browser.config.ts test/browser/GitWorkbench.test.ts test/browser/GitLogController.test.ts(8 passed)pnpm --dir web run build-storybook && pnpm --dir web exec playwright test --config playwright.storybook.config.ts test/storybook/git-workbench.spec.ts(27 passed)pnpm --dir web exec playwright test test/e2e/git-workbench-log.spec.ts(2 passed:桌面与320×568手机视口)hover与any-pointer: coarse媒体查询,未在 iOS / Android 真机上核验。