debugger: Improve debugger panel empty state (#32889)
Before:  After:  Release Notes: - N/A (Beta: Improved the debugger panel when there are no currently active sessions)
This commit is contained in:
parent
dbc4ccd95a
commit
8883885ecb
5 changed files with 61 additions and 31 deletions
|
@ -1 +1 @@
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-blocks"><rect width="7" height="7" x="14" y="3" rx="1"/><path d="M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-blocks-icon lucide-blocks"><rect width="7" height="7" x="14" y="3" rx="1"/><path d="M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3"/></svg>
|
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 386 B |
|
@ -1428,33 +1428,57 @@ impl Render for DebugPanel {
|
||||||
.items_center()
|
.items_center()
|
||||||
.justify_center()
|
.justify_center()
|
||||||
.child(
|
.child(
|
||||||
h_flex().child(
|
h_flex()
|
||||||
Label::new("No Debugging Sessions")
|
.items_start()
|
||||||
.size(LabelSize::Small)
|
.gap_8()
|
||||||
.color(Color::Muted),
|
.child(
|
||||||
),
|
v_flex()
|
||||||
)
|
.gap_2()
|
||||||
.child(
|
.pr_8()
|
||||||
v_flex().gap_4().items_center()
|
.child(
|
||||||
.justify_center()
|
Button::new("spawn-new-session-empty-state", "New Session")
|
||||||
.child(
|
.icon(IconName::Plus)
|
||||||
h_flex().flex_shrink().child(
|
.icon_size(IconSize::XSmall)
|
||||||
Button::new("spawn-new-session-empty-state", "New Session")
|
.icon_color(Color::Muted)
|
||||||
.size(ButtonSize::Large)
|
.icon_position(IconPosition::Start)
|
||||||
.on_click(|_, window, cx| {
|
.on_click(|_, window, cx| {
|
||||||
window.dispatch_action(crate::Start.boxed_clone(), cx);
|
window.dispatch_action(crate::Start.boxed_clone(), cx);
|
||||||
})
|
})
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new("edit-debug-settings", "Edit debug.json")
|
||||||
|
.icon(IconName::Code)
|
||||||
|
.icon_size(IconSize::XSmall)
|
||||||
|
.color(Color::Muted)
|
||||||
|
.icon_color(Color::Muted)
|
||||||
|
.icon_position(IconPosition::Start)
|
||||||
|
.on_click(|_, window, cx| {
|
||||||
|
window.dispatch_action(zed_actions::OpenProjectDebugTasks.boxed_clone(), cx);
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new("open-debugger-docs", "Debugger Docs")
|
||||||
|
.icon(IconName::Book)
|
||||||
|
.color(Color::Muted)
|
||||||
|
.icon_size(IconSize::XSmall)
|
||||||
|
.icon_color(Color::Muted)
|
||||||
|
.icon_position(IconPosition::Start)
|
||||||
|
.on_click(|_, _, cx| {
|
||||||
|
cx.open_url("https://zed.dev/docs/debugger")
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Button::new("spawn-new-session-install-extensions", "Debugger Extensions")
|
||||||
|
.icon(IconName::Blocks)
|
||||||
|
.color(Color::Muted)
|
||||||
|
.icon_size(IconSize::XSmall)
|
||||||
|
.icon_color(Color::Muted)
|
||||||
|
.icon_position(IconPosition::Start)
|
||||||
|
.on_click(|_, window, cx| {
|
||||||
|
window.dispatch_action(zed_actions::Extensions { category_filter: Some(zed_actions::ExtensionCategoryFilter::DebugAdapters)}.boxed_clone(), cx);
|
||||||
|
})
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
.child(
|
|
||||||
h_flex().flex_shrink().child(
|
|
||||||
Button::new("spawn-new-session-install-extensions", "Install Debug Extensions")
|
|
||||||
.label_size(LabelSize::Small)
|
|
||||||
.on_click(|_, window, cx| {
|
|
||||||
window.dispatch_action(zed_actions::Extensions { category_filter: Some(zed_actions::ExtensionCategoryFilter::DebugAdapters)}.boxed_clone(), cx);
|
|
||||||
})
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@ actions!(
|
||||||
OpenDefaultSettings,
|
OpenDefaultSettings,
|
||||||
OpenProjectSettings,
|
OpenProjectSettings,
|
||||||
OpenProjectTasks,
|
OpenProjectTasks,
|
||||||
OpenProjectDebugTasks,
|
|
||||||
OpenTasks,
|
OpenTasks,
|
||||||
OpenDebugTasks,
|
OpenDebugTasks,
|
||||||
ResetDatabase,
|
ResetDatabase,
|
||||||
|
@ -1512,7 +1511,7 @@ fn open_project_tasks_file(
|
||||||
|
|
||||||
fn open_project_debug_tasks_file(
|
fn open_project_debug_tasks_file(
|
||||||
workspace: &mut Workspace,
|
workspace: &mut Workspace,
|
||||||
_: &OpenProjectDebugTasks,
|
_: &zed_actions::OpenProjectDebugTasks,
|
||||||
window: &mut Window,
|
window: &mut Window,
|
||||||
cx: &mut Context<Workspace>,
|
cx: &mut Context<Workspace>,
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -215,7 +215,7 @@ pub fn app_menus() -> Vec<Menu> {
|
||||||
MenuItem::action("Start Debugger", debugger_ui::Start),
|
MenuItem::action("Start Debugger", debugger_ui::Start),
|
||||||
MenuItem::separator(),
|
MenuItem::separator(),
|
||||||
MenuItem::action("Edit tasks.json...", crate::zed::OpenProjectTasks),
|
MenuItem::action("Edit tasks.json...", crate::zed::OpenProjectTasks),
|
||||||
MenuItem::action("Edit debug.json...", crate::zed::OpenProjectDebugTasks),
|
MenuItem::action("Edit debug.json...", zed_actions::OpenProjectDebugTasks),
|
||||||
MenuItem::separator(),
|
MenuItem::separator(),
|
||||||
MenuItem::action("Continue", debugger_ui::Continue),
|
MenuItem::action("Continue", debugger_ui::Continue),
|
||||||
MenuItem::action("Step Over", debugger_ui::StepOver),
|
MenuItem::action("Step Over", debugger_ui::StepOver),
|
||||||
|
|
|
@ -349,4 +349,11 @@ pub mod outline {
|
||||||
actions!(zed_predict_onboarding, [OpenZedPredictOnboarding]);
|
actions!(zed_predict_onboarding, [OpenZedPredictOnboarding]);
|
||||||
actions!(git_onboarding, [OpenGitIntegrationOnboarding]);
|
actions!(git_onboarding, [OpenGitIntegrationOnboarding]);
|
||||||
|
|
||||||
actions!(debugger, [ToggleEnableBreakpoint, UnsetBreakpoint]);
|
actions!(
|
||||||
|
debugger,
|
||||||
|
[
|
||||||
|
ToggleEnableBreakpoint,
|
||||||
|
UnsetBreakpoint,
|
||||||
|
OpenProjectDebugTasks,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue