Always allow rerunning the tasks using the tab button (#20591)

Release Notes:

- Improved task tabs to always rerun tasks on click
This commit is contained in:
Kirill Bulatov 2024-11-13 14:57:30 +01:00 committed by GitHub
parent b44078781d
commit 7e82ca8082
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1046,14 +1046,20 @@ impl Item for TerminalView {
.on_click(move |_, cx| {
cx.dispatch_action(Box::new(tasks_ui::Rerun {
task_id: Some(task_id.clone()),
..tasks_ui::Rerun::default()
allow_concurrent_runs: Some(true),
use_new_terminal: Some(false),
reevaluate_context: false,
}));
})
};
let (icon, icon_color, rerun_button) = match terminal.task() {
Some(terminal_task) => match &terminal_task.status {
TaskStatus::Running => (IconName::Play, Color::Disabled, None),
TaskStatus::Running => (
IconName::Play,
Color::Disabled,
Some(rerun_button(terminal_task.id.clone())),
),
TaskStatus::Unknown => (
IconName::Warning,
Color::Warning,