gpui: Fix uniform list scroll to offset for Top and Bottom strategies (#39938)

Closes #39863

Regressed in https://github.com/zed-industries/zed/pull/36653

Release Notes:

- Fixed an issue where clicking a sticky item in the project panel
wouldn’t correctly scroll the view to show its start.
This commit is contained in:
Smit Barmase
2025-10-10 18:19:58 +05:30
committed by GitHub
parent c6373cc26d
commit 4dae3a15cc
2 changed files with 44 additions and 7 deletions
+1 -1
View File
@@ -4624,7 +4624,7 @@ impl ProjectPanel {
project_panel.marked_entries.clear();
if is_sticky
&& let Some((_, _, index)) = project_panel.index_for_entry(entry_id, worktree_id) {
project_panel.scroll_handle.scroll_to_item_with_offset(index, ScrollStrategy::Top, sticky_index.unwrap_or(0));
project_panel.scroll_handle.scroll_to_item_strict_with_offset(index, ScrollStrategy::Top, sticky_index.unwrap_or(0));
cx.notify();
// move down by 1px so that clicked item
// don't count as sticky anymore