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:
parent
804de3316e
commit
1445af559b
12 changed files with 434 additions and 224 deletions
|
@ -5,7 +5,7 @@ use crate::{
|
|||
ClearAllBreakpoints, Continue, Detach, FocusBreakpointList, FocusConsole, FocusFrames,
|
||||
FocusLoadedSources, FocusModules, FocusTerminal, FocusVariables, Pause, Restart,
|
||||
ShowStackTrace, StepBack, StepInto, StepOut, StepOver, Stop, ToggleIgnoreBreakpoints,
|
||||
ToggleSessionPicker, ToggleThreadPicker, persistence,
|
||||
ToggleSessionPicker, ToggleThreadPicker, persistence, spawn_task_or_modal,
|
||||
};
|
||||
use anyhow::{Context as _, Result, anyhow};
|
||||
use command_palette_hooks::CommandPaletteFilter;
|
||||
|
@ -65,6 +65,7 @@ pub struct DebugPanel {
|
|||
workspace: WeakEntity<Workspace>,
|
||||
focus_handle: FocusHandle,
|
||||
context_menu: Option<(Entity<ContextMenu>, Point<Pixels>, Subscription)>,
|
||||
debug_scenario_scheduled_last: bool,
|
||||
pub(crate) thread_picker_menu_handle: PopoverMenuHandle<ContextMenu>,
|
||||
pub(crate) session_picker_menu_handle: PopoverMenuHandle<ContextMenu>,
|
||||
fs: Arc<dyn Fs>,
|
||||
|
@ -103,6 +104,7 @@ impl DebugPanel {
|
|||
thread_picker_menu_handle,
|
||||
session_picker_menu_handle,
|
||||
_subscriptions: [focus_subscription],
|
||||
debug_scenario_scheduled_last: true,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -264,6 +266,7 @@ impl DebugPanel {
|
|||
cx,
|
||||
)
|
||||
});
|
||||
self.debug_scenario_scheduled_last = true;
|
||||
if let Some(inventory) = self
|
||||
.project
|
||||
.read(cx)
|
||||
|
@ -1381,4 +1384,30 @@ impl workspace::DebuggerProvider for DebuggerProvider {
|
|||
})
|
||||
})
|
||||
}
|
||||
|
||||
fn spawn_task_or_modal(
|
||||
&self,
|
||||
workspace: &mut Workspace,
|
||||
action: &tasks_ui::Spawn,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Workspace>,
|
||||
) {
|
||||
spawn_task_or_modal(workspace, action, window, cx);
|
||||
}
|
||||
|
||||
fn debug_scenario_scheduled(&self, cx: &mut App) {
|
||||
self.0.update(cx, |this, _| {
|
||||
this.debug_scenario_scheduled_last = true;
|
||||
});
|
||||
}
|
||||
|
||||
fn task_scheduled(&self, cx: &mut App) {
|
||||
self.0.update(cx, |this, _| {
|
||||
this.debug_scenario_scheduled_last = false;
|
||||
})
|
||||
}
|
||||
|
||||
fn debug_scenario_scheduled_last(&self, cx: &App) -> bool {
|
||||
self.0.read(cx).debug_scenario_scheduled_last
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue