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:
@@ -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