feat(ui): Implement enhanced MMA track progress visualization with color-coded bars, breakdown, and ETA
This commit is contained in:
@@ -149,6 +149,9 @@ class AppController:
|
||||
self._cached_cache_stats: Dict[str, Any] = {} # Pre-computed cache stats for GUI
|
||||
self._token_history: List[Dict[str, Any]] = [] # Token usage over time [{"time": t, "input": n, "output": n, "model": s}, ...]
|
||||
self._session_start_time: float = time.time() # For calculating burn rate
|
||||
self._ticket_start_times: dict[str, float] = {}
|
||||
self._avg_ticket_time: float = 0.0
|
||||
self._completed_ticket_count: int = 0
|
||||
self._comms_log: List[Dict[str, Any]] = []
|
||||
self.session_usage: Dict[str, Any] = {
|
||||
"input_tokens": 0,
|
||||
@@ -573,6 +576,21 @@ class AppController:
|
||||
self._mma_spawn_edit_mode = False
|
||||
if "dialog_container" in task:
|
||||
task["dialog_container"][0] = spawn_dlg
|
||||
elif action == "ticket_started":
|
||||
payload = task.get("payload", {})
|
||||
ticket_id = payload.get("ticket_id")
|
||||
start_time = payload.get("timestamp")
|
||||
if ticket_id and start_time:
|
||||
self._ticket_start_times[ticket_id] = start_time
|
||||
elif action == "ticket_completed":
|
||||
payload = task.get("payload", {})
|
||||
ticket_id = payload.get("ticket_id")
|
||||
end_time = payload.get("timestamp")
|
||||
if ticket_id and end_time and ticket_id in self._ticket_start_times:
|
||||
start_time = self._ticket_start_times.pop(ticket_id)
|
||||
elapsed = end_time - start_time
|
||||
self._completed_ticket_count += 1
|
||||
self._avg_ticket_time = ((self._avg_ticket_time * (self._completed_ticket_count - 1)) + elapsed) / self._completed_ticket_count
|
||||
except Exception as e:
|
||||
import traceback
|
||||
sys.stderr.write(f"[DEBUG] Error executing GUI task: {e}\n{traceback.format_exc()}\n")
|
||||
@@ -902,6 +920,18 @@ class AppController:
|
||||
if self.test_hooks_enabled:
|
||||
with self._api_event_queue_lock:
|
||||
self._api_event_queue.append({"type": "response", "payload": payload})
|
||||
elif event_name == "ticket_started":
|
||||
with self._pending_gui_tasks_lock:
|
||||
self._pending_gui_tasks.append({
|
||||
"action": "ticket_started",
|
||||
"payload": payload
|
||||
})
|
||||
elif event_name == "ticket_completed":
|
||||
with self._pending_gui_tasks_lock:
|
||||
self._pending_gui_tasks.append({
|
||||
"action": "ticket_completed",
|
||||
"payload": payload
|
||||
})
|
||||
|
||||
def _handle_request_event(self, event: events.UserRequestEvent) -> None:
|
||||
"""Processes a UserRequestEvent by calling the AI client."""
|
||||
|
||||
Reference in New Issue
Block a user