Skip shared ancestors in expanded timeline, switch workflow on picker click
Expanded timeline: non-active branch rows now only show their unique markers after the fork point, indented to align with the active branch. Removes the dimmed-ancestor approach in favor of cleaner layout. Workflow picker: clicking a workflow that is open in ComfyUI now switches to that tab instead of just viewing its snapshots. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2191,9 +2191,6 @@ const CSS = `
|
|||||||
background: rgba(59, 130, 246, 0.12);
|
background: rgba(59, 130, 246, 0.12);
|
||||||
border-left-color: #3b82f6;
|
border-left-color: #3b82f6;
|
||||||
}
|
}
|
||||||
.snap-timeline-marker-dimmed {
|
|
||||||
opacity: 0.35;
|
|
||||||
}
|
|
||||||
.snap-diff-overlay {
|
.snap-diff-overlay {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
@@ -2836,6 +2833,23 @@ async function buildSidebar(el) {
|
|||||||
if (entry.workflowKey === currentKey) {
|
if (entry.workflowKey === currentKey) {
|
||||||
viewingWorkflowKey = null;
|
viewingWorkflowKey = null;
|
||||||
} else {
|
} else {
|
||||||
|
// Try to switch to the workflow in ComfyUI
|
||||||
|
const wfStore = app.extensionManager?.workflow;
|
||||||
|
const openWfs = wfStore?.openWorkflows;
|
||||||
|
if (openWfs && wfStore.openWorkflow) {
|
||||||
|
const target = openWfs.find(wf =>
|
||||||
|
(wf.key || wf.filename || wf.path) === entry.workflowKey
|
||||||
|
);
|
||||||
|
if (target) {
|
||||||
|
try {
|
||||||
|
collapsePicker();
|
||||||
|
await wfStore.openWorkflow(target);
|
||||||
|
// openWorkflow listener handles viewingWorkflowKey reset + refresh
|
||||||
|
return;
|
||||||
|
} catch { /* fall through to view-only */ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Workflow not open in ComfyUI — view its snapshots only
|
||||||
viewingWorkflowKey = entry.workflowKey;
|
viewingWorkflowKey = entry.workflowKey;
|
||||||
}
|
}
|
||||||
activeBranchSelections.clear();
|
activeBranchSelections.clear();
|
||||||
@@ -3553,7 +3567,7 @@ function buildTimeline() {
|
|||||||
canvasParent.appendChild(bar);
|
canvasParent.appendChild(bar);
|
||||||
timelineEl = bar;
|
timelineEl = bar;
|
||||||
|
|
||||||
function buildMarker(rec, { dimmed = false, onClickBranch = null } = {}) {
|
function buildMarker(rec, { onClickBranch = null } = {}) {
|
||||||
const marker = document.createElement("div");
|
const marker = document.createElement("div");
|
||||||
marker.className = "snap-timeline-marker";
|
marker.className = "snap-timeline-marker";
|
||||||
|
|
||||||
@@ -3571,7 +3585,6 @@ function buildTimeline() {
|
|||||||
marker.classList.add("snap-timeline-marker-current");
|
marker.classList.add("snap-timeline-marker-current");
|
||||||
marker.style.setProperty("--snap-marker-color", "#10b981");
|
marker.style.setProperty("--snap-marker-color", "#10b981");
|
||||||
}
|
}
|
||||||
if (dimmed) marker.classList.add("snap-timeline-marker-dimmed");
|
|
||||||
|
|
||||||
let tip = `${rec.label} — ${formatTime(rec.timestamp)}\n${iconInfo.label}`;
|
let tip = `${rec.label} — ${formatTime(rec.timestamp)}\n${iconInfo.label}`;
|
||||||
if (rec.notes) tip += `\n${rec.notes}`;
|
if (rec.notes) tip += `\n${rec.notes}`;
|
||||||
@@ -3630,10 +3643,13 @@ function buildTimeline() {
|
|||||||
const isActiveBranch = branchLeafId === currentLeafId;
|
const isActiveBranch = branchLeafId === currentLeafId;
|
||||||
if (isActiveBranch) row.classList.add("snap-timeline-branch-row-active");
|
if (isActiveBranch) row.classList.add("snap-timeline-branch-row-active");
|
||||||
|
|
||||||
|
let skippedCount = 0;
|
||||||
for (const rec of branch) {
|
for (const rec of branch) {
|
||||||
const isSharedAncestor = !isActiveBranch && currentIds.has(rec.id);
|
if (!isActiveBranch && currentIds.has(rec.id)) {
|
||||||
|
skippedCount++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const marker = buildMarker(rec, {
|
const marker = buildMarker(rec, {
|
||||||
dimmed: isSharedAncestor,
|
|
||||||
onClickBranch: isActiveBranch ? null : () => {
|
onClickBranch: isActiveBranch ? null : () => {
|
||||||
selectBranchContaining(branchLeafId, tree);
|
selectBranchContaining(branchLeafId, tree);
|
||||||
},
|
},
|
||||||
@@ -3641,6 +3657,11 @@ function buildTimeline() {
|
|||||||
row.appendChild(marker);
|
row.appendChild(marker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Indent non-active rows so fork points align with the active branch
|
||||||
|
if (skippedCount > 0) {
|
||||||
|
row.style.paddingLeft = `${6 + skippedCount * 24}px`;
|
||||||
|
}
|
||||||
|
|
||||||
track.appendChild(row);
|
track.appendChild(row);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user