From d6c550c8382462b5cec334974e05fc7787e66a87 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Mon, 24 Nov 2025 12:28:23 -0300 Subject: [PATCH] debugger_ui: Add button to close the panel when docked to bottom (#43409) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR adds a button to close the panel when it is docked to the bottom. Effectively, the button triggers the same `ToggleBottomDock` action that clicking on the button that opened the panel triggers, but I think having it there just makes it extra obvious how to close it, which is beneficial. As a bonus, also fixed the panel controls container height when it is docked to the sides, so it perfectly aligns with the panel tabbar height. | Perfectly Aligned Header | Close Button | |--------|--------| | Screenshot 2025-11-24 at 12  01
2@2x | Screenshot 2025-11-24 at 12 
01@2x | Release Notes: - N/A --- crates/debugger_ui/src/debugger_panel.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/debugger_ui/src/debugger_panel.rs b/crates/debugger_ui/src/debugger_panel.rs index 0a5dc744cde6ba053a2c5a5100538100a7d6a49b..3890fa6326329d0d72aa6f81c6b94e7c2f364d34 100644 --- a/crates/debugger_ui/src/debugger_panel.rs +++ b/crates/debugger_ui/src/debugger_panel.rs @@ -651,6 +651,17 @@ impl DebugPanel { .tooltip(Tooltip::text("Open Debug Adapter Logs")) }; + let close_bottom_panel_button = { + h_flex().pl_0p5().gap_1().child(Divider::vertical()).child( + IconButton::new("debug-close-panel", IconName::Close) + .icon_size(IconSize::Small) + .on_click(move |_, window, cx| { + window.dispatch_action(workspace::ToggleBottomDock.boxed_clone(), cx) + }) + .tooltip(Tooltip::text("Close Panel")), + ) + }; + Some( div.w_full() .py_1() @@ -658,7 +669,7 @@ impl DebugPanel { .justify_between() .border_b_1() .border_color(cx.theme().colors().border) - .when(is_side, |this| this.gap_1()) + .when(is_side, |this| this.gap_1().h(Tab::container_height(cx))) .child( h_flex() .justify_between() @@ -957,6 +968,7 @@ impl DebugPanel { .child(edit_debug_json_button()) .child(documentation_button()) .child(logs_button()) + .child(close_bottom_panel_button) }), ), ),