merge pr-969 (#969 feat(git-graph): 只读提交图) into dev(@vlln)

融合(D5):#969 的图谱引擎作为 Git 镜头内的「提交图」区上线,不再新增第三个镜头。
- 保留:src/git-graph.ts(有界路由 + graph-stale/graph-limit)、graph-layout.ts、
  graph.module.css、CommitDetails、DiffPane 的 PaneTabStrip 与 details/content/diff 分签、
  hover 卡片、引用徽章、分支筛选、无限滚动、e2e 与设计文档;
- 落位:GitGraphLens → GitGraphSection(挂在 GitLens 的 Graph 区,目标读镜头自己的
  仓库/worktree 选择,不再自持选择器);行右键接回 #944 的提交菜单(查看/复制/revert/cherry-pick);
- 去掉:第三镜头与 changesGraphLens 键、#944 的 GitGraph.tsx(及随之无消费者的
  log 行样式与 historyLoadError/changesNoHistory 词典键);
- 镜头常驻保留(hidden 切换):Graph 的滚动/选中、Changes 的展开与草稿切走不丢,
  同时 store 槽位与轮询按「可见 + 在屏」分别门控(切回不闪 loading);
- 两套重写过的测试按新契约对齐(底部面板分签、图谱区与 Git 镜头的关系、图行/历史断言)。
This commit is contained in:
Menghuan1918 committed 2026-10-16 17:30:44 +08:00
commit 88ded478de
48 files changed
+3408 -657

No files matched your search

+35 -32
View File
@@ -17,6 +17,9 @@
.headAction { margin-left: auto; align-self: center; }
.head :global(.wSkVaW_tabs) { gap: 24px; }
.lensBody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Retained but not on screen: `display: flex` above would otherwise win over
the `hidden` attribute and two lenses would share the column. */
.lensBody[hidden] { display: none; }
.head :global(.wSkVaW_tab):focus-visible { outline: 2px solid var(--dsw-alias-interactive-bg-hover-accent); outline-offset: -2px; }
/* ── Git lens (the former git panel) ───────────────────────────────────── */
@@ -43,6 +46,11 @@
overflow-x: hidden;
}
/* The Graph section's own viewport: the graph keeps ONE scroll box (its rows
page in as it reaches the end), so the section is given a bounded height
inside the lens's scroller rather than being clipped by it. */
.graphArea { display: flex; flex-direction: column; height: min(60vh, 460px); min-height: 220px; }
.scmHeader { display: flex; align-items: center; min-height: 28px; padding: 0 6px; }
.scmDisclosure { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0; border: none; background: transparent; color: var(--dsw-alias-label-primary); font: var(--dsw-font-xxs-strong-12); text-align: left; cursor: pointer; }
.scmActions { display: flex; align-items: center; gap: 2px; opacity: 0; }
@@ -159,22 +167,9 @@
shifts between rows. */
.row[data-selected='true'],
.opRow[data-selected='true'],
.logRow[data-selected='true'] {
background: var(--dsw-alias-interactive-bg-active);
}
.row[data-selected='true']::before,
.opRow[data-selected='true']::before,
.logRow[data-selected='true']::before {
content: '';
position: absolute;
left: 0;
top: 4px;
bottom: 4px;
width: 2px;
border-radius: 1px;
background: var(--dsw-alias-state-business-primary);
}
/* The tree's indent guides: the same 1px `border-l1` edge the old nested
`.treeChildren` wrapper drew (`margin-left: 11px` boundaries become the
@@ -504,29 +499,11 @@
/* ── Commit graph ──────────────────────────────────────────────────────── */
.logRow { position: relative; display: flex; align-items: center; min-width: 0; height: 22px; margin: 0 6px; cursor: pointer; }
.logRow:hover { background: var(--dsw-alias-interactive-bg-hover); }
.graphSvg { flex: none; max-width: 40%; height: 22px; overflow: hidden; }
.graphContent { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; padding-right: 4px; }
.logRefs { display: inline-flex; gap: 3px; flex-shrink: 1; min-width: 0; max-width: 45%; overflow: hidden; }
.logRef { flex: none; padding: 0 4px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 3px; font: var(--dsw-font-xxxs-strong-11); color: var(--dsw-alias-brand-primary); white-space: nowrap; }
.logSubject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--dsw-font-xxs-12); color: var(--dsw-alias-label-primary); }
.logMeta { max-width: 28%; overflow: hidden; text-overflow: ellipsis; font: var(--dsw-font-xxxs-11); color: var(--dsw-alias-label-tertiary); white-space: nowrap; }
.logMore {
display: block;
width: calc(100% - 24px);
margin: 4px 12px 8px;
height: 28px;
border: 1px solid var(--dsw-alias-border-l2);
border-radius: 3px;
background: transparent;
font: var(--dsw-font-xxs-12);
color: var(--dsw-alias-label-secondary);
cursor: pointer;
}
.logMore:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }
.logMore:disabled { opacity: 0.5; cursor: default; }
/* ── Session lens (this round's files) ─────────────────────────────────── */
@@ -561,6 +538,32 @@
.dragHandle { flex: none; height: 8px; cursor: ns-resize; position: relative; background: var(--dsw-alias-bg-base); }
.dragHandle::after { content: ''; position: absolute; left: calc(50% - 18px); top: 3px; width: 36px; height: 2px; border-radius: 1px; background: var(--dsw-alias-border-l2); }
.dragHandle:hover::after, .dragHandle:focus-visible::after { background: var(--dsw-alias-state-business-primary); }
/* ── Bottom pane tab strip (VS Code-style panel) ───────────────────────────
Only rendered when the pane really hosts two views (a graph commit's
`details` + its diff); a diff-only preview keeps the strip-less head. The
strip sits under the drag handle, so the handle stays the pane's top edge
and the strip doubles as the row that names the active view. */
.paneTabs { flex: none; display: flex; align-items: center; gap: 2px; height: 28px; padding: 0 8px; border-bottom: 1px solid var(--dsw-alias-border-l1); }
.paneTab {
align-self: stretch;
display: inline-flex;
align-items: center;
padding: 0 8px;
border: none;
border-bottom: 2px solid transparent;
background: transparent;
color: var(--dsw-alias-label-secondary);
font: var(--dsw-font-xxxs-strong-11);
cursor: pointer;
}
.paneTab:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }
.paneTab[data-active='true'] { color: var(--dsw-alias-label-primary); border-bottom-color: var(--dsw-alias-brand-primary); }
.paneTab:focus-visible { outline: 2px solid var(--dsw-alias-interactive-bg-hover-accent); outline-offset: -2px; }
/* The non-diff tab's body: the pane owns the frame, the content fills it and
scrolls itself (CommitDetails' own section is the scroller). */
.altBody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.diffHead { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 10px; border-bottom: 1px solid var(--dsw-alias-border-l1); }
/* The path keeps its tail (the file name is the identity; directories are
context): an RTL paragraph renders an ASCII path in reading order while
@@ -584,7 +587,7 @@
/* Keyboard focus rings match the shared sidebar convention (the kit atoms and
the tree rows carry their own). */
.opRow:focus-visible, .logRow:focus-visible, .logMore:focus-visible, .scmDisclosure:focus-visible,
.opRow:focus-visible, .scmDisclosure:focus-visible,
.branchButton:focus-visible, .syncButton:focus-visible, .suggestButton:focus-visible,
.select:focus-visible, .dragHandle:focus-visible {
outline: 2px solid var(--dsw-alias-interactive-bg-hover-accent);