From f2054fbaf3f273b987c54c06b64224570764787a Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 29 Jun 2026 23:43:25 -0400 Subject: [PATCH] fix(gui): replace self with app in render_theme_panel render_theme_panel is a module-level function that takes app as its parameter, but two lines still referenced 'self' (line 6373 and 6376). The function was converted from a method (_render_theme_panel) to a module-level function in the module_taxonomy_refactor_20260627 Phase 1.3 (commit 3dd153f7), but the self -> app substitution was missed. Symptom: on every frame, render_theme_panel called imgui.begin('Theme', ...) which pushed the Theme window onto the imgui stack. Then the 'getattr(self, ...)' raised NameError. The exception was swallowed by _render_main_interface_result's try/except, but the imgui.end() call at the end of the function was never reached. The Theme window stayed pushed on the stack, and HelloImGui's auto-managed MainDockSpace asserted 'Missing End()' on every frame. The bug was masked earlier by commit 71028dad, which fixed a stale 'from src.command_palette import' in render_main_interface. Before that fix, render_main_interface aborted entirely every frame, so the Theme window's never-reached end() was hidden behind a different error. Bisect confirmed: disabling any other default-visible window left the error; only disabling Theme made /api/gui_health report healthy=True. Verification: - tests/test_default_layout_install.py: 3/3 PASS (install behavior unchanged) - tests/test_api_hooks_gui_health_live.py: 1/1 PASS (was failing) - tests/test_command_palette_sim.py: 7/7 PASS - tests/test_saved_presets_sim.py: 2/2 PASS --- src/gui_2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui_2.py b/src/gui_2.py index 7d645b21..6793917a 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -6370,10 +6370,10 @@ def render_theme_panel(app: App) -> None: ch_ct, ctrans = imgui.slider_float("##ctrans", theme.get_child_transparency(), 0.1, 1.0, "%.2f") if ch_ct: theme.set_child_transparency(ctrans) - bg_enabled = getattr(self, 'bg_shader_enabled', False) + bg_enabled = getattr(app, 'bg_shader_enabled', False) ch_bg, new_bg = imgui.checkbox("Animated Background Shader", bg_enabled) if ch_bg and new_bg != bg_enabled: - self.bg_shader_enabled = new_bg + app.bg_shader_enabled = new_bg gui_cfg = app.config.setdefault("gui", {}) gui_cfg["bg_shader_enabled"] = new_bg if hasattr(app, "_flush_to_config"): app._flush_to_config()