2.2 KiB
2.2 KiB
Specification: Fix GUI Crashes in Tool Preset Manager and Discussion Hub
Overview
This track addresses several critical crashes in the immediate-mode GUI (gui_2.py) related to the Tool Preset Manager and the Discussion Hub. These issues include Python exceptions (NameError, IndexError) and underlying ImGui rendering assertion failures (PopID() too many times, Must call EndChild() and not End()!).
Functional Requirements
- Tool Preset Manager Fixes:
- Resolve the
NameError: name 'current_cat_tools' is not definedwhen interacting with or modifying tool preset entries (e.g., changing approval from "auto" to "ask"). - Fix the ImGui scope mismatch (
Must call EndChild() and not End()!) in thetp_scroll_2FED8981child window.
- Resolve the
- Discussion Hub Fixes:
- Resolve the
IndexError: list index out of rangeinrender_discussion_entriesthat occurs when deleting a discussion entry. - Fix the associated ImGui scope mismatches (
Calling PopID() too many times!) in theHistoryChild_AB39D74Awindow and tabs that trigger after the exception occurs.
- Resolve the
- 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
imscopecontext managers should be verified. - Code Style: Fixes must adhere to the 1-space indentation rule for Python code and follow the "ImGui Defer Patterns" described in the code style guides.
Acceptance Criteria
- Modifying a tool preset (e.g., changing the approval status of
ts_cpptools) does not raise aNameErroror crash the application. - Deleting a discussion entry removes the entry visually and does not raise an
IndexError. - Both panels can be interacted with, opened, and closed without triggering ImGui assertion failures.
- The
scripts/check_imgui_scopes.pylinter passes without new errors.
Out of Scope
- Adding new features to the Tool Preset Manager or Discussion Hub.
- General refactoring of the GUI outside of fixing these specific crash points.