_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
+25 -25
View File
@@ -74,8 +74,8 @@ Collapsed=0
DockId=0xAFC85805,2 DockId=0xAFC85805,2
[Window][Theme] [Window][Theme]
Pos=0,32 Pos=0,37
Size=1355,1768 Size=2011,2123
Collapsed=0 Collapsed=0
DockId=0x00000005,3 DockId=0x00000005,3
@@ -102,26 +102,26 @@ Collapsed=0
DockId=0x0000000D,0 DockId=0x0000000D,0
[Window][Discussion Hub] [Window][Discussion Hub]
Pos=1357,32 Pos=2013,37
Size=1523,1768 Size=1827,2123
Collapsed=0 Collapsed=0
DockId=0x00000006,0 DockId=0x00000006,0
[Window][Operations Hub] [Window][Operations Hub]
Pos=0,32 Pos=0,37
Size=1355,1768 Size=2011,2123
Collapsed=0 Collapsed=0
DockId=0x00000005,2 DockId=0x00000005,2
[Window][Files & Media] [Window][Files & Media]
Pos=1357,32 Pos=2013,37
Size=1523,1768 Size=1827,2123
Collapsed=0 Collapsed=0
DockId=0x00000006,1 DockId=0x00000006,1
[Window][AI Settings] [Window][AI Settings]
Pos=0,32 Pos=0,37
Size=1355,1768 Size=2011,2123
Collapsed=0 Collapsed=0
DockId=0x00000005,0 DockId=0x00000005,0
@@ -406,14 +406,14 @@ Collapsed=0
DockId=0x00000006,1 DockId=0x00000006,1
[Window][Project Settings] [Window][Project Settings]
Pos=0,32 Pos=0,37
Size=1355,1768 Size=2011,2123
Collapsed=0 Collapsed=0
DockId=0x00000005,1 DockId=0x00000005,1
[Window][Undo/Redo History] [Window][Undo/Redo History]
Pos=2256,413 Pos=2420,28
Size=460,1312 Size=460,1772
Collapsed=0 Collapsed=0
DockId=0x00000002,0 DockId=0x00000002,0
@@ -549,13 +549,13 @@ Column 1 Weight=1.0000
[Table][0x1DA1F4A6,2] [Table][0x1DA1F4A6,2]
RefScale=29 RefScale=29
Column 0 Weight=1.0000 Column 0 Weight=1.0000
Column 1 Width=545 Column 1 Width=543
[Table][0x5B562C13,3] [Table][0x5B562C13,3]
RefScale=29 RefScale=20
Column 0 Weight=1.0000 Column 0 Weight=1.0000
Column 1 Width=145 Column 1 Width=100
Column 2 Width=271 Column 2 Width=186
[Table][0x17AC2E33,4] [Table][0x17AC2E33,4]
RefScale=20 RefScale=20
@@ -566,22 +566,22 @@ Column 3 Width=40
[Table][0x62A953DF,5] [Table][0x62A953DF,5]
RefScale=29 RefScale=29
Column 0 Width=62 Column 0 Width=60
Column 1 Weight=1.0000 Column 1 Weight=1.0000
Column 2 Width=102 Column 2 Width=101
Column 3 Width=134 Column 3 Width=133
Column 4 Width=103 Column 4 Width=102
[Docking][Data] [Docking][Data]
DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y
DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A
DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02 DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02
DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,32 Size=2880,1768 Split=X DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,37 Size=3840,2123 Split=X
DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2254,1183 Split=X DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2254,1183 Split=X
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2 DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=1512,858 Split=X Selected=0x8CA2375C DockNode ID=0x00000007 Parent=0x0000000B SizeRef=1512,858 Split=X Selected=0x8CA2375C
DockNode ID=0x00000005 Parent=0x00000007 SizeRef=1355,1681 CentralNode=1 Selected=0x8CA2375C DockNode ID=0x00000005 Parent=0x00000007 SizeRef=1051,1681 CentralNode=1 Selected=0x418C7449
DockNode ID=0x00000006 Parent=0x00000007 SizeRef=1523,1681 Selected=0x6F2B5B04 DockNode ID=0x00000006 Parent=0x00000007 SizeRef=1827,1681 Selected=0x6F2B5B04
DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1777,858 Selected=0x418C7449 DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1777,858 Selected=0x418C7449
DockNode ID=0x0000000D Parent=0x00000003 SizeRef=435,1186 Selected=0x363E93D6 DockNode ID=0x0000000D Parent=0x00000003 SizeRef=435,1186 Selected=0x363E93D6
DockNode ID=0x00000004 Parent=0xAFC85805 SizeRef=460,1183 Split=X Selected=0x3AEC3498 DockNode ID=0x00000004 Parent=0xAFC85805 SizeRef=460,1183 Split=X Selected=0x3AEC3498
+31 -8
View File
@@ -790,13 +790,12 @@ class App:
imgui.push_style_color(imgui.Col_.window_bg, vec4(50, 40, 20)) imgui.push_style_color(imgui.Col_.window_bg, vec4(50, 40, 20))
pushed_prior_tint = True pushed_prior_tint = True
#region: Absurd Try Scope #region: Absurd Try Scope
try: try:
self.perf_monitor.start_frame() self.perf_monitor.start_frame()
self._autofocus_response_tab = self.controller._autofocus_response_tab 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 # DEBUG: Check if tasks exist before processing
if hasattr(self, 'controller') and hasattr(self.controller, '_pending_gui_tasks'): if hasattr(self, 'controller') and hasattr(self.controller, '_pending_gui_tasks'):
pending_count = len(self.controller._pending_gui_tasks) pending_count = len(self.controller._pending_gui_tasks)
@@ -807,6 +806,8 @@ class App:
self._process_pending_history_adds() self._process_pending_history_adds()
if self.controller._process_pending_tool_calls(): if self.controller._process_pending_tool_calls():
self._tool_log_dirty = True self._tool_log_dirty = True
#endregion: Process GUI task queue
self._render_track_proposal_modal() self._render_track_proposal_modal()
self._render_patch_modal() self._render_patch_modal()
self._render_base_prompt_diff_modal() self._render_base_prompt_diff_modal()
@@ -815,6 +816,7 @@ class App:
self._render_preset_manager_window() self._render_preset_manager_window()
self._render_tool_preset_manager_window() self._render_tool_preset_manager_window()
self._render_persona_editor_window() self._render_persona_editor_window()
# Auto-save (every 60s) # Auto-save (every 60s)
now = time.time() now = time.time()
if now - self._last_autosave >= self._autosave_interval: if now - self._last_autosave >= self._autosave_interval:
@@ -1028,6 +1030,7 @@ class App:
imgui.end() imgui.end()
#endregion: AI Settings #endregion: AI Settings
#region: Seprate Task Dag to Tier 4
if self.ui_separate_task_dag and self.show_windows.get("Task DAG", False): 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"]) exp, opened = imgui.begin("Task DAG", self.show_windows["Task DAG"])
self.show_windows["Task DAG"] = bool(opened) self.show_windows["Task DAG"] = bool(opened)
@@ -1062,6 +1065,7 @@ class App:
if exp: if exp:
self._render_tier_stream_panel("Tier 4", "Tier 4 (QA)") self._render_tier_stream_panel("Tier 4", "Tier 4 (QA)")
imgui.end() imgui.end()
#endregion: Separate Task Dag to Tier 4
if self.show_windows.get("Theme", False): if self.show_windows.get("Theme", False):
self._render_theme_panel() self._render_theme_panel()
@@ -1147,6 +1151,7 @@ class App:
imgui.end() imgui.end()
#endregion: Operations Hub #endregion: Operations Hub
#region: Separate Message, Response, Tool Calls, External Tools
if self.ui_separate_message_panel and self.show_windows.get("Message", False): if self.ui_separate_message_panel and self.show_windows.get("Message", False):
exp, opened = imgui.begin("Message", self.show_windows["Message"]) exp, opened = imgui.begin("Message", self.show_windows["Message"])
self.show_windows["Message"] = bool(opened) 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") if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_log_management")
self._render_log_management() self._render_log_management()
if self.perf_profiling_enabled: self.perf_monitor.end_component("_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): if self.show_windows.get("Diagnostics", False):
self._render_diagnostics_panel() self._render_diagnostics_panel()
self.perf_monitor.end_frame() self.perf_monitor.end_frame()
# ---- Modals / Popups # Modals / Popups
with self._pending_dialog_lock: with self._pending_dialog_lock:
dlg = self._pending_dialog dlg = self._pending_dialog
if dlg: if dlg:
@@ -1194,6 +1201,7 @@ class App:
self._pending_dialog_open = True self._pending_dialog_open = True
else: else:
self._pending_dialog_open = False self._pending_dialog_open = False
if imgui.begin_popup_modal("Approve PowerShell Command", None, imgui.WindowFlags_.always_auto_resize)[0]: if imgui.begin_popup_modal("Approve PowerShell Command", None, imgui.WindowFlags_.always_auto_resize)[0]:
if not dlg: if not dlg:
imgui.close_current_popup() imgui.close_current_popup()
@@ -1228,12 +1236,14 @@ class App:
self._pending_dialog = None self._pending_dialog = None
imgui.close_current_popup() imgui.close_current_popup()
imgui.end_popup() imgui.end_popup()
if self._pending_ask_dialog: if self._pending_ask_dialog:
if not self._ask_dialog_open: if not self._ask_dialog_open:
imgui.open_popup("Approve Tool Execution") imgui.open_popup("Approve Tool Execution")
self._ask_dialog_open = True self._ask_dialog_open = True
else: else:
self._ask_dialog_open = False self._ask_dialog_open = False
if imgui.begin_popup_modal("Approve Tool Execution", None, imgui.WindowFlags_.always_auto_resize)[0]: 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: if not self._pending_ask_dialog or self._ask_tool_data is None:
imgui.close_current_popup() imgui.close_current_popup()
@@ -1256,7 +1266,8 @@ class App:
self._handle_reject_ask() self._handle_reject_ask()
imgui.close_current_popup() imgui.close_current_popup()
imgui.end_popup() imgui.end_popup()
# MMA Step Approval Modal
#region: MMA Step Approval Modal
if self._pending_mma_approvals: if self._pending_mma_approvals:
if not self._mma_approval_open: if not self._mma_approval_open:
imgui.open_popup("MMA Step Approval") imgui.open_popup("MMA Step Approval")
@@ -1292,7 +1303,9 @@ class App:
self._handle_mma_respond(approved=False) self._handle_mma_respond(approved=False)
imgui.close_current_popup() imgui.close_current_popup()
imgui.end_popup() imgui.end_popup()
# MMA Spawn Approval Modal #endregion: MMA Step Approval Modal
#region: MMA Spawn Approval Modal
if self._pending_mma_spawns: if self._pending_mma_spawns:
if not self._mma_spawn_open: if not self._mma_spawn_open:
imgui.open_popup("MMA Spawn Approval") imgui.open_popup("MMA Spawn Approval")
@@ -1302,6 +1315,7 @@ class App:
self._mma_spawn_context = self._pending_mma_spawns[0].get("context_md", "") self._mma_spawn_context = self._pending_mma_spawns[0].get("context_md", "")
else: else:
self._mma_spawn_open = False self._mma_spawn_open = False
if imgui.begin_popup_modal("MMA Spawn Approval", None, imgui.WindowFlags_.always_auto_resize)[0]: if imgui.begin_popup_modal("MMA Spawn Approval", None, imgui.WindowFlags_.always_auto_resize)[0]:
if not self._pending_mma_spawns: if not self._pending_mma_spawns:
imgui.close_current_popup() imgui.close_current_popup()
@@ -1336,7 +1350,9 @@ class App:
self._handle_mma_respond(approved=False, abort=True) self._handle_mma_respond(approved=False, abort=True)
imgui.close_current_popup() imgui.close_current_popup()
imgui.end_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]: 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_colored(imgui.ImVec4(1, 0.3, 0.3, 1), "The dependency graph contains a cycle!")
imgui.text("Please remove the circular dependency.") imgui.text("Please remove the circular dependency.")
@@ -1463,10 +1479,13 @@ class App:
else: else:
imgui.input_text_multiline("##tv_c", self.text_viewer_content, imgui.ImVec2(-1, -1), imgui.InputTextFlags_.read_only) imgui.input_text_multiline("##tv_c", self.text_viewer_content, imgui.ImVec2(-1, -1), imgui.InputTextFlags_.read_only)
imgui.end() imgui.end()
# Inject File Modal #endregion: Cycle Detected Popup
#region: Inject File Modal
if getattr(self, "show_inject_modal", False): if getattr(self, "show_inject_modal", False):
imgui.open_popup("Inject File") imgui.open_popup("Inject File")
self.show_inject_modal = False self.show_inject_modal = False
if imgui.begin_popup_modal("Inject File", None, imgui.WindowFlags_.always_auto_resize)[0]: if imgui.begin_popup_modal("Inject File", None, imgui.WindowFlags_.always_auto_resize)[0]:
files = self.project.get('files', {}).get('paths', []) files = self.project.get('files', {}).get('paths', [])
imgui.text("Select File to Inject:") imgui.text("Select File to Inject:")
@@ -1506,8 +1525,10 @@ class App:
if imgui.button("Cancel", imgui.ImVec2(120, 0)): if imgui.button("Cancel", imgui.ImVec2(120, 0)):
imgui.close_current_popup() imgui.close_current_popup()
imgui.end_popup() imgui.end_popup()
#endregion: Inject File Modal
self._render_ast_inspector_modal() self._render_ast_inspector_modal()
#endregion: Absurd Try Scope
except Exception as e: except Exception as e:
print(f"ERROR in _gui_func: {e}") print(f"ERROR in _gui_func: {e}")
@@ -2907,6 +2928,7 @@ class App:
imgui.separator() imgui.separator()
#region: Screenshots
if imgui.collapsing_header("Screenshots"): if imgui.collapsing_header("Screenshots"):
for i, s in enumerate(self.screenshots): for i, s in enumerate(self.screenshots):
imgui.text(s) imgui.text(s)
@@ -2940,6 +2962,7 @@ class App:
if getattr(self, "ui_active_context_preset", ""): if getattr(self, "ui_active_context_preset", ""):
self.delete_context_preset(self.ui_active_context_preset) self.delete_context_preset(self.ui_active_context_preset)
self.ui_active_context_preset = "" self.ui_active_context_preset = ""
#endregion Screenshots
def _render_snapshot_tab(self) -> None: def _render_snapshot_tab(self) -> None:
if imgui.begin_tab_bar("snapshot_tabs"): if imgui.begin_tab_bar("snapshot_tabs"):