_gui_func annotations to gui_func

This commit is contained in:
2026-05-10 20:26:27 -04:00
parent f83629dc85
commit 2fa44c02c8
2 changed files with 62 additions and 39 deletions
+37 -14
View File
@@ -789,14 +789,13 @@ class App:
if self.is_viewing_prior_session:
imgui.push_style_color(imgui.Col_.window_bg, vec4(50, 40, 20))
pushed_prior_tint = True
#region: Absurd Try Scope
try:
self.perf_monitor.start_frame()
self._autofocus_response_tab = self.controller._autofocus_response_tab
# Process GUI task queue
#region: Process GUI task queue
# DEBUG: Check if tasks exist before processing
if hasattr(self, 'controller') and hasattr(self.controller, '_pending_gui_tasks'):
pending_count = len(self.controller._pending_gui_tasks)
@@ -807,6 +806,8 @@ class App:
self._process_pending_history_adds()
if self.controller._process_pending_tool_calls():
self._tool_log_dirty = True
#endregion: Process GUI task queue
self._render_track_proposal_modal()
self._render_patch_modal()
self._render_base_prompt_diff_modal()
@@ -815,6 +816,7 @@ class App:
self._render_preset_manager_window()
self._render_tool_preset_manager_window()
self._render_persona_editor_window()
# Auto-save (every 60s)
now = time.time()
if now - self._last_autosave >= self._autosave_interval:
@@ -1028,6 +1030,7 @@ class App:
imgui.end()
#endregion: AI Settings
#region: Seprate Task Dag to Tier 4
if self.ui_separate_task_dag and self.show_windows.get("Task DAG", False):
exp, opened = imgui.begin("Task DAG", self.show_windows["Task DAG"])
self.show_windows["Task DAG"] = bool(opened)
@@ -1062,6 +1065,7 @@ class App:
if exp:
self._render_tier_stream_panel("Tier 4", "Tier 4 (QA)")
imgui.end()
#endregion: Separate Task Dag to Tier 4
if self.show_windows.get("Theme", False):
self._render_theme_panel()
@@ -1147,6 +1151,7 @@ class App:
imgui.end()
#endregion: Operations Hub
#region: Separate Message, Response, Tool Calls, External Tools
if self.ui_separate_message_panel and self.show_windows.get("Message", False):
exp, opened = imgui.begin("Message", self.show_windows["Message"])
self.show_windows["Message"] = bool(opened)
@@ -1179,13 +1184,15 @@ class App:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_log_management")
self._render_log_management()
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_log_management")
#endregion: Separate Message, Response, Tool Calls, External Tools
if self.show_windows.get("Diagnostics", False):
self._render_diagnostics_panel()
self.perf_monitor.end_frame()
# ---- Modals / Popups
# Modals / Popups
with self._pending_dialog_lock:
dlg = self._pending_dialog
if dlg:
@@ -1194,6 +1201,7 @@ class App:
self._pending_dialog_open = True
else:
self._pending_dialog_open = False
if imgui.begin_popup_modal("Approve PowerShell Command", None, imgui.WindowFlags_.always_auto_resize)[0]:
if not dlg:
imgui.close_current_popup()
@@ -1228,12 +1236,14 @@ class App:
self._pending_dialog = None
imgui.close_current_popup()
imgui.end_popup()
if self._pending_ask_dialog:
if not self._ask_dialog_open:
imgui.open_popup("Approve Tool Execution")
self._ask_dialog_open = True
else:
self._ask_dialog_open = False
if imgui.begin_popup_modal("Approve Tool Execution", None, imgui.WindowFlags_.always_auto_resize)[0]:
if not self._pending_ask_dialog or self._ask_tool_data is None:
imgui.close_current_popup()
@@ -1256,7 +1266,8 @@ class App:
self._handle_reject_ask()
imgui.close_current_popup()
imgui.end_popup()
# MMA Step Approval Modal
#region: MMA Step Approval Modal
if self._pending_mma_approvals:
if not self._mma_approval_open:
imgui.open_popup("MMA Step Approval")
@@ -1292,7 +1303,9 @@ class App:
self._handle_mma_respond(approved=False)
imgui.close_current_popup()
imgui.end_popup()
# MMA Spawn Approval Modal
#endregion: MMA Step Approval Modal
#region: MMA Spawn Approval Modal
if self._pending_mma_spawns:
if not self._mma_spawn_open:
imgui.open_popup("MMA Spawn Approval")
@@ -1302,6 +1315,7 @@ class App:
self._mma_spawn_context = self._pending_mma_spawns[0].get("context_md", "")
else:
self._mma_spawn_open = False
if imgui.begin_popup_modal("MMA Spawn Approval", None, imgui.WindowFlags_.always_auto_resize)[0]:
if not self._pending_mma_spawns:
imgui.close_current_popup()
@@ -1336,7 +1350,9 @@ class App:
self._handle_mma_respond(approved=False, abort=True)
imgui.close_current_popup()
imgui.end_popup()
# Cycle Detected Popup
#endregion: MMA Spawn Approval Modal
#region: Cycle Detected Popup
if imgui.begin_popup_modal("Cycle Detected!", None, imgui.WindowFlags_.always_auto_resize)[0]:
imgui.text_colored(imgui.ImVec4(1, 0.3, 0.3, 1), "The dependency graph contains a cycle!")
imgui.text("Please remove the circular dependency.")
@@ -1425,14 +1441,14 @@ class App:
if to_remove != -1:
self.ui_editing_slices_file.custom_slices.pop(to_remove)
imgui.separator()
# Toolbar
if imgui.button("Copy"):
imgui.set_clipboard_text(self.text_viewer_content)
imgui.same_line()
_, self.text_viewer_wrap = imgui.checkbox("Word Wrap", self.text_viewer_wrap)
imgui.separator()
renderer = markdown_helper.get_renderer()
tv_type = getattr(self, "text_viewer_type", "text")
@@ -1463,10 +1479,13 @@ class App:
else:
imgui.input_text_multiline("##tv_c", self.text_viewer_content, imgui.ImVec2(-1, -1), imgui.InputTextFlags_.read_only)
imgui.end()
# Inject File Modal
#endregion: Cycle Detected Popup
#region: Inject File Modal
if getattr(self, "show_inject_modal", False):
imgui.open_popup("Inject File")
self.show_inject_modal = False
if imgui.begin_popup_modal("Inject File", None, imgui.WindowFlags_.always_auto_resize)[0]:
files = self.project.get('files', {}).get('paths', [])
imgui.text("Select File to Inject:")
@@ -1506,8 +1525,10 @@ class App:
if imgui.button("Cancel", imgui.ImVec2(120, 0)):
imgui.close_current_popup()
imgui.end_popup()
#endregion: Inject File Modal
self._render_ast_inspector_modal()
#endregion: Absurd Try Scope
except Exception as e:
print(f"ERROR in _gui_func: {e}")
@@ -2907,6 +2928,7 @@ class App:
imgui.separator()
#region: Screenshots
if imgui.collapsing_header("Screenshots"):
for i, s in enumerate(self.screenshots):
imgui.text(s)
@@ -2940,6 +2962,7 @@ class App:
if getattr(self, "ui_active_context_preset", ""):
self.delete_context_preset(self.ui_active_context_preset)
self.ui_active_context_preset = ""
#endregion Screenshots
def _render_snapshot_tab(self) -> None:
if imgui.begin_tab_bar("snapshot_tabs"):