Private
Public Access
0
0

fix(gui): remove orphan pop_style_color in render_comms_history_panel

ROOT CAUSE: In a previous fix (df7bda6e 'explicit child size for
comms_scroll and prior_scroll'), the code that pushed a child_bg style
color at the start of render_comms_history_panel was removed when the
section was rewritten to use imgui.get_content_region_avail() for
explicit child sizing. However, the matching pop_style_color at the end
of the function (guarded by 'if app.is_viewing_prior_session') was left
in place.

RESULT: When viewing a prior session, the imscope.style_color in
_gui_func pushes 1 color at the start of the frame, then the orphaned
pop in render_comms_history_panel decrements the imGui style counter
by 1, then _gui_func's imscope __exit__ tries to pop again — triggering
IM_ASSERT 'PopStyleColor() too many times!'.

This caused a cascade of imGui state corruption on every frame after
loading a prior session log, manifesting as 'too many times' assertions
on the next frame and 'Must call EndChild() and not End()' once the
style stack underflowed.

FIX: Remove the orphan pop_style_color at gui_2.py:3761. No matching
push exists, so the pop is unconditionally wrong.

TESTS:
- New test_comms_no_extraneous_pop.py asserts push/pop balance in
  render_comms_history_panel when is_viewing_prior_session is True
- 43/43 broad regression pass
This commit is contained in:
2026-06-03 14:25:59 -04:00
parent ea8061b418
commit 228359679d
2 changed files with 51 additions and 3 deletions
+2 -3
View File
@@ -3757,9 +3757,8 @@ def render_comms_history_panel(app: App) -> None:
imgui.set_scroll_here_y(1.0)
app._scroll_comms_to_bottom = False
imgui.end_child()
if app.is_viewing_prior_session: imgui.pop_style_color()
if app.perf_profiling_enabled: app.perf_monitor.end_component("_render_comms_history_panel")
imgui.end_child()
if app.perf_profiling_enabled: app.perf_monitor.end_component("_render_comms_history_panel")
def render_takes_panel(app: App) -> None:
imgui.text("Takes & Synthesis")