fix(history): preserve branch colors across parent lanes
Keep branch metadata attached to each parent lane so the history graph can render consistent colors and markers after merges and branch transitions. Also soften the styling for behind-path segments to better match the updated dot coloring.
This commit is contained in:
+3
-4
@@ -2689,9 +2689,8 @@
|
||||
filter: drop-shadow(0 0 3px rgba(224,160,64,0.24));
|
||||
}
|
||||
.graph-svg path.graph-segment-behind {
|
||||
stroke: #7aacff;
|
||||
stroke-dasharray: 4 4;
|
||||
filter: drop-shadow(0 0 3px rgba(122,172,255,0.24));
|
||||
filter: drop-shadow(0 0 3px rgba(122,172,255,0.2));
|
||||
}
|
||||
.graph-dot {
|
||||
position: absolute;
|
||||
@@ -2715,8 +2714,8 @@
|
||||
box-shadow: 0 0 0 1px rgba(224,160,64,0.42), 0 0 10px rgba(224,160,64,0.16);
|
||||
}
|
||||
.graph-dot.behind {
|
||||
background: #7aacff;
|
||||
box-shadow: 0 0 0 1px rgba(122,172,255,0.46), 0 0 10px rgba(122,172,255,0.18);
|
||||
background: var(--dot-color, #5a8cf8);
|
||||
box-shadow: 0 0 0 1px var(--dot-color, #5a8cf8), 0 0 10px rgba(122,172,255,0.18);
|
||||
}
|
||||
.graph-dot.tip { width: 14px; height: 14px; box-shadow: 0 0 0 1px var(--dot-color, #5a8cf8); }
|
||||
.graph-dot.merge {
|
||||
|
||||
@@ -140,15 +140,18 @@
|
||||
|
||||
const currentBranches = branchMembership.get(commit.hash) ?? localBranchRefs(commit);
|
||||
const commitBranches = uniqueStrings([...(beforeBranches[col] ?? []), ...currentBranches]);
|
||||
after[col] = commit.parents.length > 0 ? commit.parents[0] : null;
|
||||
afterBranches[col] = after[col] ? commitBranches.slice() : [];
|
||||
const firstParent = commit.parents[0] ?? null;
|
||||
after[col] = firstParent;
|
||||
afterBranches[col] = firstParent
|
||||
? (branchMembership.get(firstParent) ?? commitBranches).slice()
|
||||
: [];
|
||||
|
||||
const fromCommit = new Set<number>([col]);
|
||||
for (let p = 1; p < commit.parents.length; p++) {
|
||||
let slot = after.indexOf(null);
|
||||
if (slot === -1) { slot = after.length; after.push(null); afterBranches.push([]); }
|
||||
after[slot] = commit.parents[p];
|
||||
afterBranches[slot] = [];
|
||||
afterBranches[slot] = (branchMembership.get(commit.parents[p]) ?? commitBranches).slice();
|
||||
fromCommit.add(slot);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user