Skip to content

Commit bc37783

Browse files
committed
Fix list scroll position drifting up after UI refresh
When the post count didn't change, apply_timeline_selection skipped set_selection if the index was already correct. This left any scroll drift from in-place set_string calls (LB_DELETESTRING + LB_INSERTSTRING while frozen) uncorrected, causing the viewport to sit a few rows above the selected item after a UI update. Always call set_selection so EnsureVisible runs after thaw, regardless of whether the selection index changed.
1 parent 936bb93 commit bc37783

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/ui/timeline_view.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ pub fn apply_timeline_selection(timeline_list: &ListBox, timeline: &mut Timeline
136136
timeline.selected_id = list_index_to_entry_index(selection, entries_len, sort_order)
137137
.map(|entry_index| timeline.entries[entry_index].id().to_string());
138138

139-
let current_ui_sel = timeline_list.get_selection().map(|s| s as usize);
140-
if current_ui_sel != Some(selection) {
141-
timeline_list.set_selection(selection as u32, true);
142-
}
139+
timeline_list.set_selection(selection as u32, true);
143140
}
144141

145142
pub fn update_active_timeline_ui(

0 commit comments

Comments
 (0)