debugger: Add close button and coloring to debug panel session's menu (#28310)

This PR adds colors to debug panel's session menu that indicate the
state of each respective session. It also adds a close button to each
entry.

green - running
yellow - stopped
red - terminated/ended 


Release Notes:

- N/A
This commit is contained in:
Anthony Eid 2025-04-08 12:35:33 -04:00 committed by GitHub
parent ee7b1ec7f2
commit 1774cad933
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 173 additions and 44 deletions

View file

@ -1,7 +1,7 @@
use super::{
breakpoint_store::BreakpointStore,
locator_store::LocatorStore,
session::{self, Session},
session::{self, Session, SessionStateEvent},
};
use crate::{ProjectEnvironment, debugger, worktree_store::WorktreeStore};
use anyhow::{Result, anyhow};
@ -869,6 +869,15 @@ fn create_new_session(
}
this.update(cx, |_, cx| {
cx.subscribe(
&session,
move |this: &mut DapStore, _, event: &SessionStateEvent, cx| match event {
SessionStateEvent::Shutdown => {
this.shutdown_session(session_id, cx).detach_and_log_err(cx);
}
},
)
.detach();
cx.emit(DapStoreEvent::DebugSessionInitialized(session_id));
})?;