feat(gui2): Complete EventEmitter integration
This commit is contained in:
@@ -15,7 +15,7 @@ Identify and document the exact differences between `gui.py` and `gui_2.py`.
|
||||
Address all identified gaps and ensure functional equivalence.
|
||||
|
||||
- [x] Task: Implement missing panels and UX nuances (text sizing, font rendering) in `gui_2.py`. [a85293f]
|
||||
- [ ] Task: Complete integration of all `EventEmitter` hooks in `gui_2.py` to match `gui.py`.
|
||||
- [x] Task: Complete integration of all `EventEmitter` hooks in `gui_2.py` to match `gui.py`.
|
||||
- [ ] Task: Verify functional parity by running `tests/test_gui2_events.py` and `tests/test_gui2_layout.py`.
|
||||
- [ ] Task: Address any identified regressions or missing interactive elements.
|
||||
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Visual and Functional Parity Implementation' (Protocol in workflow.md)
|
||||
|
||||
12
gui_2.py
12
gui_2.py
@@ -239,6 +239,7 @@ class App:
|
||||
ai_client.comms_log_callback = self._on_comms_entry
|
||||
ai_client.tool_log_callback = self._on_tool_log
|
||||
mcp_client.perf_monitor_callback = self.perf_monitor.get_metrics
|
||||
self.perf_monitor.alert_callback = self._on_performance_alert
|
||||
|
||||
# AI client event subscriptions
|
||||
ai_client.events.on("request_start", self._on_api_event)
|
||||
@@ -404,6 +405,17 @@ class App:
|
||||
with self._pending_gui_tasks_lock:
|
||||
self._pending_gui_tasks.append({"action": "refresh_api_metrics", "payload": payload})
|
||||
|
||||
def _on_performance_alert(self, message: str):
|
||||
"""Called by PerformanceMonitor when a threshold is exceeded."""
|
||||
alert_text = f"[PERFORMANCE ALERT] {message}. Please consider optimizing recent changes or reducing load."
|
||||
# Inject into history as a 'System' message
|
||||
with self._pending_history_adds_lock:
|
||||
self._pending_history_adds.append({
|
||||
"role": "System",
|
||||
"content": alert_text,
|
||||
"ts": project_manager.now_ts()
|
||||
})
|
||||
|
||||
def _process_pending_gui_tasks(self):
|
||||
if not self._pending_gui_tasks:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user