From 318f1fda71b7e45dfc630ae97dc22538590996e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 13 Aug 2026 08:25:04 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20fix(timeline):=20the=20line=20go?= =?UTF-8?q?es=20with=20the=20hand=20that=20left=20the=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A header carried off a row left its drop line painted there, promising a slot the release out in the open never commits to. The row takes its own line back down now -- its own, because gpui runs a drag-move listener on every painted row and not only on the one under the pointer, so a row clearing the cue outright would rub out the line the hovered row had just drawn. --- crates/app/src/main.rs | 10 ++++++++++ crates/app/src/ui/timeline.rs | 9 ++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index bd60616..e105257 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -3999,6 +3999,16 @@ impl Player { } } + /// The line taken back down again, by the row that drew it and by no other: + /// the pointer has been carried off `lane`, so the slot it was promising is + /// no longer the one a release would commit to. + fn forget_lane_drop(&mut self, lane: Lane, cx: &mut Context) { + if self.lane_drop.is_some_and(|d| d.lane == lane) { + self.lane_drop = None; + cx.notify(); + } + } + /// The same shadow for a library row: its head at [`Player::place_frame`], /// which is where the drop inserts it, and the file's own length for its /// width -- the length the library row already reports. A file this lane diff --git a/crates/app/src/ui/timeline.rs b/crates/app/src/ui/timeline.rs index 16f5bf3..6689697 100644 --- a/crates/app/src/ui/timeline.rs +++ b/crates/app/src/ui/timeline.rs @@ -822,8 +822,15 @@ impl Player { })) .on_drag_move(cx.listener( move |this, event: &DragMoveEvent, _, cx| { + // Carried off this row, the line it was promising goes with + // it: a cue left painted over a slot a release out here does + // not commit is the drag saying one thing and the drop + // doing another. Its *own* promise only -- gpui runs this on + // every painted row, not just the one under the pointer, so + // a row that cleared the cue outright would rub out the line + // the hovered row had just drawn. if !event.bounds.contains(&event.event.position) { - return; + return this.forget_lane_drop(lane, cx); } this.preview_lane_drop(event.drag(cx).0, lane, cx); },