# Implementation Plan: GUI Refactor & Stabilization

## Phase 1: Linting & Verification Foundations [checkpoint: 294217c]
- [x] Task: Develop custom AST linter for ImGui scope/indentation in `scripts/check_imgui_scopes.py`. c359961
- [x] Task: Write tests for the new AST linter to ensure it catches unclosed scopes and indentation mismatches. c359961
- [x] Task: Expand API hooks in `src/api_hooks.py` to better simulate complex UI interactions (e.g., specific widget clicks, drag operations). a3b117d
- [x] Task: Write tests for the new API hooks. a3b117d
- [x] Task: Conductor - User Manual Verification 'Linting & Verification Foundations' (Protocol in workflow.md) 294217c

## Phase 2: Targeted Sub-agent Test Framework [checkpoint: 972ff1b]
- [x] Task: Design and implement a focused test suite structure in `tests/` specifically for rapid sub-agent GUI verification without full E2E overhead. 7c0ce9d
- [x] Task: Migrate or create at least 3 high-value tests for the main panel rendering paths into this new suite. 7c0ce9d
- [x] Task: Verify the targeted suite runs quickly and reliably. 7c0ce9d
- [x] Task: Conductor - User Manual Verification 'Targeted Sub-agent Test Framework' (Protocol in workflow.md) 972ff1b

## Phase 3: Piecemeal Refactoring - Main Panels (Part 1) [checkpoint: f3e307f]
- [x] Task: Audit `gui_2.py` main panel rendering functions to identify the most critical scoping issues based on recent commits. 325970e
- [x] Task: Refactor the first identified critical panel rendering path in `gui_2.py` to use `imgui_scopes.py` patterns. 325970e
- [x] Task: Run targeted sub-agent tests and the custom AST linter against the modified panel. Fix any failures. 325970e
- [x] Task: Conductor - User Manual Verification 'Piecemeal Refactoring - Main Panels (Part 1)' (Protocol in workflow.md) f3e307f

## Phase 4: Piecemeal Refactoring - Main Panels (Part 2) [checkpoint: f79cdb9]
- [x] Task: Refactor the second identified critical panel rendering path in `gui_2.py` to use `imgui_scopes.py` patterns. dd44582
- [x] Task: Run targeted sub-agent tests and the custom AST linter against the modified panel. Fix any failures. dd44582
- [x] Task: Run the full E2E test suite to ensure no broad regressions were introduced. dd44582
- [x] Task: Conductor - User Manual Verification 'Piecemeal Refactoring - Main Panels (Part 2)' (Protocol in workflow.md) f79cdb9