From c60633d7129275b076727420a26d1c2dbe593783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 19 Aug 2026 22:03:41 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(app):=20the=20transport=20cl?= =?UTF-8?q?ock=20reads=20the=20preview,=20not=20the=20timeline,=20while=20?= =?UTF-8?q?one=20is=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The toolbar's timecode/duration readout took position and duration from the timeline's own playhead unconditionally, so opening a library preview kept showing the timeline's time underneath it. It now reads active_session()/active_fps() like the rest of the transport does, so the clock tracks whichever session is actually playing; Escape still hands it back to the timeline the moment the preview closes. The ruler's own clock (timeline.rs) and the timeline context-menu timecodes are untouched -- they are timeline-bed reads and must keep following self.session regardless of a preview. --- crates/app/src/render.rs | 7 +------ crates/app/src/ui/toolbar.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/crates/app/src/render.rs b/crates/app/src/render.rs index 541c03b..556a01e 100644 --- a/crates/app/src/render.rs +++ b/crates/app/src/render.rs @@ -687,12 +687,7 @@ impl Render for Player { .child(height_probe(self.notice_h.clone())), ), ) - .child(self.transport_bar( - position, - state, - window.viewport_size(), - cx, - )), + .child(self.transport_bar(state, window.viewport_size(), cx)), ) .child(divider(Split::Inspector, cx)) // The settings cards live in here rather than over the diff --git a/crates/app/src/ui/toolbar.rs b/crates/app/src/ui/toolbar.rs index 687bb21..9e5ade7 100644 --- a/crates/app/src/ui/toolbar.rs +++ b/crates/app/src/ui/toolbar.rs @@ -148,7 +148,6 @@ impl Player { /// and the reason the edit toolbar below is nothing but edit tools. pub(crate) fn transport_bar( &self, - position: f64, state: Transport, viewport: Size, cx: &mut Context, @@ -209,12 +208,14 @@ impl Player { .text_color(rgb(FG_PRIMARY())) .child(format!( "{} / {}", - timecode(position, self.fps), timecode( - self.session - .as_ref() + self.active_session().map_or(0., PlaybackSession::now), + self.active_fps() + ), + timecode( + self.active_session() .map_or(0., PlaybackSession::timeline_duration), - self.fps + self.active_fps() ) )), )