From f88b6961d113d726e3921d80ceee2d6306307656 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Mon, 10 Aug 2026 10:48:31 +0200 Subject: [PATCH] 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. --- src/app.css | 7 +++---- src/lib/components/HistoryPanel.svelte | 9 ++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app.css b/src/app.css index a7f9b4b..dfbaca4 100644 --- a/src/app.css +++ b/src/app.css @@ -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 { diff --git a/src/lib/components/HistoryPanel.svelte b/src/lib/components/HistoryPanel.svelte index 0ee555b..156bc8c 100644 --- a/src/lib/components/HistoryPanel.svelte +++ b/src/lib/components/HistoryPanel.svelte @@ -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([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); }