From 4577d0e82f4c0542a8c9f84a1e1e28b6e7bea72b Mon Sep 17 00:00:00 2001 From: jinxin <106428113+italic-jinxin@users.noreply.github.com> Date: Mon, 20 Apr 2026 23:13:01 +0800 Subject: [PATCH] fix(gateway): wire standalone missions tab (load, back, refresh) (#2745) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three parallel wiring gaps in the engine v2 Missions tab — each one was code that only handled the Projects drill-in (cr-*) path and silently no-op'd on the standalone tab, so the surface looked empty or frozen even when the backend returned data: - switchTab had no branch for 'missions', so opening the tab rendered the panel shell but never fetched data. /api/engine/missions returned rows; the table stayed empty. - close-mission-detail only hid the cr-detail drawer, so the Back button on the standalone detail view did nothing. - refreshMissionView refreshed the detail view or the project drill-in but not the Missions list, so fire/pause/resume actions succeeded but the list stayed stale. [skip-regression-check] --- crates/ironclaw_gateway/static/js/core/history.js | 1 + crates/ironclaw_gateway/static/js/core/ui-helpers.js | 6 +++++- crates/ironclaw_gateway/static/js/surfaces/projects.js | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/ironclaw_gateway/static/js/core/history.js b/crates/ironclaw_gateway/static/js/core/history.js index 67fc531ca1..0f3a6ba507 100644 --- a/crates/ironclaw_gateway/static/js/core/history.js +++ b/crates/ironclaw_gateway/static/js/core/history.js @@ -732,6 +732,7 @@ function switchTab(tab) { // the Projects tab so widgets don't keep running in the background. crBackToOverview(); } + if (tab === 'missions') loadMissions(); if (tab === 'routines') loadRoutines(); if (tab === 'logs') { connectLogSSE(); applyLogFilters(); } else if (logEventSource) { logEventSource.close(); logEventSource = null; } diff --git a/crates/ironclaw_gateway/static/js/core/ui-helpers.js b/crates/ironclaw_gateway/static/js/core/ui-helpers.js index 03c9e0bf9b..70d018aba7 100644 --- a/crates/ironclaw_gateway/static/js/core/ui-helpers.js +++ b/crates/ironclaw_gateway/static/js/core/ui-helpers.js @@ -346,7 +346,11 @@ document.addEventListener('click', function(e) { openMissionDetail(el.dataset.id); break; case 'close-mission-detail': - if (crCurrentProjectId) { document.getElementById('cr-detail').style.display = 'none'; } + if (crCurrentProjectId) { + document.getElementById('cr-detail').style.display = 'none'; + } else { + closeMissionDetail(); + } break; case 'fire-mission': e.stopPropagation(); diff --git a/crates/ironclaw_gateway/static/js/surfaces/projects.js b/crates/ironclaw_gateway/static/js/surfaces/projects.js index b488ceec31..d889c9acd1 100644 --- a/crates/ironclaw_gateway/static/js/surfaces/projects.js +++ b/crates/ironclaw_gateway/static/js/surfaces/projects.js @@ -813,6 +813,8 @@ function refreshMissionView(missionId) { openMissionDetail(missionId); } else if (crCurrentProjectId) { drillIntoProject(crCurrentProjectId); + } else if (currentTab === 'missions') { + loadMissions(); } }