From fd14d4f1a6fb8b5c0cb808ba25efd821417b601c Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Fri, 27 Feb 2026 00:23:58 +0100 Subject: [PATCH] Auto-select branch containing active snapshot on reload When activeBranchSelections is empty (after reload or tab switch), selectBranchContaining is called with the effective active ID so the highlighted branch matches the active snapshot ring. Co-Authored-By: Claude Opus 4.6 --- js/snapshot_manager.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/snapshot_manager.js b/js/snapshot_manager.js index 2a58023..4486495 100644 --- a/js/snapshot_manager.js +++ b/js/snapshot_manager.js @@ -3675,6 +3675,10 @@ function buildTimeline() { let tree = null; if (branchingEnabled) { tree = buildSnapshotTree(allRecords); + // Auto-select branch containing the active snapshot on first render + if (activeBranchSelections.size === 0 && effectiveActiveId && tree.byId.has(effectiveActiveId)) { + selectBranchContaining(effectiveActiveId, tree); + } } // ── Expanded mode: one row per branch ──