mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-03 08:54:04 +00:00
assistant2: Add check icon for included context (#22774)
Quick follow-up to: https://github.com/zed-industries/zed/pull/22712 — just to make it more visually easier to understand. <img width="800" alt="Screenshot 2025-01-07 at 11 48 06 AM" src="https://github.com/user-attachments/assets/92f0523b-eb85-4929-a825-2e1e524b3ad7" /> Release Notes: - N/A
This commit is contained in:
parent
44c492b3c0
commit
f439ee0d55
4 changed files with 51 additions and 10 deletions
|
@ -304,7 +304,16 @@ impl PickerDelegate for DirectoryContextPickerDelegate {
|
|||
.toggle_state(selected)
|
||||
.child(h_flex().gap_2().child(Label::new(directory_name)))
|
||||
.when(added, |el| {
|
||||
el.end_slot(Label::new("Added").size(LabelSize::XSmall))
|
||||
el.end_slot(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::Check)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Success),
|
||||
)
|
||||
.child(Label::new("Added").size(LabelSize::Small)),
|
||||
)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -243,9 +243,16 @@ impl PickerDelegate for FetchContextPickerDelegate {
|
|||
.toggle_state(selected)
|
||||
.child(Label::new(self.url.clone()))
|
||||
.when(added, |child| {
|
||||
child
|
||||
.disabled(true)
|
||||
.end_slot(Label::new("Added").size(LabelSize::XSmall))
|
||||
child.disabled(true).end_slot(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::Check)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Success),
|
||||
)
|
||||
.child(Label::new("Added").size(LabelSize::Small)),
|
||||
)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -322,14 +322,30 @@ impl PickerDelegate for FileContextPickerDelegate {
|
|||
})),
|
||||
)
|
||||
.when_some(added, |el, added| match added {
|
||||
IncludedFile::Direct(_) => {
|
||||
el.end_slot(Label::new("Added").size(LabelSize::XSmall))
|
||||
}
|
||||
IncludedFile::Direct(_) => el.end_slot(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::Check)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Success),
|
||||
)
|
||||
.child(Label::new("Added").size(LabelSize::Small)),
|
||||
),
|
||||
IncludedFile::InDirectory(dir_name) => {
|
||||
let dir_name = dir_name.to_string_lossy().into_owned();
|
||||
|
||||
el.end_slot(Label::new("Included").size(LabelSize::XSmall))
|
||||
.tooltip(move |cx| Tooltip::text(format!("in {dir_name}"), cx))
|
||||
el.end_slot(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::Check)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Success),
|
||||
)
|
||||
.child(Label::new("Included").size(LabelSize::Small)),
|
||||
)
|
||||
.tooltip(move |cx| Tooltip::text(format!("in {dir_name}"), cx))
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
|
|
@ -209,7 +209,16 @@ impl PickerDelegate for ThreadContextPickerDelegate {
|
|||
.toggle_state(selected)
|
||||
.child(Label::new(thread.summary.clone()))
|
||||
.when(added, |el| {
|
||||
el.end_slot(Label::new("Added").size(LabelSize::XSmall))
|
||||
el.end_slot(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::Check)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Success),
|
||||
)
|
||||
.child(Label::new("Added").size(LabelSize::Small)),
|
||||
)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue