Fix bugs in file finder (#4234)

* Fixed jumping of list item when the separator appeared and
disappeared.
* Fixed a bug where the selection got into a valid state when updating
the matches

Release Notes:

- Fixed an issue where the file finder's selection got into a state
where nothing was selected after filtering the matches.
This commit is contained in:
Max Brunsfeld 2024-01-23 16:33:52 -08:00 committed by GitHub
commit 26c901e2f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1242 additions and 1237 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@ use gpui::{
View, ViewContext, WindowContext,
};
use std::sync::Arc;
use ui::{prelude::*, v_flex, Color, Divider, Label, ListItem, ListItemSpacing, ListSeparator};
use ui::{prelude::*, v_flex, Color, Divider, Label, ListItem, ListItemSpacing};
use workspace::ModalView;
pub struct Picker<D: PickerDelegate> {
@ -296,7 +296,12 @@ impl<D: PickerDelegate> Render for Picker<D> {
ix,
ix == selected_index,
cx,
)).when(separators_after_indices.contains(&ix), |picker| picker.child(ListSeparator))
)).when(separators_after_indices.contains(&ix), |picker| {
picker
.border_color(cx.theme().colors().border_variant)
.border_b_1()
.pb(px(-1.0))
})
})
.collect()
}

View file

@ -10,7 +10,7 @@ extend-exclude = [
# Vim makes heavy use of partial typing tables
"crates/vim/*",
# Editor and file finder rely on partial typing and custom in-string syntax
"crates/file_finder/src/file_finder.rs",
"crates/file_finder/src/file_finder_tests.rs",
"crates/editor/src/editor_tests.rs",
# :/
"crates/collab/migrations/20231009181554_add_release_channel_to_rooms.sql",