merge pr-944 (#944 feat(git): Git 内容区改为 VS Code Source Control 结构) into dev(@hairyf)

冲突解决(按 D4 与仓库现役不变量):
- status() 改为 porcelain v2(branch/upstream/ahead-behind/detached/operation 一次读回),
  但保留 dev 的行/字段上限、pathspec 化 numstat 与 #909 的分侧计数;v2 记录遍历抽成
  porcelainV2Tokens,状态解析与 pathspec 提取共用同一份字段知识;
- GitLens 的 Merge/Staged/Changes 三组取 #944,两组各读自己那一侧(#909),
  Merge 组不印行数(冲突不是行数故事,也不许把某一侧当「这个数」);
  sideEntries 保留(每组只读自己那一半的 XY 字母);
- ChangesTab 保留 #939 的官方 Tabs 外观与 a11y 包装、刷新按 #944 只留给本轮文件镜头;
- 测试:git.spec 导入取并集、rmSync 清理改回 removeTree、smoke 的 branch/detached 断言
  按 porcelain v2 语义改写,其余用例按新契约微调(band 顺序、changesOps 第 4 参 wait)。

剔除夹带(D4):.agents/skills/handle/SKILL.md、eslint/vitest 的 soruce/vscode 忽略项、
webRuntime→connection.requestRejection 栅栏与 ownEntryId 放宽(index.ts / context-types.ts
取 dev)、栅栏类测试桩与注释一并回退,栅栏归属留给 0.2.1 兼容批。
This commit is contained in:
Menghuan1918 committed 2026-10-16 17:14:06 +08:00
commit 40ed740f3a
45 files changed
+1972 -761

No files matched your search

+100 -119
View File
@@ -21,18 +21,14 @@
/* ── Git lens (the former git panel) ───────────────────────────────────── */
/* The Git lens ROOT is not a scroller (#194): it is the fixed frame that holds
the non-scrolling head band (branch / repository / worktree pickers) above
the ONE inner scroll body and the commit bar below it. Everything that used
to scroll here — the change groups, the history, the state lines — now
scrolls inside `.gitScroll`, so the branch bar and the commit box stay on
screen while the list moves. */
/* Changes and Graph share one scroll body; branch/sync stays outside it. */
.git {
flex: 1;
min-height: 0;
min-width: 0;
display: flex;
flex-direction: column;
padding-top: 6px;
}
/* The inner scroll body: the change groups + the history. It owns both scroll
@@ -47,24 +43,31 @@
overflow-x: hidden;
}
/* The selector band: branch / repository / worktree pickers (only rendered
for real choices) and nothing else — the counts live in the section bands. */
.selectors { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 12px 0; }
.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; }
.scmHeader:hover .scmActions, .scmHeader:focus-within .scmActions { opacity: 1; }
@media (hover: none) { .scmActions { opacity: 1; } }
.select {
flex: 1;
min-width: 0;
height: 28px;
padding: 0 6px;
border: 1px solid var(--dsw-alias-border-l2);
border-radius: 3px;
background: var(--dsw-alias-bg-base);
color: var(--dsw-alias-label-primary);
font: var(--dsw-font-xxs-12);
}
/* Docked by the flex column above (a sibling of `.gitScroll`), plus sticky so
it also survives the case where the host tab body itself scrolls the whole
tab — the branch control must never leave the bottom of the pane. */
.gitFooter { flex: none; min-width: 0; position: sticky; bottom: 0; z-index: 1; border-top: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-base); }
.footerRow { display: flex; align-items: center; min-width: 0; min-height: 28px; }
/* A single branch has nothing to choose: it reads as the row's label. */
.branchLabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsw-alias-label-secondary); font: var(--dsw-font-xxxs-11); }
/* A failed remote op reports above the branch row and git's stderr can be long:
it keeps its own height (never truncated) but gets a dismiss control instead
of living in the docked footer until the next action. */
.actionError { display: flex; align-items: flex-start; gap: 6px; white-space: normal; }
.actionErrorText { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.branchMenu { display: flex; flex: 1; min-width: 0; }
.branchButton, .syncButton { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 28px; padding: 3px 8px; border: none; background: transparent; color: var(--dsw-alias-label-secondary); font: var(--dsw-font-xxxs-11); cursor: pointer; }
.branchButton { flex: 1; text-align: left; }
.syncButton { max-width: 55%; }
.branchButton svg, .syncButton svg { flex: none; }
.branchButton span, .syncButton span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branchButton:hover:not(:disabled), .syncButton:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }
.branchButton:disabled, .syncButton:disabled { opacity: 0.45; cursor: default; }
/* ── Change groups (one directory tree each) ───────────────────────────── */
@@ -77,24 +80,27 @@
class keeps the opaque fill above the kit's transparent band no matter which
sheet lands first in the bundle. */
.group .groupHeader {
gap: 4px;
position: sticky;
top: 0;
z-index: 2;
background: var(--dsw-alias-bg-base);
}
/* The group's change count, as a small capsule on the label's baseline. */
/* Group counts match the action height and the neighbouring header controls'
corner radius (the host kit's `size="sm"` buttons use `--dsw-radius-sm`);
directory rows need no badge. */
.countPill {
flex: none;
min-width: 16px;
height: 16px;
padding: 0 5px;
border-radius: 999px;
width: 20px;
height: 20px;
border-radius: var(--dsw-radius-sm);
background: var(--dsw-alias-interactive-bg-hover);
color: var(--dsw-alias-label-secondary);
font: var(--dsw-font-xxxs-strong-11);
line-height: 16px;
line-height: 20px;
text-align: center;
font-size: 10px;
font-variant-numeric: tabular-nums;
}
@@ -108,17 +114,8 @@
.group .headerAction { opacity: 1; }
}
/* The tree body: rows are flush bands, the gutter lives here. */
.tree { display: flex; flex-direction: column; padding: 0 6px; }
/* One nesting level: 12px of indent, with the guide line drawn at its edge so
the depth stays readable without a second colour. */
.treeChildren {
display: flex;
flex-direction: column;
margin-left: 11px;
border-left: 1px solid var(--dsw-alias-border-l1);
}
/* Indent row contents only; hover bands span the full panel. */
.tree { display: flex; flex-direction: column; }
/* A directory row's disclosure button. It shares the `.row` band with a file
row (the band owns the hover/selected fill and the trailing action), so this
@@ -152,8 +149,7 @@
gap: 6px;
position: relative;
min-height: 28px;
padding: 0 2px;
border-radius: 4px;
padding: 0 6px;
animation: dsh-row-in 150ms var(--ds-ease-in-out);
}
.row:hover { background: var(--dsw-alias-interactive-bg-hover); }
@@ -180,6 +176,18 @@
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
absolutely placed columns in `IndentGuides`), one per level above the row and
spanning the whole band, so the flex metrics never move. */
.guide {
position: absolute;
top: 0;
bottom: 0;
width: 0;
border-left: 1px solid var(--dsw-alias-border-l1);
}
.rowMain {
flex: 1;
min-width: 0;
@@ -197,7 +205,8 @@
/* The row's icons are content at the plugin's own scale, not chrome. */
.rowIcon { flex: none; display: inline-flex; align-items: center; }
.rowName { 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); }
.rowName { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--dsw-font-xxs-12); color: var(--dsw-alias-label-primary); }
.rowPath { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--dsw-font-xxxs-11); color: var(--dsw-alias-label-tertiary); }
/* A row's / band's line counts (#131): `+N −M` in the diff pane's own ink (the
`.statAdd` / `.statDel` atoms of `diff.module.css`, reused rather than
@@ -224,6 +233,9 @@
white-space: nowrap;
}
/* Match both glyphs and keep their hover boxes smaller than the 28px row. */
.row .rowAction, .group .headerAction { width: 20px; height: 20px; }
/* The row action is invisible until its row is hovered or holds focus (a
keyboard tab lands on it and reveals it). The three-class form outranks the
kit's own disabled rule, which would otherwise pin every button to a dim but
@@ -233,59 +245,43 @@
.row:not(:hover):not(:focus-within) .rowAction { opacity: 1; }
}
/* ── Commit bar (docked below the scroll body, never inside it) ─────────── */
/* ── Message draft (inside Changes) ─────────────────────────────────────── */
/* Since #194 the bar is a SIBLING of `.gitScroll` in the lens root's column:
it is always on screen, so it needs neither `position: sticky` nor a
stacking order over the sticky group headers (they are inside the scroller,
which clips them). */
.commitBar {
flex: none;
display: flex;
flex-direction: column;
gap: 4px;
padding: 8px 12px;
border-top: 1px solid var(--dsw-alias-border-l1);
background: var(--dsw-alias-bg-base);
}
.commitRow { display: flex; align-items: center; gap: 6px; }
.messageBox { display: flex; padding: 4px 8px 8px; }
/* The commit-message box and its busy overlay: the input keeps its own
flex sizing through a wrapper so the overlay can sit exactly on top of it
while the host generates or commits. */
/* Desktop's official Input frame, with a growing textarea instead of input. */
.commitInputWrap {
position: relative;
display: flex;
align-items: center;
gap: 6px;
flex: 1;
min-width: 0;
min-height: 32px;
box-sizing: border-box;
padding: 0 4px 0 8px;
border: 0.5px solid var(--dsw-alias-border-l4);
border-radius: var(--dsw-radius-md);
background: var(--dsw-alias-bg-layer-1);
}
.commitInputWrap:focus-within { border-color: var(--dsw-alias-state-business-primary); }
/* The multiline commit box: a native textarea styled to match the primitives
Input (layer fill, hairline border, brand focus ring). Flex sizing keeps it
inside the row — `width: 100%` would overflow its own padding/border. */
.commitInput {
flex: 1;
min-width: 0;
box-sizing: border-box;
/* One line by default; GitLens grows it with the text (18px per line,
6px vertical padding, six lines before it scrolls). The bounds here are
the stylesheet's half of that contract. */
min-height: 30px;
max-height: 120px;
padding: 6px 8px;
border: 0.5px solid var(--dsw-alias-border-l4);
border-radius: 8px;
background: var(--dsw-alias-bg-layer-1);
height: 22px;
min-height: 22px;
max-height: 132px;
padding: 0;
margin: 4px 0;
border: none;
background: transparent;
color: var(--dsw-alias-label-primary);
font: var(--dsw-font-s-13);
line-height: 18px;
font: var(--dsw-font-s-14);
line-height: 22px;
resize: none;
overflow-y: hidden;
}
.commitInput:focus {
outline: none;
border-color: var(--dsw-alias-brand-primary);
}
.commitInput::placeholder {
@@ -295,19 +291,21 @@
.commitInput:disabled {
opacity: 0.5;
}
.commitInput[data-message-busy='true'] { color: transparent; caret-color: transparent; }
/* Busy text in the input's place: the running-status sweep used by the side
chat (gradient text scrolled by background-position). The real placeholder
is cleared while busy, so the two never overlap. */
.commitBusyText {
position: absolute;
inset: 0;
inset: 0 38px 0 0;
display: flex;
align-items: center;
/* Matches the textarea's own padding so the label sits where the text would. */
padding: 6px 8px;
/* Match the frame's inset while keeping the generate button unobscured. */
padding: 0 8px;
pointer-events: none;
font: var(--dsw-font-xxs-12);
font: var(--dsw-font-s-14);
line-height: 22px;
background-image: linear-gradient(
90deg,
var(--dsw-alias-label-tertiary) 0%,
@@ -330,20 +328,21 @@
.commitBusyText { animation: none; }
}
/* The AI commit-message button: a quiet square secondary button beside the
input. While the host streams a suggestion it pulses. */
/* Generate fills the draft only. Inline on the input's right edge. */
.suggestButton {
flex: none;
align-self: flex-start;
margin-top: 3px;
display: inline-flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
width: 24px;
height: 24px;
padding: 0;
border: 1px solid var(--dsw-alias-border-l1);
border-radius: 6px;
border: none;
border-radius: 8px;
background: transparent;
color: var(--dsw-alias-label-secondary);
color: var(--dsw-alias-label-tertiary);
cursor: pointer;
}
@@ -503,36 +502,16 @@
color: var(--dsw-alias-label-tertiary);
}
/* ── History ───────────────────────────────────────────────────────────── */
/* ── Commit graph ──────────────────────────────────────────────────────── */
/* A history row: line 1 = short-hash badge + subject, line 2 = ref pills +
author·time flushed right (the badges live on the second line so they never
crowd the subject, and the time never pushes the refs around). */
.logRow {
position: relative;
display: flex;
flex-direction: column;
gap: 3px;
padding: 6px 10px;
margin: 0 6px;
border-radius: 4px;
cursor: pointer;
}
.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); }
.logLine1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.logHash {
flex: none;
padding: 1px 4px;
border-radius: 2px;
background: var(--dsw-alias-interactive-bg-hover);
color: var(--dsw-alias-label-secondary);
font: var(--dsw-font-markdown-code-block-small);
}
.logLine2 { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.logRef { flex: none; padding: 0 6px; border: 1px solid var(--dsw-alias-border-l2); border-radius: 999px; 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-strong-12); color: var(--dsw-alias-label-primary); }
.logMeta { margin-left: auto; font: var(--dsw-font-xxxs-11); color: var(--dsw-alias-label-tertiary); white-space: nowrap; }
.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;
@@ -605,7 +584,9 @@
/* 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, .select:focus-visible, .dragHandle:focus-visible {
.opRow:focus-visible, .logRow:focus-visible, .logMore: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);
outline-offset: -1px;
}