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:
Christoph Brandau
2026-08-10 10:48:31 +02:00
parent eb65c1def7
commit f88b6961d1
2 changed files with 9 additions and 7 deletions
+6 -3
View File
@@ -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);
}