From 21157f92c3af0fc2696f5454c8f0b5eda4744ed9 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Fri, 27 Feb 2026 22:30:55 -0500 Subject: [PATCH] feat(mma): Finalize Approval UX Modal in GUI --- gui_2.py | 2 ++ tests/test_mma_orchestration_gui.py | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/gui_2.py b/gui_2.py index 746afc2..5e4adfd 100644 --- a/gui_2.py +++ b/gui_2.py @@ -1886,6 +1886,8 @@ class App: imgui.open_popup("MMA Spawn Approval") self._mma_spawn_open = True self._mma_spawn_edit_mode = False + self._mma_spawn_prompt = self._pending_mma_spawn.get("prompt", "") + self._mma_spawn_context = self._pending_mma_spawn.get("context_md", "") else: self._mma_spawn_open = False diff --git a/tests/test_mma_orchestration_gui.py b/tests/test_mma_orchestration_gui.py index ac546ed..36d8e5e 100644 --- a/tests/test_mma_orchestration_gui.py +++ b/tests/test_mma_orchestration_gui.py @@ -82,3 +82,25 @@ def test_cb_plan_epic_launches_thread(app_instance): mock_get_history.assert_called_once() mock_gen_tracks.assert_called_once() + +def test_process_pending_gui_tasks_mma_spawn_approval(app_instance): + """Verifies that the 'mma_spawn_approval' action correctly updates the UI state.""" + task = { + "action": "mma_spawn_approval", + "ticket_id": "T1", + "role": "Tier 3 Worker", + "prompt": "Test Prompt", + "context_md": "Test Context", + "dialog_container": [None] + } + app_instance._pending_gui_tasks.append(task) + + app_instance._process_pending_gui_tasks() + + assert app_instance._pending_mma_spawn == task + assert app_instance._mma_spawn_prompt == "Test Prompt" + assert app_instance._mma_spawn_context == "Test Context" + assert app_instance._mma_spawn_open is True + assert app_instance._mma_spawn_edit_mode is False + assert task["dialog_container"][0] is not None + assert task["dialog_container"][0]._ticket_id == "T1"