Compare commits

...
Author SHA1 Message Date
l0ng-ai 9a9c7dd9dd fix(vcs): clarify staging groups and row actions 2026-11-23 04:10:03 +08:00
2 changed files with 8 additions and 5 deletions

No files matched your search

+4 -2
View File
@@ -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 {
+4 -3
View File
@@ -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 && <Icon name={n.detailIcon} size={14} className={styles.detailIcon} />}
{n.detail && <span className={styles.detail}>{n.detail}</span>}
{staging && <StageButton node={n} />}
{staging && <StageButton node={n} leadSelected={st.selected && st.lead} />}
</span>
);
}}