From 54526a8f55c368cf1055cbd28637f42b8dd91809 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Tue, 27 Aug 2024 13:50:38 +0300 Subject: [PATCH] log: track virtual list splices These are caused when timeline note insertions are not at the top. egui-virtual-list only has optimizations for that scenario. Link: https://github.com/damus-io/notedeck/issues/94 Signed-off-by: William Casarin --- src/timeline.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/timeline.rs b/src/timeline.rs index c45e374..bbdb264 100644 --- a/src/timeline.rs +++ b/src/timeline.rs @@ -234,7 +234,13 @@ impl TimelineTab { match merge_kind { // TODO: update egui_virtual_list to support spliced inserts - MergeKind::Spliced => list.reset(), + MergeKind::Spliced => { + debug!( + "spliced when inserting {} new notes, resetting virtual list", + new_refs.len() + ); + list.reset(); + } MergeKind::FrontInsert => { // only run this logic if we're reverse-chronological // reversed in this case means chronological, since the