From 732001771e3a6aab89538f1d47f9a9856c1640da Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Sat, 31 Jan 2026 00:25:53 +0000 Subject: [PATCH] Fix artist list scrolling to bottom on click Restore saved scroll offset into ListState before select() so ratatui preserves the current viewport position instead of scrolling from zero. Co-Authored-By: Claude Opus 4.5 --- src/ui/pages/artists.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ui/pages/artists.rs b/src/ui/pages/artists.rs index ab7df5c..35269c3 100644 --- a/src/ui/pages/artists.rs +++ b/src/ui/pages/artists.rs @@ -156,6 +156,7 @@ fn render_tree(frame: &mut Frame, area: Rect, state: &mut AppState, colors: &The } let mut list_state = ListState::default(); + *list_state.offset_mut() = state.artists.tree_scroll_offset; if focused { list_state.select(state.artists.selected_index); } @@ -267,6 +268,7 @@ fn render_songs(frame: &mut Frame, area: Rect, state: &mut AppState, colors: &Th } let mut list_state = ListState::default(); + *list_state.offset_mut() = state.artists.song_scroll_offset; if focused { list_state.select(artists.selected_song); }