Unify the tasks modal and the new session modal (#31646)

Release Notes:

- Debugger Beta: added a button to the quick action bar to start a debug
session or spawn a task, depending on which of these actions was taken
most recently.
- Debugger Beta: incorporated the tasks modal into the new session modal
as an additional tab.

---------

Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com>
Co-authored-by: Julia Ryan <p1n3appl3@users.noreply.github.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Cole Miller 2025-05-29 21:33:52 -04:00 committed by GitHub
parent 804de3316e
commit 1445af559b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 434 additions and 224 deletions

View file

@ -133,6 +133,46 @@ impl Render for QuickActionBar {
)
});
let last_run_debug = self
.workspace
.read_with(cx, |workspace, cx| {
workspace
.debugger_provider()
.map(|provider| provider.debug_scenario_scheduled_last(cx))
.unwrap_or_default()
})
.ok()
.unwrap_or_default();
let run_button = if last_run_debug {
QuickActionBarButton::new(
"debug",
IconName::Debug, // TODO: use debug + play icon
false,
Box::new(debugger_ui::Start),
focus_handle.clone(),
"Debug",
move |_, window, cx| {
window.dispatch_action(Box::new(debugger_ui::Start), cx);
},
)
} else {
let action = Box::new(tasks_ui::Spawn::ViaModal {
reveal_target: None,
});
QuickActionBarButton::new(
"run",
IconName::Play,
false,
action.boxed_clone(),
focus_handle.clone(),
"Spawn Task",
move |_, window, cx| {
window.dispatch_action(action.boxed_clone(), cx);
},
)
};
let assistant_button = QuickActionBarButton::new(
"toggle inline assistant",
IconName::ZedAssistant,
@ -561,6 +601,7 @@ impl Render for QuickActionBar {
AgentSettings::get_global(cx).enabled && AgentSettings::get_global(cx).button,
|bar| bar.child(assistant_button),
)
.child(run_button)
.children(code_actions_dropdown)
.children(editor_selections_dropdown)
.child(editor_settings_dropdown)