feat(gui): Add 'Force Prune Logs' button to Log Management panel.

This commit is contained in:
2026-03-06 14:33:29 -05:00
parent 81d8906811
commit b8485073da
2 changed files with 9 additions and 0 deletions

View File

@@ -328,6 +328,7 @@ class AppController:
'btn_approve_tool': self._handle_approve_ask, 'btn_approve_tool': self._handle_approve_ask,
'btn_approve_mma_step': lambda: self._handle_mma_respond(approved=True), 'btn_approve_mma_step': lambda: self._handle_mma_respond(approved=True),
'btn_approve_spawn': lambda: self._handle_mma_respond(approved=True), 'btn_approve_spawn': lambda: self._handle_mma_respond(approved=True),
'btn_prune_logs': self.cb_prune_logs,
} }
self._predefined_callbacks: dict[str, Callable[..., Any]] = { self._predefined_callbacks: dict[str, Callable[..., Any]] = {
'_test_callback_func_write_to_file': self._test_callback_func_write_to_file, '_test_callback_func_write_to_file': self._test_callback_func_write_to_file,
@@ -662,6 +663,11 @@ class AppController:
self.is_viewing_prior_session = True self.is_viewing_prior_session = True
self._set_status(f"viewing prior session: {Path(path).name} ({len(entries)} entries)") self._set_status(f"viewing prior session: {Path(path).name} ({len(entries)} entries)")
def cb_prune_logs(self) -> None:
"""Manually triggers the log pruning process."""
self._set_status("Pruning logs...")
self._prune_old_logs()
def _load_active_project(self) -> None: def _load_active_project(self) -> None:
"""Loads the active project configuration, with fallbacks.""" """Loads the active project configuration, with fallbacks."""
if self.active_project_path and Path(self.active_project_path).exists(): if self.active_project_path and Path(self.active_project_path).exists():

View File

@@ -825,6 +825,9 @@ class App:
reason="Manually whitelisted" reason="Manually whitelisted"
) )
imgui.end_table() imgui.end_table()
if imgui.button("Force Prune Logs"):
self.controller.event_queue.put("gui_task", {"action": "click", "item": "btn_prune_logs"})
imgui.end() imgui.end()
def _render_files_panel(self) -> None: def _render_files_panel(self) -> None: