From b8485073da064925e6ed79132c6ad095f7a5db0b Mon Sep 17 00:00:00 2001 From: Ed_ Date: Fri, 6 Mar 2026 14:33:29 -0500 Subject: [PATCH] feat(gui): Add 'Force Prune Logs' button to Log Management panel. --- src/app_controller.py | 6 ++++++ src/gui_2.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/app_controller.py b/src/app_controller.py index f42d57a..4a5684f 100644 --- a/src/app_controller.py +++ b/src/app_controller.py @@ -328,6 +328,7 @@ class AppController: 'btn_approve_tool': self._handle_approve_ask, 'btn_approve_mma_step': 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]] = { '_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._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: """Loads the active project configuration, with fallbacks.""" if self.active_project_path and Path(self.active_project_path).exists(): diff --git a/src/gui_2.py b/src/gui_2.py index de0be86..57dd77b 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -825,6 +825,9 @@ class App: reason="Manually whitelisted" ) imgui.end_table() + + if imgui.button("Force Prune Logs"): + self.controller.event_queue.put("gui_task", {"action": "click", "item": "btn_prune_logs"}) imgui.end() def _render_files_panel(self) -> None: