Color timeline branch arrows to match their marker
Arrows inherit the marker's --snap-marker-color so they match the node color (blue for regular, purple for node snapshots, green for current, etc). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3530,10 +3530,14 @@ function buildTimeline() {
|
|||||||
const group = document.createElement("div");
|
const group = document.createElement("div");
|
||||||
group.className = "snap-timeline-fork-group";
|
group.className = "snap-timeline-fork-group";
|
||||||
|
|
||||||
|
// Arrow color matches the marker
|
||||||
|
const arrowColor = marker.style.getPropertyValue("--snap-marker-color") || "#3b82f6";
|
||||||
|
|
||||||
// Up arrow (previous branch)
|
// Up arrow (previous branch)
|
||||||
const upBtn = document.createElement("button");
|
const upBtn = document.createElement("button");
|
||||||
upBtn.className = "snap-timeline-branch-btn";
|
upBtn.className = "snap-timeline-branch-btn";
|
||||||
upBtn.textContent = "\u25B2";
|
upBtn.textContent = "\u25B2";
|
||||||
|
upBtn.style.color = arrowColor;
|
||||||
upBtn.title = `Branch ${selectedIndex}/${children.length}`;
|
upBtn.title = `Branch ${selectedIndex}/${children.length}`;
|
||||||
if (selectedIndex <= 0) upBtn.style.visibility = "hidden";
|
if (selectedIndex <= 0) upBtn.style.visibility = "hidden";
|
||||||
upBtn.addEventListener("click", (e) => {
|
upBtn.addEventListener("click", (e) => {
|
||||||
@@ -3547,6 +3551,7 @@ function buildTimeline() {
|
|||||||
const downBtn = document.createElement("button");
|
const downBtn = document.createElement("button");
|
||||||
downBtn.className = "snap-timeline-branch-btn";
|
downBtn.className = "snap-timeline-branch-btn";
|
||||||
downBtn.textContent = "\u25BC";
|
downBtn.textContent = "\u25BC";
|
||||||
|
downBtn.style.color = arrowColor;
|
||||||
downBtn.title = `Branch ${selectedIndex + 2}/${children.length}`;
|
downBtn.title = `Branch ${selectedIndex + 2}/${children.length}`;
|
||||||
if (selectedIndex >= children.length - 1) downBtn.style.visibility = "hidden";
|
if (selectedIndex >= children.length - 1) downBtn.style.visibility = "hidden";
|
||||||
downBtn.addEventListener("click", (e) => {
|
downBtn.addEventListener("click", (e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user