feat: close flyout when targeted session disappears

This commit is contained in:
Brian Krabach
2026-04-15 21:25:13 -07:00
parent 95bfc36fd8
commit 2d136f1ff7
2 changed files with 21 additions and 0 deletions
+10
View File
@@ -1384,6 +1384,16 @@ function renderGrid(sessions) {
var emptyState = $('empty-state');
var filterBar = $('filter-bar');
// Close flyout if the targeted session no longer exists
if (_flyoutSessionKey) {
var flyoutStillExists = (sessions || []).some(function(s) {
return (s.sessionKey || s.name) === _flyoutSessionKey;
});
if (!flyoutStillExists) {
closeFlyoutMenu();
}
}
var visible = getVisibleSessions(sessions);
if (visible.length === 0) {
+11
View File
@@ -3953,3 +3953,14 @@ def test_render_grid_has_add_sessions_affordance() -> None:
assert "add-sessions" in fn_body.lower() or "openAddSessionsPanel" in fn_body, (
"renderGrid must render an 'Add Sessions' affordance for user views"
)
# ─── Task 12: Session death detection ────────────────────────────────────────
def test_render_grid_closes_stale_flyout() -> None:
"""renderGrid must close the flyout if the targeted session no longer exists."""
fn_body = _JS.split("function renderGrid")[1].split("\nfunction ")[0]
assert "_flyoutSessionKey" in fn_body or "closeFlyoutMenu" in fn_body, (
"renderGrid must check if the flyout's target session still exists and close if not"
)