From 57a6bea3b4dba574d53b07cfaff75c0baba54ec1 Mon Sep 17 00:00:00 2001 From: luciano Date: Mon, 22 Jun 2026 14:56:40 +0200 Subject: [PATCH] Scenes: clear stale text/image when a track (re)starts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On restart, lastScene was reset to null and a channel with nothing active at t=0 also evaluated to null, so the diff saw 'no change' and never sent the hide command — leftover scene text stayed on screen. Use an undefined sentinel so advanceCues applies (and thus clears) every channel once at scene start. Co-Authored-By: Claude Opus 4.8 --- src/control.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/control.js b/src/control.js index b01b9b2..e33679c 100644 --- a/src/control.js +++ b/src/control.js @@ -277,7 +277,10 @@ let lastScene = { effect: null, text: null, image: null }; function startCues(tr) { tr.cues = migrateCues(tr.cues || []); activeCues = tr.cues.slice().sort((a, b) => a.time - b.time); - lastScene = { effect: null, text: null, image: null }; + // `undefined` (not null) forces advanceCues to APPLY every channel once, so a + // stale text/image from the previous track is cleared even when the new scene + // has nothing active at t=0. + lastScene = { effect: undefined, text: undefined, image: undefined }; advanceCues(0); } function sceneActive(type, t) { @@ -327,7 +330,7 @@ function applyImageEl(el) { function refreshScenePreview(i) { if (i !== currentIndex) return; activeCues = (playlist[i].cues || []).slice().sort((a, b) => a.time - b.time); - lastScene = { effect: null, text: null, image: null }; + lastScene = { effect: undefined, text: undefined, image: undefined }; advanceCues(playCur || 0); }