From 7de5625b713b48a9851a3e433f8a0995eca805be Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 1 Jun 2026 17:03:29 -0400 Subject: [PATCH] chore(conductor): Mark track 'Fix GUI Crashes in Tool Preset Manager and Discussion Hub' as complete after Phase 4 --- conductor/tracks/gui_crash_fixes_20260531/plan.md | 7 ++++++- conductor/tracks/gui_crash_fixes_20260531/spec.md | 2 ++ src/app_controller.py | 1 + src/gui_2.py | 9 ++++++--- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/conductor/tracks/gui_crash_fixes_20260531/plan.md b/conductor/tracks/gui_crash_fixes_20260531/plan.md index 84222ce4..87524f42 100644 --- a/conductor/tracks/gui_crash_fixes_20260531/plan.md +++ b/conductor/tracks/gui_crash_fixes_20260531/plan.md @@ -13,4 +13,9 @@ ## Phase 3: Global Verification - [x] Task: Run `python scripts/check_imgui_scopes.py` to statically verify all ImGui scopes are correct across the codebase. - [x] Task: Run automated test suite to ensure no regressions were introduced. -- [x] Task: Conductor - User Manual Verification 'Global Verification' (Protocol in workflow.md) \ No newline at end of file +- [x] Task: Conductor - User Manual Verification 'Global Verification' (Protocol in workflow.md) + +## Phase 4: Fix Take Tab Switching Bug +- [x] Task: Investigate the logic that handles switching between Takes in the Discussion Hub (e.g. `render_takes_panel` or similar tab rendering function) to find why it reverts state. +- [x] Task: Fix the state management bug causing the 1-frame flicker so the selected take persists. +- [x] Task: Conductor - User Manual Verification 'Fix Take Tab Switching' (Protocol in workflow.md) \ No newline at end of file diff --git a/conductor/tracks/gui_crash_fixes_20260531/spec.md b/conductor/tracks/gui_crash_fixes_20260531/spec.md index 8428ccfa..91af8070 100644 --- a/conductor/tracks/gui_crash_fixes_20260531/spec.md +++ b/conductor/tracks/gui_crash_fixes_20260531/spec.md @@ -10,6 +10,8 @@ This track addresses several critical crashes in the immediate-mode GUI (`gui_2. - **Discussion Hub Fixes:** - Resolve the `IndexError: list index out of range` in `render_discussion_entries` that occurs when deleting a discussion entry. - Fix the associated ImGui scope mismatches (`Calling PopID() too many times!`) in the `HistoryChild_AB39D74A` window and tabs that trigger after the exception occurs. +- **Take Management Fixes:** + - Fix the bug where clicking a Take tab fails to switch the active take and falls back to the original take, causing a 1-frame flicker. ## Non-Functional Requirements - **ImGui Scope Safety:** Ensure all ImGui push/pop and begin/end pairs are correctly matched, even when exceptions are raised or lists are modified during rendering. The use of `imscope` context managers should be verified. diff --git a/src/app_controller.py b/src/app_controller.py index 1fbbd3f5..2f1da092 100644 --- a/src/app_controller.py +++ b/src/app_controller.py @@ -3011,6 +3011,7 @@ class AppController: self.ai_status = f"discussion not found: {name}" return self.active_discussion = name + self._force_tab_selection = True self._track_discussion_active = False disc_sec["active"] = name disc_data = discussions[name] diff --git a/src/gui_2.py b/src/gui_2.py index 0c2e4206..b22af62a 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -3905,9 +3905,12 @@ def render_discussion_selector(app: App) -> None: if imgui.begin_tab_bar("discussion_takes_tabs"): for take_name in current_takes: label = "Original" if take_name == active_base else take_name.replace(f"{active_base}_", "").replace("_", " ").title() - flags = imgui.TabItemFlags_.set_selected if take_name == app.active_discussion else 0 - with imscope.tab_item(f"{label}###{take_name}", flags) as (exp, _): - if exp and take_name != app.active_discussion: app._switch_discussion(take_name) + force_flag = imgui.TabItemFlags_.set_selected if take_name == app.active_discussion and getattr(app, '_force_tab_selection', False) else 0 + with imscope.tab_item(f"{label}###{take_name}", force_flag) as (exp, _): + if exp and take_name != app.active_discussion: + app._switch_discussion(take_name) + app._force_tab_selection = False + app._force_tab_selection = False with imscope.tab_item("Synthesis###Synthesis") as (exp, _): if exp: render_synthesis_panel(app) imgui.end_tab_bar()