From b031a167a49fa383d881354817408979bd0f0f6a Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 30 Jun 2026 10:37:49 -0400 Subject: [PATCH] fix: clip-follow only when playhead is inside a scroll-to annotation's bar ::active-annotation falls back to the nearest annotation (it drives the commentary highlight), so gating playback clip-follow on it fired for every clip. Gate on strict bar containment of a :scroll-to annotation instead. Co-Authored-By: Claude Opus 4.8 --- tl/src/tl/views.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tl/src/tl/views.cljs b/tl/src/tl/views.cljs index 9704c44..71ac076 100644 --- a/tl/src/tl/views.cljs +++ b/tl/src/tl/views.cljs @@ -308,7 +308,6 @@ thumbs @(rf/subscribe [::subs/thumbnails]) playhead @(rf/subscribe [::subs/playhead]) playing? @(rf/subscribe [::subs/playing?]) - active @(rf/subscribe [::subs/active-annotation]) authoring? (some? @(rf/subscribe [::subs/draft-group])) linking @(rf/subscribe [::subs/linking]) len @(rf/subscribe [::subs/length]) @@ -320,10 +319,14 @@ (r/after-render (fn [] (follow! fps zoom playhead) - ;; clip-following: while playing through an annotation that opts in - ;; (:meta :scroll-to), scroll each clip into view as the playhead - ;; crosses onto its track. Deduped so it only moves on track change. - (when (ann-scroll-to? (get-in scene [:groups active])) + ;; clip-following: only while the playhead is actually inside a bar of + ;; an annotation that opts in (:meta :scroll-to) — scroll each of its + ;; clips into view as the playhead crosses onto a new track. (Strict + ;; containment, NOT ::active-annotation, which falls back to the + ;; nearest annotation and would fire on every clip.) + (when (some (fn [a] (and (ann-scroll-to? (get-in scene [:groups (:id a)])) + (some (fn [[lo hi]] (<= lo playhead hi)) (:bars a)))) + anns) (let [track (:track (nth segs (seg-at segs playhead) nil))] (when (not= track @played-track) (reset! played-track track)