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)