From 9027dcacb6c8e02ac4ab5712cfbd89dc1ffd5fe0 Mon Sep 17 00:00:00 2001 From: Casey Avila <53847249+caseyavila@users.noreply.github.com> Date: Wed, 26 Aug 2026 10:17:48 +0000 Subject: [PATCH] debugger: Update debug panel when breakpoint store changes (#63240) # Objective - There is currently a bug where toggling breakpoints would not be immediately reflected in the breakpoint list of the debug panel - For example, pressing `F9` to create a breakpoint would not immediately add an entry to the breakpoints list in the debug panel, instead requiring another event like mouse movement ## Solution - Subscribe the debug panel to changes to the breakpoint store. ## Testing - Manually tested ## Self-Review Checklist: - [X] I've reviewed my own diff for quality, security, and reliability - [X] Unsafe blocks (if any) have justifying comments - [X] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable ## Showcase https://github.com/user-attachments/assets/d2b7efab-0131-491e-8339-3657edaf7fcd https://github.com/user-attachments/assets/4161a435-c59e-4f6a-9387-31528c127c80 --- Release Notes: - Fixed debugger panel not immediately reflecting changes in toggled breakpoints --- crates/debugger_ui/src/debugger_panel.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/debugger_ui/src/debugger_panel.rs b/crates/debugger_ui/src/debugger_panel.rs index a55c07f528..e980e0a7cc 100644 --- a/crates/debugger_ui/src/debugger_panel.rs +++ b/crates/debugger_ui/src/debugger_panel.rs @@ -71,7 +71,7 @@ pub struct DebugPanel { pub(crate) session_picker_menu_handle: PopoverMenuHandle, fs: Arc, is_zoomed: bool, - _subscriptions: [Subscription; 1], + _subscriptions: [Subscription; 2], breakpoint_list: Entity, } @@ -95,6 +95,11 @@ impl DebugPanel { }, ); + let breakpoint_subscription = + cx.observe(&project.read(cx).breakpoint_store(), |_, _, cx| { + cx.notify(); + }); + Self { sessions_with_children: Default::default(), active_session: None, @@ -113,7 +118,7 @@ impl DebugPanel { thread_picker_menu_handle, session_picker_menu_handle, is_zoomed: false, - _subscriptions: [focus_subscription], + _subscriptions: [focus_subscription, breakpoint_subscription], debug_scenario_scheduled_last: true, } })