From 9a9c7dd9dd6eeec7985adc2b9f14cfbd4b1ebb24 Mon Sep 17 00:00:00 2001
From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
Date: Mon, 23 Nov 2026 04:10:03 +0800
Subject: [PATCH] fix(vcs): clarify staging groups and row actions
---
src/features/vcs/CommitView.module.css | 6 ++++--
src/features/vcs/CommitView.tsx | 7 ++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/features/vcs/CommitView.module.css b/src/features/vcs/CommitView.module.css
index 708f11dc40..28b3672229 100644
--- a/src/features/vcs/CommitView.module.css
+++ b/src/features/vcs/CommitView.module.css
@@ -89,6 +89,9 @@
.groupLabel {
color: var(--fg-strong);
}
+.stageGroupLabel {
+ font-weight: 600;
+}
.detail {
flex: 0 10000 auto;
min-width: 0;
@@ -450,14 +453,13 @@
.checkProblemLink:hover {
text-decoration: underline;
}
-/* Staging area: Stage / Unstage on the hovered or selected row, as a hover icon at the row's end. */
.stageButton {
flex: none;
margin-left: auto;
visibility: hidden;
}
[role="treeitem"]:hover .stageButton,
-[role="treeitem"][aria-selected="true"] .stageButton {
+.stageButtonLead {
visibility: visible;
}
.inspectionFix {
diff --git a/src/features/vcs/CommitView.tsx b/src/features/vcs/CommitView.tsx
index e8bf6acbad..f54dc3c203 100644
--- a/src/features/vcs/CommitView.tsx
+++ b/src/features/vcs/CommitView.tsx
@@ -590,7 +590,7 @@ export function stageOperation(n: ChangeNode): { label: string; icon: "plus" | "
return null;
}
-function StageButton({ node }: { node: ChangeNode }) {
+function StageButton({ node, leadSelected }: { node: ChangeNode; leadSelected: boolean }) {
const op = stageOperation(node);
if (!op) return null;
const { label, icon, paths } = op;
@@ -600,7 +600,7 @@ function StageButton({ node }: { node: ChangeNode }) {
icon={icon}
title={label}
size="small"
- className={styles.stageButton}
+ className={clsx(styles.stageButton, leadSelected && styles.stageButtonLead)}
onMouseDown={(e) => e.stopPropagation()}
onDoubleClick={(e) => e.stopPropagation()}
onClick={(e) => {
@@ -1161,6 +1161,7 @@ export function ChangesTree({ mode, amended }: { mode: "commit" | "local" | "dia
className={clsx(
styles.label,
n.type === "group" && styles.groupLabel,
+ staging && n.type === "group" && styles.stageGroupLabel,
n.type === "group" && n.changelist && !n.active && styles.inactiveList,
)}
style={n.type === "file" && n.kind ? { color: KIND_COLOR[n.kind] } : undefined}
@@ -1268,7 +1269,7 @@ export function ChangesTree({ mode, amended }: { mode: "commit" | "local" | "dia
)}
{n.detail && n.detailIcon && }
{n.detail && {n.detail}}
- {staging && }
+ {staging && }
);
}}