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 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 00:23:58 +01:00
parent 0c707b43f3
commit fd14d4f1a6

View File

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