Mention possible run options in the task modal placeholder (#8449)

Release Notes:

- Improved run task modal's placeholder

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
Kirill Bulatov
2024-02-27 00:04:56 +02:00
committed by GitHub
co-authored by Piotr Osiewicz
parent 009384f948
commit a0c8debd35
3 changed files with 24 additions and 20 deletions
+2 -16
View File
@@ -147,24 +147,10 @@ impl PickerDelegate for RecentProjectsDelegate {
type ListItem = ListItem;
fn placeholder_text(&self, cx: &mut WindowContext) -> Arc<str> {
let action_binding_text = |action: &dyn gpui::Action| {
cx.bindings_for_action(action)
.into_iter()
.next()
.map(|binding| {
binding
.keystrokes()
.into_iter()
.map(ToString::to_string)
.collect::<Vec<_>>()
.join(" ")
})
.unwrap_or_else(|| format!("{action:?}"))
};
Arc::from(format!(
"{} reuses the window, {} opens a new one",
action_binding_text(&menu::Confirm),
action_binding_text(&menu::SecondaryConfirm),
cx.keystroke_text_for(&menu::Confirm),
cx.keystroke_text_for(&menu::SecondaryConfirm),
))
}